[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120216150429.GB11953@redhat.com>
Date: Thu, 16 Feb 2012 16:04:29 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: apw@...onical.com, arjan@...ux.intel.com, fhrbata@...hat.com,
john.johansen@...onical.com, penguin-kernel@...ove.SAKURA.ne.jp,
rientjes@...gle.com, rusty@...tcorp.com.au, tj@...nel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 6/6] kmod: make __request_module() killable
On 02/15, Andrew Morton wrote:
>
> On Tue, 14 Feb 2012 17:49:14 +0100
> Oleg Nesterov <oleg@...hat.com> wrote:
>
> > As Tetsuo Handa pointed out, request_module() can stress the
> > system while the oom-killed caller sleeps in TASK_UNINTERRUPTIBLE.
>
> Whine.
>
> Solving this problem is the entire point of the entire patchset and you
> told us almost nothing about it. Please, provide a complete
> description of the problem which is being solved, so we can understand
> the value of the patchset?
I did ;) from the message I sent to security list:
Tetsuo has the test-cases, but the problem (well, one of the problems) is
simple.
The task T uses "almost all" memory, then it does something which triggers
request_module(). Say, it can simply call sys_socket(). This in turn needs
more memory and leads to OOM. oom-killer correctly chooses T and kills it,
but this can't help because it sleeps in TASK_UNINTERRUPTIBLE and after
that oom-killer becomes "disabled" by the TIF_MEMDIE task T.
Credits to Tetsuo.
But in fact I think this change is "obviously good" anyway. Assuming
it is correct of course. request_module() is heavy, it can take the
unpredictable amount of time/resources to finish. It is not good we
can't interrupt the task which waits for completion.
Yes, this adds some complications and initially I wasn't agree with
Tetsuo, I thought this doesn't worth the trouble. But I hope that
this code is simple/clean enough.
Btw, there is another example of "unbounded" sleep in UNINTERRUPTIBLE,
vfork. I already have the patches, will send today.
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists