mm/madvise: free hwpoison and swapin error entry in madvise_free_pte_range
authorMiaohe Lin <linmiaohe@huawei.com>
Thu, 19 May 2022 12:50:28 +0000 (20:50 +0800)
committerakpm <akpm@linux-foundation.org>
Fri, 27 May 2022 16:33:46 +0000 (09:33 -0700)
commit7b49514fa1dbe05813f099179ebe3d982f45e87e
treed93be081cc6f67587713bb9dc94c1e7b3833a3e5
parent14a762dd1977cf811516fd97b0262b747cac88f7
mm/madvise: free hwpoison and swapin error entry in madvise_free_pte_range

Once the MADV_FREE operation has succeeded, callers can expect they might
get zero-fill pages if accessing the memory again.  Therefore it should be
safe to delete the hwpoison entry and swapin error entry.  There is no
reason to kill the process if it has called MADV_FREE on the range.

Link: https://lkml.kernel.org/r/20220519125030.21486-4-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Suggested-by: Alistair Popple <apopple@nvidia.com>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: NeilBrown <neilb@suse.de>
Cc: Peter Xu <peterx@redhat.com>
Cc: Ralph Campbell <rcampbell@nvidia.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/madvise.c