2002-01-14 05:37:38

by Andres Salomon

[permalink] [raw]
Subject: [PATCH] oom_kill() race?

In oom_kill(), is there any chance the task_struct can be unmapped
between being returned from select_bad_process() (where the tasklist
is locked) and where it walks the tasklist again, looking for threads?

If so, the following patch (against 2.4.17) will clean that up; if not,
ignore this.


--
"I think a lot of the basis of the open source movement comes from
procrastinating students..."
-- Andrew Tridgell <http://www.linux-mag.com/2001-07/tridgell_04.html>


Attachments:
(No filename) (469.00 B)
oom_fix.diff (1.28 kB)
Download all attachments

2002-01-14 06:34:49

by Rik van Riel

[permalink] [raw]
Subject: Re: [PATCH] oom_kill() race?

On Mon, 14 Jan 2002, Andres Salomon wrote:

> In oom_kill(), is there any chance the task_struct can be unmapped
> between being returned from select_bad_process() (where the tasklist
> is locked) and where it walks the tasklist again, looking for threads?

Indeed you're right. Thanks for the patch!

regards,

Rik
--
"Linux holds advantages over the single-vendor commercial OS"
-- Microsoft's "Competing with Linux" document

http://www.surriel.com/ http://distro.conectiva.com/

2002-01-14 14:29:35

by Gianni Tedesco

[permalink] [raw]
Subject: Re: [PATCH] oom_kill() race?

On Mon, 2002-01-14 at 06:34, Rik van Riel wrote:
> Rik
> --
> "Linux holds advantages over the single-vendor commercial OS"
> -- Microsoft's "Competing with Linux" document
>
> http://www.surriel.com/ http://distro.conectiva.com/

Heh,

Ive got a copy of that document here because my company is a MS partner.
Ironically enough it manages to hang MS word, abiword to the rescue.

I love the whole "Windows is good for the user because it increases your
profit margin" angle.

Fun reading.

--
// Gianni Tedesco <[email protected]>
80% of all email is a figment of procmails imagination.