linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Andrea Arcangeli <aarcange@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	"Kirill A. Shutemov" <kirill@shutemov.name>,
	Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
	Oleg Nesterov <oleg@redhat.com>,
	Wenwei Tao <wenwei.tww@alibaba-inc.com>,
	linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] mm, oom: fix potential data corruption when oom_reaper races with writer
Date: Thu, 10 Aug 2017 15:33:38 +0200	[thread overview]
Message-ID: <20170810133338.GV23863@dhcp22.suse.cz> (raw)
In-Reply-To: <20170810082118.GH23863@dhcp22.suse.cz>

On Thu 10-08-17 10:21:18, Michal Hocko wrote:
> On Tue 08-08-17 19:48:55, Andrea Arcangeli wrote:
> [...]
> > The bug corrected by this patch 1/2 I pointed it out last week while
> > reviewing other oom reaper fixes so that looks fine.
> > 
> > However I'd prefer to dump MMF_UNSTABLE for good instead of adding
> > more of it. It can be replaced with unmap_page_range in
> > __oom_reap_task_mm with a function that arms a special migration entry
> > so that no branchs are added to the fast paths and it's all hidden
> > inside is_migration_entry slow paths.
> 
> This sounds like an interesting idea but I would like to address the
> _correctness_ issue first and optimize on top of it. If for nothing else
> backporting a follow up fix sounds easier than a complete rework. There
> are quite some callers of is_migration_entry and the patch won't be
> trivial either. So can we focus on the fix first please?

Btw, if the overhead is a concern then we can add a jump label and only
make the code active only while the OOM is in progress. We already do
count all oom victims so we have a clear entry and exit points. This
would still sound easier to do than teach every is_migration_entry a new
migration entry type and handle it properly, not to mention make
everybody aware of this for future callers of is_migration_entry.
-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2017-08-10 13:33 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-07 11:38 [PATCH 0/2] mm, oom: fix oom_reaper fallouts Michal Hocko
2017-08-07 11:38 ` [PATCH 1/2] mm: fix double mmap_sem unlock on MMF_UNSTABLE enforced SIGBUS Michal Hocko
2017-08-15  0:49   ` David Rientjes
2017-08-07 11:38 ` [PATCH 2/2] mm, oom: fix potential data corruption when oom_reaper races with writer Michal Hocko
2017-08-08 17:48   ` Andrea Arcangeli
2017-08-08 23:35     ` Tetsuo Handa
2017-08-09 18:36       ` Andrea Arcangeli
2017-08-10  8:21     ` Michal Hocko
2017-08-10 13:33       ` Michal Hocko [this message]
2017-08-11  2:28   ` Tetsuo Handa
2017-08-11  7:09     ` Michal Hocko
2017-08-11  7:54       ` Tetsuo Handa
2017-08-11 10:22         ` Andrea Arcangeli
2017-08-11 10:42           ` Andrea Arcangeli
2017-08-11 11:53             ` Tetsuo Handa
2017-08-11 12:08         ` Michal Hocko
2017-08-11 15:46           ` Tetsuo Handa
2017-08-14 13:59             ` Michal Hocko
     [not found]               ` <201708142251.v7EMp3j9081456@www262.sakura.ne.jp>
2017-08-15  6:55                 ` Michal Hocko
2017-08-15  8:41                 ` Michal Hocko
     [not found]                   ` <201708151006.v7FA6SxD079619@www262.sakura.ne.jp>
2017-08-15 12:26                     ` Michal Hocko
     [not found]                       ` <201708151258.v7FCwTsV029946@www262.sakura.ne.jp>
2017-08-17 13:58                         ` Michal Hocko
2017-08-07 13:28 ` [PATCH 0/2] mm, oom: fix oom_reaper fallouts Tetsuo Handa
2017-08-07 14:04   ` Michal Hocko
2017-08-07 15:23     ` Tetsuo Handa
2017-08-15 12:29 ` Michal Hocko
  -- strict thread matches above, loose matches on Subject: below --
2017-08-04  8:32 Re: [PATCH] mm, oom: fix potential data corruption when oom_reaper races with writer Michal Hocko
2017-08-04  8:33 ` [PATCH 1/2] mm: fix double mmap_sem unlock on MMF_UNSTABLE enforced SIGBUS Michal Hocko
2017-08-04  8:33   ` [PATCH 2/2] mm, oom: fix potential data corruption when oom_reaper races with writer Michal Hocko

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=20170810133338.GV23863@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=oleg@redhat.com \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=wenwei.tww@alibaba-inc.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).