Re: [PATCH] fork_init: fix division by zero

2008-12-10 Thread Scott Wood
On Wed, Dec 10, 2008 at 01:29:12PM +0300, Yuri Tikhonov wrote: > On Wednesday, December 10, 2008 you wrote: > > x * y / z is parsed as (x * y) / z, not x * (y / z). > > Here we believe in preprocessor: since all PAGE_SIZE, 8, and > THREAD_SIZE are the constants we expect it will calculate this.

Re: [PATCH] fork_init: fix division by zero

2008-12-10 Thread Al Viro
On Wed, Dec 10, 2008 at 01:01:13PM +0300, Yuri Tikhonov wrote: > >> + max_threads = mempages * PAGE_SIZE / (8 * THREAD_SIZE); > > > >> +#endif > > > Can't this overflow, e.g. on 32-bit machines with HIGHMEM? > > The multiplier here is not PAGE_SIZE

Re: [PATCH] fork_init: fix division by zero

2008-12-10 Thread Geert Uytterhoeven
On Tue, 9 Dec 2008, Yuri Tikhonov wrote: > The following patch fixes divide-by-zero error for the > cases of really big PAGE_SIZEs (e.g. 256KB on ppc44x). > Support for such big page sizes on 44x is not present in the > current kernel yet, but coming soon. > > Also this patch fixes the comment for