Hi,
--- On Fri, 1/23/09, Subrata Modak <[email protected]> wrote: > From: Subrata Modak <[email protected]> > Subject: [LTP] [PATCH 10/14] Fix Hugepages Allocate Hugepages only if > available to Hugeshmat03 > To: "Mark130" <[email protected]> > Cc: "ltp-list" <[email protected]>, "maknayak" <[email protected]> > Date: Friday, January 23, 2009, 3:30 PM > Signed-Off-By: Subrata > Modak<[email protected]>, > -- > diff -uprN > ltp-intermediate-20090121.orig/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c > ltp-intermediate-20090121/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c > --- > ltp-intermediate-20090121.orig/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c > 2009-01-23 11:44:11.000000000 +0530 > +++ > ltp-intermediate-20090121/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c > 2009-01-23 11:45:30.000000000 +0530 > @@ -58,10 +58,12 @@ > */ > > #include "ipcshm.h" > +#include "system_specific_hugepages_info.h" > > char *TCID = "hugeshmat03"; > int TST_TOTAL = 1; > extern int Tst_count; > +unsigned long huge_pages_shm_to_be_allocated; > > int exp_enos[] = {EACCES, 0}; /* 0 terminated list of > expected errnos */ > > @@ -83,6 +85,11 @@ int main(int ac, char **av) > tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - > %s", msg); > } > > + 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 "owing to"? CAI Qian > system"); > + else > + huge_pages_shm_to_be_allocated = ( > get_no_of_hugepages() * > hugepages_size() * 1024) / 2 ; > + > setup(); /* global setup */ > > if ((pid = fork()) == -1) { > @@ -187,8 +194,7 @@ setup(void) > shmkey = getipckey(); > > /* create a shared memory segment with read and write > permissions */ > - if ((shm_id_1 = shmget(shmkey, HUGE_SHM_SIZE, > - SHM_HUGETLB | SHM_RW | IPC_CREAT | IPC_EXCL)) == > -1) { > + if ((shm_id_1 = shmget(shmkey, > huge_pages_shm_to_be_allocated, > SHM_HUGETLB | SHM_RW | IPC_CREAT | IPC_EXCL)) == -1) { > tst_brkm(TBROK, cleanup, "Failed to create shared > memory " > "segment in setup"); > } > > > 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
