All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] thp: fix few MADV_DONTNEED races
@ 2017-03-02 15:10 ` Kirill A. Shutemov
  0 siblings, 0 replies; 39+ messages in thread
From: Kirill A. Shutemov @ 2017-03-02 15:10 UTC (permalink / raw)
  To: Andrea Arcangeli, Andrew Morton
  Cc: linux-mm, linux-kernel, Kirill A. Shutemov

For MADV_DONTNEED to work properly with huge pages, it's critical to not clear
pmd intermittently unless you hold down_write(mmap_sem). Otherwise
MADV_DONTNEED can miss the THP which can lead to userspace breakage.

See example of such race in commit message of patch 2/4.

All these races are found by code inspection. I haven't seen them triggered. 
I don't think it's worth to apply them to stable@.

Kirill A. Shutemov (4):
  thp: reduce indentation level in change_huge_pmd()
  thp: fix MADV_DONTNEED vs. numa balancing race
  thp: fix MADV_DONTNEED vs. MADV_FREE race
  thp: fix MADV_DONTNEED vs clear soft dirty race

 fs/proc/task_mmu.c |  9 +++++-
 mm/huge_memory.c   | 86 ++++++++++++++++++++++++++++++++++++------------------
 2 files changed, 66 insertions(+), 29 deletions(-)

-- 
2.11.0

^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2017-06-09  8:21 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-02 15:10 [PATCH 0/4] thp: fix few MADV_DONTNEED races Kirill A. Shutemov
2017-03-02 15:10 ` Kirill A. Shutemov
2017-03-02 15:10 ` [PATCH 1/4] thp: reduce indentation level in change_huge_pmd() Kirill A. Shutemov
2017-03-02 15:10   ` Kirill A. Shutemov
2017-04-12 11:37   ` Vlastimil Babka
2017-04-12 11:37     ` Vlastimil Babka
2017-03-02 15:10 ` [PATCH 2/4] thp: fix MADV_DONTNEED vs. numa balancing race Kirill A. Shutemov
2017-03-02 15:10   ` Kirill A. Shutemov
2017-03-03 17:17   ` Dave Hansen
2017-03-03 17:17     ` Dave Hansen
2017-04-12 13:33   ` Vlastimil Babka
2017-04-12 13:33     ` Vlastimil Babka
2017-05-16 14:54     ` Vlastimil Babka
2017-05-16 14:54       ` Vlastimil Babka
2017-05-16 20:29     ` Andrea Arcangeli
2017-05-16 20:29       ` Andrea Arcangeli
2017-05-23 12:42       ` Vlastimil Babka
2017-05-23 12:42         ` Vlastimil Babka
2017-06-09  8:21         ` Vlastimil Babka
2017-06-09  8:21           ` Vlastimil Babka
2017-03-02 15:10 ` [PATCH 3/4] thp: fix MADV_DONTNEED vs. MADV_FREE race Kirill A. Shutemov
2017-03-02 15:10   ` Kirill A. Shutemov
2017-03-03  5:35   ` Hillf Danton
2017-03-03  5:35     ` Hillf Danton
2017-03-03 10:26     ` Kirill A. Shutemov
2017-03-03 10:26       ` Kirill A. Shutemov
2017-03-06  1:44       ` Minchan Kim
2017-03-06  1:44         ` Minchan Kim
2017-03-07 14:04         ` Kirill A. Shutemov
2017-03-07 14:04           ` Kirill A. Shutemov
2017-03-08  6:17           ` Minchan Kim
2017-03-06  2:49   ` Aneesh Kumar K.V
2017-03-06  2:49     ` Aneesh Kumar K.V
2017-03-07 13:52     ` Kirill A. Shutemov
2017-03-07 13:52       ` Kirill A. Shutemov
2017-03-02 15:10 ` [PATCH 4/4] thp: fix MADV_DONTNEED vs clear soft dirty race Kirill A. Shutemov
2017-03-02 15:10   ` Kirill A. Shutemov
2017-03-03 22:29   ` Andrew Morton
2017-03-03 22:29     ` Andrew Morton

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.