mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH] OOM: initialise points variable in out_of_memory()
       [not found] <11410761851547-git-send-email-carlos@cmartin.tk>
@ 2006-02-28 12:13 ` Kurt Garloff
  2006-02-28 15:05   ` Carlos Martín
  0 siblings, 1 reply; 2+ messages in thread
From: Kurt Garloff @ 2006-02-28 12:13 UTC (permalink / raw)
  To: Carlos Martin; +Cc: Linux kernel list, Rik van Riel, Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 963 bytes --]

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.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] OOM: initialise points variable in out_of_memory()
  2006-02-28 12:13 ` [PATCH] OOM: initialise points variable in out_of_memory() Kurt Garloff
@ 2006-02-28 15:05   ` Carlos Martín
  0 siblings, 0 replies; 2+ messages in thread
From: Carlos Martín @ 2006-02-28 15:05 UTC (permalink / raw)
  To: Kurt Garloff; +Cc: Linux kernel list, Rik van Riel, Andrew Morton

On Tuesday 28 February 2006 13:13, Kurt Garloff wrote:
> 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?

No. GCC complained about 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. 

It never used to be a problem because it was initialised when calling 
select_bad_process().

I though it was your change, but I've looked again and it was Christoph 
Lameter's commit 9b0f8b040acd8dfd23860754c0d09ff4f44e2cbc which introduced 
the problem.

   cmn
-- 
Carlos Martín Nieto    |   http://www.cmartin.tk
Hobbyist programmer    |

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-02-28 15:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <11410761851547-git-send-email-carlos@cmartin.tk>
2006-02-28 12:13 ` [PATCH] OOM: initialise points variable in out_of_memory() Kurt Garloff
2006-02-28 15:05   ` Carlos Martín

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®