On Mon, 2008-08-11 at 18:19 +0800, Jin Bing Guo wrote: > Sorry for the format error of my patch. I resent it by an attachment . > Please check it. > > > Signed-off-by: Jin Bing Guo <[EMAIL PROTECTED]>
This too is also working fine. I have merged this patch also. Thanks. Regards-- Subrata > ------- > Fix_HPAGE_SIZE_hugemmap04.patch > > > (See attached file: Fix_HPAGE_SIZE_hugemmap04.patch) > > Best regards! > > Jin Bing Guo 郭晋兵 > > Linux for System p Test > IBM China Systems & Technology Laboratory in Beijing > Tel: +86-10-82454439 > Email: [EMAIL PROTECTED] > ------------------------------------- > "Do today what others won't so tomorrow you do what other's can't" > > > > Inactive hide details for Subrata Modak ---08/11/2008 04:56:40 > PM---This one too didn´t apply. The error:Subrata Modak ---08/11/2008 > 04:56:40 PM---This one too didn´t apply. The error: > > Subrata Modak <[EMAIL PROTECTED]> > > 08/11/2008 04:41 PM > Please respond to > [EMAIL PROTECTED] > > > To > > Jin Bing > Guo/China/[EMAIL PROTECTED] > > cc > > ltp-list > <[email protected]> > > Subject > > Re: [LTP] LTP] > [PATCH 2/2] Get > the huge page > size in > hugemmap04 > > > > This one too didn´t apply. The error: > > $ patch --dry-run -p1 < ../11_08_2008-\([EMAIL PROTECTED] > \)-001_hugemmap04.patch > missing header for unified diff at line 147 of patch > patching file testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c > Hunk #1 FAILED at 73. > Hunk #2 FAILED at 91. > Hunk #3 succeeded at 105 with fuzz 2. > 2 out of 3 hunks FAILED -- saving rejects to file > testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c.rej > missing header for unified diff at line 172 of patch > can't find file to patch at input line 172 > Perhaps you used the wrong -p or --strip option? > The text leading up to this was: > -------------------------- > |hugetlbfs */ > -------------------------- > File to patch: testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c > patching file testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c > Hunk #1 FAILED at 129. > patch: **** malformed patch at line 192: %d",freepages); > > > Can you please resend this once again ? > > Regards-- > Subrata > > On Thu, 2008-08-07 at 14:11 +0800, Jin Bing Guo wrote: > > In hugemmap04, the huge page size was defined as a macro-definition. > > > > #define HUGE_PAGE ((1UL) << 20) /* Huge page size */ */ > > > > However different architecture may has different huge page size in > > kernel. Such as : > > > > 1. http://lxr.linux.no/linux/include/asm-i386/page.h#L122 > > #define HPAGE_SHIFT 22 > > #define HPAGE_SIZE ((1UL) << HPAGE_SHIFT) // the size > is > > 4M > > > > 2. http://lxr.linux.no/linux/include/asm-parisc/page.h#L160 > > #define HPAGE_SHIFT 22 /* 4MB (is this fixed?) > */ > > #define HPAGE_SIZE ((1UL) << HPAGE_SHIFT) > > > > 3. PPC: 16M > > > > So reading the huge page size from the kernel parameters is more > > precise to this test case. > > The solution is to get the huge page size from the /proc/meminfo. > > > > Signed-off-by: Jin Bing Guo <[EMAIL PROTECTED]> > > > ------------------------------------------------------------------------------------ > > --- > > > ltp-full-20080731.orig/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c > 2008-05-06 09:27:34.000000000 -0500 > > +++ > > ltp-full-20080731/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c > > 2008-08-06 22:56:04.000000000 -0500 > > @@ -73,7 +73,6 @@ > > #include "test.h" > > #include "usctest.h" > > > > -#define HUGE_PAGE ((1UL) << 20) /* Huge page size */ > > #define BUFFER_SIZE 256 > > > > char* TEMPFILE="mmapfile"; > > @@ -92,6 +91,7 @@ > > > > void setup(); /* Main setup function of test */ > > int getfreehugepages(); /* Reads free huge pages */ > > +int get_huge_pagesize(); /* Reads huge page size */ > > void cleanup(); /* cleanup function for the test */ > > > > void help() > > @@ -105,6 +105,7 @@ > > int lc; /* loop counter */ > > char *msg; /* message returned from parse_opts */ > > int Hflag=0; /* binary flag: opt or not */ > > + int huge_pagesize=0; > > > > option_t options[] = { > > { "H:", &Hflag, &Hopt }, /* Required for location of hugetlbfs */ > > @@ -128,7 +129,7 @@ > > > > /* Check looping state if -i option given */ > > for (lc = 0; TEST_LOOPING(lc); lc++) { > > - > > + > > /* Creat a temporary file used for mapping */ > > if ((fildes = open(TEMPFILE, O_RDWR | O_CREAT, 0666)) < 0) { > > tst_brkm(TFAIL, cleanup, > > @@ -141,6 +142,11 @@ > > /* Note the number of free huge pages BEFORE testing */ > > freepages = getfreehugepages(); > > beforetest = freepages; > > + > > + /* Note the size of huge page size BEFORE testing */ > > + huge_pagesize = get_huge_pagesize(); > > + tst_resm(TINFO,"Size of huge pages is %d KB",huge_pagesize); > > + > > #if __WORDSIZE==32 > > tst_resm(TINFO,"Total amount of free huge pages is %d",freepages); > > tst_resm(TINFO,"Max number allowed for 1 mmap file in 32-bits is > > 128"); > > @@ -151,7 +157,7 @@ > > * Call mmap > > */ > > errno = 0; > > - mapsize=(long long)freepages*HUGE_PAGE; > > + mapsize=(long long)freepages*huge_pagesize*1024; > > addr = mmap(NULL, mapsize, PROT_READ | PROT_WRITE, > > MAP_SHARED, fildes, 0); > > TEST_ERRNO = errno; > > @@ -246,6 +252,34 @@ > > } > > > > /* > > + * get_huge_pagesize() - Reads the size of huge page size > > from /proc/meminfo > > +*/ > > +int > > +get_huge_pagesize() > > +{ > > + int hugesize; > > + FILE* f; > > + int retcode=0; > > + char buff[BUFFER_SIZE]; > > + > > + f = fopen("/proc/meminfo", "r"); > > + if (!f) > > + tst_brkm(TFAIL, cleanup, "Could not open /proc/meminfo for > > reading"); > > + > > + while(fgets(buff,BUFFER_SIZE, f) != NULL){ > > + if((retcode = sscanf(buff, "Hugepagesize: %d ", &hugesize)) == 1) > > + break; > > + } > > + > > + if (retcode != 1) { > > + fclose(f); > > + tst_brkm(TFAIL, cleanup, "Failed reading size of huge page."); > > + } > > + fclose(f); > > + return(hugesize); > > +} > > + > > +/* > > * cleanup() - performs all ONE TIME cleanup for this test at > > * completion or premature exit. > > * Remove the temporary directory created. > > > > > > Best regards! > > > > Jin Bing Guo 郭晋兵 > > > > > > > > > > > ------------------------------------------------------------------------- > > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > > Build the coolest Linux based applications with Moblin SDK & win > great prizes > > Grand prize is a trip for two to an Open Source event anywhere in > the world > > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > _______________________________________________ Ltp-list mailing > list [email protected] > https://lists.sourceforge.net/lists/listinfo/ltp-list > > > > ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
