Re: [PATCH] mm: negative left shift count when PAGE_SHIFT > 20

2013-07-20 Thread Jerry
2013/7/20 Andrew Morton : > On Fri, 19 Jul 2013 07:47:02 +0800 Jerry wrote: > >> 2013/7/19 Andrew Morton : >> > On Fri, 19 Jul 2013 00:56:12 +0800 Jerry wrote: >> > >> >> When PAGE_SHIFT > 20, the result of "20 - PAGE_SHIFT" is negative. The >> >> calculating here will generate an unexpected resu

[PATCH] mm: negative left shift count when PAGE_SHIFT > 20

2013-07-20 Thread Jerry Zhou
When PAGE_SHIFT > 20, the result of "20 - PAGE_SHIFT" is negative. The previous calculating here will generate an unexpected result. In addition, if PAGE_SIZE >= 1MB, The memory size of "numentries" was already integral multiple of 1MB. Signed-off-by: Jerry Zhou --- mm/page_alloc.c | 7 ---

Re: [PATCH] mm: negative left shift count when PAGE_SHIFT > 20

2013-07-19 Thread Andrew Morton
On Fri, 19 Jul 2013 07:47:02 +0800 Jerry wrote: > 2013/7/19 Andrew Morton : > > On Fri, 19 Jul 2013 00:56:12 +0800 Jerry wrote: > > > >> When PAGE_SHIFT > 20, the result of "20 - PAGE_SHIFT" is negative. The > >> calculating here will generate an unexpected result. In addition, if > >> PAGE_SHIF

Re: [PATCH] mm: negative left shift count when PAGE_SHIFT > 20

2013-07-18 Thread Jerry
2013/7/19 Andrew Morton : > On Fri, 19 Jul 2013 00:56:12 +0800 Jerry wrote: > >> When PAGE_SHIFT > 20, the result of "20 - PAGE_SHIFT" is negative. The >> calculating here will generate an unexpected result. In addition, if >> PAGE_SHIFT > 20, The memory size represented by numentries was already

Re: [PATCH] mm: negative left shift count when PAGE_SHIFT > 20

2013-07-18 Thread Andrew Morton
On Fri, 19 Jul 2013 00:56:12 +0800 Jerry wrote: > When PAGE_SHIFT > 20, the result of "20 - PAGE_SHIFT" is negative. The > calculating here will generate an unexpected result. In addition, if > PAGE_SHIFT > 20, The memory size represented by numentries was already > integral multiple of 1MB. >

Re: [PATCH] mm: negative left shift count when PAGE_SHIFT > 20

2013-07-18 Thread John Stoffel
Jerry> When PAGE_SHIFT > 20, the result of "20 - PAGE_SHIFT" is negative. The Jerry> calculating here will generate an unexpected result. In addition, if Jerry> PAGE_SHIFT > 20, The memory size represented by numentries was already Jerry> integral multiple of 1MB. Why this magic number of 20? Pl

Re: [PATCH] mm: negative left shift count when PAGE_SHIFT > 20

2013-07-18 Thread Jerry
> Jerry> When PAGE_SHIFT > 20, the result of "20 - PAGE_SHIFT" is negative. The > Jerry> calculating here will generate an unexpected result. In addition, if > Jerry> PAGE_SHIFT > 20, The memory size represented by numentries was already > Jerry> integral multiple of 1MB. > > Why this magic number

[PATCH] mm: negative left shift count when PAGE_SHIFT > 20

2013-07-18 Thread Jerry
When PAGE_SHIFT > 20, the result of "20 - PAGE_SHIFT" is negative. The calculating here will generate an unexpected result. In addition, if PAGE_SHIFT > 20, The memory size represented by numentries was already integral multiple of 1MB. Signed-off-by: Jerry --- mm/page_alloc.c | 8 +--- 1 fi