From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
To: mhocko@kernel.org
Cc: linux-mm@kvack.org, akpm@linux-foundation.org,
wenwei.tww@alibaba-inc.com, oleg@redhat.com, rientjes@google.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm, oom: fix potential data corruption when oom_reaper races with writer
Date: Fri, 4 Aug 2017 19:41:42 +0900 [thread overview]
Message-ID: <201708041941.JFH26516.HOMtSQFFFOLVJO@I-love.SAKURA.ne.jp> (raw)
In-Reply-To: <20170804091629.GI26029@dhcp22.suse.cz>
Michal Hocko wrote:
> On Fri 04-08-17 17:25:46, Tetsuo Handa wrote:
> > Well, while lockdep warning is gone, this problem is remaining.
> >
> > diff --git a/mm/memory.c b/mm/memory.c
> > index edabf6f..1e06c29 100644
> > --- a/mm/memory.c
> > +++ b/mm/memory.c
> > @@ -3931,15 +3931,14 @@ int handle_mm_fault(struct vm_area_struct *vma, unsigned long address,
> > /*
> > * This mm has been already reaped by the oom reaper and so the
> > * refault cannot be trusted in general. Anonymous refaults would
> > - * lose data and give a zero page instead e.g. This is especially
> > - * problem for use_mm() because regular tasks will just die and
> > - * the corrupted data will not be visible anywhere while kthread
> > - * will outlive the oom victim and potentially propagate the date
> > - * further.
> > + * lose data and give a zero page instead e.g.
> > */
> > - if (unlikely((current->flags & PF_KTHREAD) && !(ret & VM_FAULT_ERROR)
> > - && test_bit(MMF_UNSTABLE, &vma->vm_mm->flags)))
> > + if (unlikely(!(ret & VM_FAULT_ERROR)
> > + && test_bit(MMF_UNSTABLE, &vma->vm_mm->flags))) {
> > + if (ret & VM_FAULT_RETRY)
> > + down_read(&vma->vm_mm->mmap_sem);
> > ret = VM_FAULT_SIGBUS;
> > + }
> >
> > return ret;
> > }
>
> I have re-read your email again and I guess I misread previously. Are
> you saying that the data corruption happens with the both patches
> applied?
Yes. Data corruption still happens.
--
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>
next prev parent reply other threads:[~2017-08-04 10:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-03 13:59 Michal Hocko
2017-08-04 6:46 ` Tetsuo Handa
2017-08-04 7:42 ` Michal Hocko
2017-08-04 8:25 ` Tetsuo Handa
2017-08-04 8:32 ` 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
2017-08-04 9:16 ` Re: [PATCH] " Michal Hocko
2017-08-04 10:41 ` Tetsuo Handa [this message]
2017-08-04 11:00 ` Michal Hocko
2017-08-04 14:56 ` Michal Hocko
2017-08-04 16:49 ` Tetsuo Handa
2017-08-05 1:46 ` 陶文苇
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=201708041941.JFH26516.HOMtSQFFFOLVJO@I-love.SAKURA.ne.jp \
--to=penguin-kernel@i-love.sakura.ne.jp \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=oleg@redhat.com \
--cc=rientjes@google.com \
--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