Messages in this thread Patch in this message |  | | | From | Thomas Schlichter <> | | Subject | Re: 2.6.0-test8-mm1 | | Date | Mon, 20 Oct 2003 13:18:31 +0200 |
| |
On Monday 20 October 2003 11:05, Andrew Morton wrote: > ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.0-test8/2 >.6.0-test8-mm1 ~~ snip ~~ > +fix-sqrt.patch > > Fix int_sqrt().
I really like this one... ;-)
The problem ist that oom_kill.c assumes that int_sqrt() never returns 0. So we could get a division by zero there :-(
The attached patch fixes that...
Regards Thomas --- linux-2.6.0-test8-mm1/mm/oom_kill.c.orig Mon Oct 20 12:49:58 2003 +++ linux-2.6.0-test8-mm1/mm/oom_kill.c Mon Oct 20 12:52:55 2003 @@ -63,8 +63,8 @@ cpu_time = (p->utime + p->stime) >> (SHIFT_HZ + 3); run_time = (get_jiffies_64() - p->start_time) >> (SHIFT_HZ + 10); - points /= int_sqrt(cpu_time); - points /= int_sqrt(int_sqrt(run_time)); + points /= cpu_time ? int_sqrt(cpu_time) : 1; + points /= run_time ? int_sqrt(int_sqrt(run_time)) : 1; /* * Niced processes are most likely less important, so double[unhandled content-type:application/pgp-signature] |  |