Hi,
--- On Fri, 1/23/09, Subrata Modak <[email protected]> wrote: > From: Subrata Modak <[email protected]> > Subject: [LTP] [PATCH 05/14] Fix Hugepages Allocate Hugepages only if > available to Hugepageshmget03 remaining fixes > To: "Mark130" <[email protected]> > Cc: "ltp-list" <[email protected]>, "maknayak" <[email protected]> > Date: Friday, January 23, 2009, 3:29 PM > Signed-Off-By: Subrata > Modak<[email protected]>, A little hard to review this series of patches inline, because the indentation is broken. Moreover, some lines in the attachment are very long. Maybe a coding style guide would help? CAI Qian > -- > diff -uprN > ltp-intermediate-20090121.orig/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c > ltp-intermediate-20090121/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c > --- > ltp-intermediate-20090121.orig/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c > 2009-01-23 10:57:26.000000000 +0530 > +++ > ltp-intermediate-20090121/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c > 2009-01-23 11:08:33.000000000 +0530 > @@ -59,7 +59,7 @@ int TST_TOTAL = 1; > extern int Tst_count; > > int exp_enos[] = {ENOSPC, 0}; /* 0 terminated list of > expected errnos */ > - > +void setup2(unsigned long huge_pages_shm_to_be_allocated); > /* > * The MAXIDS value is somewhat arbitrary and may need to > be increased > * depending on the system being tested. > @@ -83,13 +83,14 @@ int main(int ac, char **av) > tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - > %s", msg); > } > > - setup(); /* global setup */ > - > /* The following loop checks looping state if -i option > given */ > if ( get_no_of_hugepages() <= 0 || > hugepages_size() <= 0 ) > tst_brkm(TBROK, cleanup, "Test cannot be > continued owning > to sufficient availability of Hugepages on the > system"); > else > huge_pages_shm_to_be_allocated = ( > get_no_of_hugepages() * > hugepages_size() * 1024) / 2 ; > + > + setup2(huge_pages_shm_to_be_allocated); /* local setup > */ > + > > for (lc = 0; TEST_LOOPING(lc); lc++) { > /* reset Tst_count in case we are looping */ > @@ -128,11 +129,9 @@ int main(int ac, char **av) > } > > /* > - * setup() - performs all the ONE TIME setup for this > test. > + * setup2() - performs all the ONE TIME setup for this > test. > */ > -void > -setup(void) > -{ > +void setup2(unsigned long huge_pages_shm_to_be_allocated) > { > /* capture signals */ > tst_sig(NOFORK, DEF_HANDLER, cleanup); > > @@ -156,7 +155,7 @@ setup(void) > * Use a while loop to create the maximum number of memory > segments. > * If the loop exceeds MAXIDS, then break the test and > cleanup. > */ > - while ((shm_id_1 = shmget(IPC_PRIVATE, HUGE_SHM_SIZE, > SHM_HUGETLB | > IPC_CREAT | > + while ((shm_id_1 = shmget(IPC_PRIVATE, > huge_pages_shm_to_be_allocated, > SHM_HUGETLB | IPC_CREAT | > IPC_EXCL | SHM_RW)) != -1) { > shm_id_arr[num_shms++] = shm_id_1; > if (num_shms == MAXIDS) { > > > Regards-- > Subrata > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword_______________________________________________ > Ltp-list mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/ltp-list ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
