Re: [PATCH] arch, mm: introduce arch_tlb_gather_mmu_exit
From: Michal Hocko
Date: Thu Dec 14 2017 - 09:05:30 EST
On Tue 05-12-17 20:14:37, Michal Hocko wrote:
> On Tue 05-12-17 10:31:12, Linus Torvalds wrote:
> > On Tue, Dec 5, 2017 at 6:58 AM, Michal Hocko <mhocko@xxxxxxxxxx> wrote:
> > >
> > > This all is nice but tlb_gather users are not aware of that and this can
> > > actually cause some real problems. E.g. the oom_reaper tries to reap the
> > > whole address space but it might race with threads accessing the memory [1].
> > > It is possible that soft-dirty handling might suffer from the same
> > > problem [2] as soon as it starts supporting the feature.
> >
> > So we fixed the oom reaper to just do proper TLB invalidates in commit
> > 687cb0884a71 ("mm, oom_reaper: gather each vma to prevent leaking TLB
> > entry").
> >
> > So now "fullmm" should be the expected "exit" case, and it all should
> > be unambiguous.
> >
> > Do we really have any reason to apply this patch any more?
>
> Well, the point was the clarity. The bad behavior came as a surprise for
> the oom reaper and as Minchan mentioned we would see a similar problem
> with soft-dirty bits as soon as they are supported on arm64 or
> potentially other architectures which might do special handling for exit
> case.
I am not going to push this patch if it is considered pointless but I
haven't heard back anything to the above argument.
--
Michal Hocko
SUSE Labs