lkml.org 
[lkml]   [2017]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] mm, oom: fix potential data corruption when oom_reaper races with writer
From
Date
Michal Hocko wrote:
> And that's why we still see the corruption. That, however, means that
> the MMF_UNSTABLE implementation has to be more complex and we have to
> hook into all anonymous memory fault paths which I hoped I could avoid
> previously.

I don't understand mm internals including pte/ptl etc. , but I guess that
the direction is correct. Since the OOM reaper basically does

Set MMF_UNSTABLE flag on mm_struct.
For each reapable page in mm_struct {
Take ptl lock.
Remove pte.
Release ptl lock.
}

the page fault handler will need to check MMF_UNSTABLE with lock held.

For each faulted page in mm_struct {
Take ptl lock.
Add pte only if MMF_UNSTABLE flag is not set.
Release ptl lock.
}

\
 
 \ /
  Last update: 2017-08-04 18:50    [W:0.082 / U:0.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site