[lkml]   [2017]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: + mm-madvise-fix-freeing-of-locked-page-with-madv_free.patch added to -mm tree
Michal Hocko <> wrote:

> Hmm, I do not see this neither in linux-mm nor LKML. Strange
> On Wed 23-08-17 14:41:21, Andrew Morton wrote:
>> From: Eric Biggers <>
>> Subject: mm/madvise.c: fix freeing of locked page with MADV_FREE
>> If madvise(..., MADV_FREE) split a transparent hugepage, it called
>> put_page() before unlock_page(). This was wrong because put_page() can
>> free the page, e.g. if a concurrent madvise(..., MADV_DONTNEED) has
>> removed it from the memory mapping. put_page() then rightfully complained
>> about freeing a locked page.
>> Fix this by moving the unlock_page() before put_page().

Quick grep shows that a similar flow (put_page() followed by an
unlock_page() ) also happens in hugetlbfs_fallocate(). Isn’t it a problem as

 \ /
  Last update: 2017-08-26 00:03    [W:0.038 / U:2.784 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site