Thread (5 messages) 5 messages, 3 authors, 2021-03-25

Re: [PATCH] userfaultfd/shmem: fix minor fault page leak

From: Peter Xu <peterx@redhat.com>
Date: 2021-03-22 21:02:05
Also in: linux-fsdevel, linux-kselftest, lkml

On Mon, Mar 22, 2021 at 01:48:35PM -0700, Axel Rasmussen wrote:
This fix is analogous to Peter Xu's fix for hugetlb [0]. If we don't
put_page() after getting the page out of the page cache, we leak the
reference.

The fix can be verified by checking /proc/meminfo and running the
userfaultfd selftest in shmem mode. Without the fix, we see MemFree /
MemAvailable steadily decreasing with each run of the test. With the
fix, memory is correctly freed after the test program exits.

Fixes: 00da60b9d0a0 ("userfaultfd: support minor fault handling for shmem")
Signed-off-by: Axel Rasmussen <axelrasmussen@google.com>
Reviewed-by: Peter Xu <peterx@redhat.com>

-- 
Peter Xu

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help