lkml.org 
[lkml]   [2006]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] OOM: initialise points variable in out_of_memory()
Hi Carlos,

On Mon, Feb 27, 2006 at 10:36:25PM +0100, Carlos Martin wrote:
> We didn't initialise points, so the value reported was completely
> random. This doesn't affect the behaviour of the funcion.

Did you observe it?

In the original patch, there is
+static struct task_struct * select_bad_process(unsigned long *ppoints)
{
- unsigned long maxpoints = 0;
struct task_struct *g, *p;
struct task_struct *chosen = NULL;
struct timespec uptime;
+ *ppoints = 0;

And this is called from out_of_memory().

But the constrained_alloc stuff seems to use points before
select_bad_process() is called, so initializing to 0 is a
good idea. I don't remember having see the constrained_alloc
stuff, though, so I either did not look carefully enough or a
merge error happened afterwards.

Thanks for noticing and thanks for sending the fix!

Best,
--
Kurt Garloff, Head Architect Linux, Novell Inc.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2006-02-28 15:20    [W:0.027 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site