Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1294218
| From | Linus Torvalds <torvalds@linux-foundation.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/2] mm, oom: introduce oom reaper |
| Date | 2015-12-17 21:00 +0100 |
| Message-ID | <qGMSw-3Qg-71@gated-at.bofh.it> (permalink) |
| References | <qG2FY-7U3-7@gated-at.bofh.it> <qGv5h-DM-27@gated-at.bofh.it> <qGGtH-8he-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, Dec 17, 2015 at 5:02 AM, Michal Hocko <mhocko@kernel.org> wrote:
> Ups. You are right. I will go with msleep_interruptible(100).
I don't think that's right.
If a signal happens, that loop is now (again) just busy-looping. That
doesn't sound right, although with the maximum limit of 10 attempts,
maybe it's fine - the thing is technically "busylooping", but it will
definitely not busy-loop for very long.
So maybe that code is fine, but I think the signal case might at least
merit a comment?
Also, if you actually do want UNINTERRUPTIBLE (no reaction to signals
at all), but don't want to be seen as being "load" on the system, you
can use TASK_IDLE, which is a combination of TASK_UNINTERRUPTIBLE |
TASK_NOLOAD.
Because if you sleep interruptibly, you do generally need to handle
signals (although that limit count may make it ok in this case).
There's basically three levels:
- TASK_UNINTERRUPTIBLE: no signal handling at all
- TASK_KILLABLE: no normal signal handling, but ok to be killed
(needs to check fatal_signal_pending() and exit)
- TASK_INTERRUPTIBLE: will react to signals
(and then that TASK_IDLE thing that is semantically the same as
uninterruptible, but doesn't count against the load average).
The main use for TASK_KILLABLE is in places where expected semantics
do not allow a EINTR return, but we know that because the process is
about to be killed, we can ignore that, for the simple reason that
nobody will ever *see* the EINTR.
Btw, I think you might want to re-run your test-case after this
change, since the whole "busy loop vs actually sleeping" might just
have changed the result..
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/2] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-12-15 19:40 +0100
Re: [PATCH 1/2] mm, oom: introduce oom reaper Andrew Morton <akpm@linux-foundation.org> - 2015-12-17 02:00 +0100
Re: [PATCH 1/2] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-12-17 14:10 +0100
Re: [PATCH 1/2] mm, oom: introduce oom reaper Linus Torvalds <torvalds@linux-foundation.org> - 2015-12-17 21:00 +0100
Re: [PATCH 1/2] mm, oom: introduce oom reaper Andrew Morton <akpm@linux-foundation.org> - 2015-12-17 21:10 +0100
Re: [PATCH 1/2] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-12-18 13:00 +0100
Re: [PATCH 1/2] mm, oom: introduce oom reaper Andrew Morton <akpm@linux-foundation.org> - 2015-12-18 22:20 +0100
Re: [PATCH 1/2] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-12-21 09:40 +0100
Re: [PATCH 1/2] mm, oom: introduce oom reaper Andrew Morton <akpm@linux-foundation.org> - 2015-12-17 22:20 +0100
Re: [PATCH 1/2] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-12-18 13:20 +0100
Re: [PATCH 1/2] mm, oom: introduce oom reaper Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-12-18 13:20 +0100
Re: [PATCH 1/2] mm, oom: introduce oom reaper Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-12-20 08:20 +0100
Re: [PATCH 1/2] mm, oom: introduce oom reaper Andrew Morton <akpm@linux-foundation.org> - 2015-12-18 01:20 +0100
Re: [PATCH 1/2] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-12-18 12:50 +0100
Re: [PATCH 1/2] mm, oom: introduce oom reaper Paul Gortmaker <paul.gortmaker@windriver.com> - 2015-12-21 21:40 +0100
Re: [PATCH 1/2] mm, oom: introduce oom reaper Ross Zwisler <zwisler@gmail.com> - 2015-12-24 00:10 +0100
Re: [PATCH 1/2] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-12-24 10:50 +0100
Re: [PATCH 1/2] mm, oom: introduce oom reaper Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-12-24 12:10 +0100
Re: [PATCH 1/2] mm, oom: introduce oom reaper Ross Zwisler <zwisler@gmail.com> - 2015-12-24 22:00 +0100
Re: [PATCH 1/2] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-12-25 12:50 +0100
Re: [PATCH 1/2] mm, oom: introduce oom reaper Ross Zwisler <zwisler@gmail.com> - 2015-12-24 21:50 +0100
Re: [PATCH 1/2] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-12-25 12:40 +0100
Re: [PATCH 1/2] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-12-25 12:50 +0100
csiph-web