Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1279098
| From | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC PATCH -v2] mm, oom: introduce oom reaper |
| Date | 2015-11-28 05:50 +0100 |
| Message-ID | <qzFCq-45O-1@gated-at.bofh.it> (permalink) |
| References | <qyKEb-8h2-3@gated-at.bofh.it> <qztUB-5dg-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Michal Hocko wrote:
> for write while write but the probability is reduced considerably wrt.
Is this "while write" garbage?
> Users of mmap_sem which need it for write should be carefully reviewed
> to use _killable waiting as much as possible and reduce allocations
> requests done with the lock held to absolute minimum to reduce the risk
> even further.
It will be nice if we can have down_write_killable()/down_read_killable().
> The API between oom killer and oom reaper is quite trivial. wake_oom_reaper
> updates mm_to_reap with cmpxchg to guarantee only NUll->mm transition
NULL->mm
> and oom_reaper clear this atomically once it is done with the work.
Can't oom_reaper() become as compact as below?
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 3f22efc..c2ab7f9 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -472,21 +472,10 @@ static void oom_reap_vmas(struct mm_struct *mm)
static int oom_reaper(void *unused)
{
- DEFINE_WAIT(wait);
-
while (true) {
- struct mm_struct *mm;
-
- prepare_to_wait(&oom_reaper_wait, &wait, TASK_UNINTERRUPTIBLE);
- mm = READ_ONCE(mm_to_reap);
- if (!mm) {
- freezable_schedule();
- finish_wait(&oom_reaper_wait, &wait);
- } else {
- finish_wait(&oom_reaper_wait, &wait);
- oom_reap_vmas(mm);
- WRITE_ONCE(mm_to_reap, NULL);
- }
+ wait_event_freezable(oom_reaper_wait, mm_to_reap);
+ oom_reap_vmas(mm_to_reap);
+ mm_to_reap = NULL;
}
return 0;
--
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
[RFC PATCH] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-11-25 17:00 +0100
Re: [RFC PATCH] mm, oom: introduce oom reaper Johannes Weiner <hannes@cmpxchg.org> - 2015-11-25 21:10 +0100
Re: [RFC PATCH] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-11-26 12:10 +0100
Re: [RFC PATCH] mm, oom: introduce oom reaper Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-11-26 16:30 +0100
Re: [RFC PATCH] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-11-26 17:40 +0100
Re: [RFC PATCH] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-11-26 18:40 +0100
Re: [RFC PATCH] mm, oom: introduce oom reaper Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-11-27 12:30 +0100
Re: [RFC PATCH] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-11-27 13:40 +0100
[RFC PATCH -v2] mm, oom: introduce oom reaper Michal Hocko <mhocko@kernel.org> - 2015-11-27 17:20 +0100
Re: [RFC PATCH -v2] mm, oom: introduce oom reaper Mel Gorman <mgorman@suse.de> - 2015-11-27 17:40 +0100
Re: [RFC PATCH -v2] mm, oom: introduce oom reaper Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-11-28 05:50 +0100
Re: [RFC PATCH -v2] mm, oom: introduce oom reaper Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-11-28 17:20 +0100
csiph-web