mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-03 20:34:23 -04:00
mm/rmap: sanity check that zeropages are not passed to RMAP
Using insert_page() we might have previously ended up passing the zeropage into rmap code. Make sure that won't happen again. Note that we won't check the huge zeropage for now, which might still end up in RMAP code. Link: https://lkml.kernel.org/r/20240522125713.775114-4-david@redhat.com Signed-off-by: David Hildenbrand <david@redhat.com> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Vincent Donnefort <vdonnefort@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
committed by
Andrew Morton
parent
fce831c920
commit
6ad28e7e52
@@ -200,6 +200,9 @@ static inline void __folio_rmap_sanity_checks(struct folio *folio,
|
||||
/* hugetlb folios are handled separately. */
|
||||
VM_WARN_ON_FOLIO(folio_test_hugetlb(folio), folio);
|
||||
|
||||
/* When (un)mapping zeropages, we should never touch ref+mapcount. */
|
||||
VM_WARN_ON_FOLIO(is_zero_folio(folio), folio);
|
||||
|
||||
/*
|
||||
* TODO: we get driver-allocated folios that have nothing to do with
|
||||
* the rmap using vm_insert_page(); therefore, we cannot assume that
|
||||
|
||||
Reference in New Issue
Block a user