From: Johannes Weiner <hannes@cmpxchg.org>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: linux-mm@kvack.org, mhocko@kernel.org, rientjes@google.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] oom_reaper: close race without using oom_lock
Date: Tue, 18 Jul 2017 10:17:54 -0400 [thread overview]
Message-ID: <20170718141754.GA6573@cmpxchg.org> (raw)
In-Reply-To: <1500386810-4881-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp>
On Tue, Jul 18, 2017 at 11:06:50PM +0900, Tetsuo Handa wrote:
> Commit e2fe14564d3316d1 ("oom_reaper: close race with exiting task")
> guarded whole OOM reaping operations using oom_lock. But there was no
> need to guard whole operations. We needed to guard only setting of
> MMF_OOM_REAPED flag because get_page_from_freelist() in
> __alloc_pages_may_oom() is called with oom_lock held.
>
> If we change to guard only setting of MMF_OOM_SKIP flag, the OOM reaper
> can start reaping operations as soon as wake_oom_reaper() is called.
> But since setting of MMF_OOM_SKIP flag at __mmput() is not guarded with
> oom_lock, guarding only the OOM reaper side is not sufficient.
>
> If we change the OOM killer side to ignore MMF_OOM_SKIP flag once,
> there is no need to guard setting of MMF_OOM_SKIP flag, and we can
> guarantee a chance to call get_page_from_freelist() in
> __alloc_pages_may_oom() without depending on oom_lock serialization.
>
> This patch makes MMF_OOM_SKIP act as if MMF_OOM_REAPED, and adds a new
> flag which acts as if MMF_OOM_SKIP, in order to close both race window
> (the OOM reaper side and __mmput() side) without using oom_lock.
I have no idea what this is about - a race window fix? A performance
optimization? A code simplification?
Users and vendors are later going to read through these changelogs and
have to decide whether they want this patch or upgrade to a kernel
containing it. Please keep these people in mind when writing the
subject and first paragraph of the changelogs.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Johannes Weiner <hannes@cmpxchg.org>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: linux-mm@kvack.org, mhocko@kernel.org, rientjes@google.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] oom_reaper: close race without using oom_lock
Date: Tue, 18 Jul 2017 10:17:54 -0400 [thread overview]
Message-ID: <20170718141754.GA6573@cmpxchg.org> (raw)
In-Reply-To: <1500386810-4881-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp>
On Tue, Jul 18, 2017 at 11:06:50PM +0900, Tetsuo Handa wrote:
> Commit e2fe14564d3316d1 ("oom_reaper: close race with exiting task")
> guarded whole OOM reaping operations using oom_lock. But there was no
> need to guard whole operations. We needed to guard only setting of
> MMF_OOM_REAPED flag because get_page_from_freelist() in
> __alloc_pages_may_oom() is called with oom_lock held.
>
> If we change to guard only setting of MMF_OOM_SKIP flag, the OOM reaper
> can start reaping operations as soon as wake_oom_reaper() is called.
> But since setting of MMF_OOM_SKIP flag at __mmput() is not guarded with
> oom_lock, guarding only the OOM reaper side is not sufficient.
>
> If we change the OOM killer side to ignore MMF_OOM_SKIP flag once,
> there is no need to guard setting of MMF_OOM_SKIP flag, and we can
> guarantee a chance to call get_page_from_freelist() in
> __alloc_pages_may_oom() without depending on oom_lock serialization.
>
> This patch makes MMF_OOM_SKIP act as if MMF_OOM_REAPED, and adds a new
> flag which acts as if MMF_OOM_SKIP, in order to close both race window
> (the OOM reaper side and __mmput() side) without using oom_lock.
I have no idea what this is about - a race window fix? A performance
optimization? A code simplification?
Users and vendors are later going to read through these changelogs and
have to decide whether they want this patch or upgrade to a kernel
containing it. Please keep these people in mind when writing the
subject and first paragraph of the changelogs.
next prev parent reply other threads:[~2017-07-18 14:17 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-18 14:06 [PATCH] oom_reaper: close race without using oom_lock Tetsuo Handa
2017-07-18 14:06 ` Tetsuo Handa
2017-07-18 14:16 ` Michal Hocko
2017-07-18 14:16 ` Michal Hocko
2017-07-18 20:51 ` Tetsuo Handa
2017-07-18 20:51 ` Tetsuo Handa
2017-07-20 14:11 ` Michal Hocko
2017-07-20 14:11 ` Michal Hocko
2017-07-20 21:47 ` Tetsuo Handa
2017-07-20 21:47 ` Tetsuo Handa
2017-07-21 15:00 ` Michal Hocko
2017-07-21 15:00 ` Michal Hocko
2017-07-21 15:18 ` Tetsuo Handa
2017-07-21 15:18 ` Tetsuo Handa
2017-07-21 15:33 ` Michal Hocko
2017-07-21 15:33 ` Michal Hocko
2017-07-23 0:41 ` Tetsuo Handa
2017-07-23 0:41 ` Tetsuo Handa
2017-07-23 3:03 ` Tetsuo Handa
2017-07-23 3:03 ` Tetsuo Handa
2017-07-24 6:38 ` Michal Hocko
2017-07-24 6:38 ` Michal Hocko
2017-07-26 11:33 ` Tetsuo Handa
2017-07-26 11:33 ` Tetsuo Handa
2017-07-26 11:46 ` Michal Hocko
2017-07-26 11:46 ` Michal Hocko
2017-08-05 1:02 ` Tetsuo Handa
2017-08-05 1:02 ` Tetsuo Handa
2017-08-07 6:02 ` Michal Hocko
2017-08-07 6:02 ` Michal Hocko
2017-08-08 2:14 ` penguin-kernel
2017-08-10 11:34 ` Michal Hocko
2017-08-10 11:34 ` Michal Hocko
2017-08-10 12:10 ` Tetsuo Handa
2017-08-10 12:10 ` Tetsuo Handa
2017-08-10 12:36 ` Michal Hocko
2017-08-10 12:36 ` Michal Hocko
2017-08-10 14:28 ` Tetsuo Handa
2017-08-10 14:28 ` Tetsuo Handa
2017-07-18 14:17 ` Johannes Weiner [this message]
2017-07-18 14:17 ` Johannes Weiner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170718141754.GA6573@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=rientjes@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.