[PATCH gmem FIXUP] mm, compaction: make testing mapping_unmovable() safe
kirill.shutemov at linux.intel.com
kirill.shutemov at linux.intel.com
Fri Sep 1 21:05:55 UTC 2023
On Fri, Sep 01, 2023 at 10:20:26AM +0200, Vlastimil Babka wrote:
> As Kirill pointed out, mapping can be removed under us due to
> truncation. Test it under folio lock as already done for the async
> compaction / dirty folio case. To prevent locking every folio with
> mapping to do the test, do it only for unevictable folios, as we can
> expect the unmovable mapping folios are also unevictable - it is the
> case for guest memfd folios.
>
> Also incorporate comment update suggested by Matthew.
>
> Fixes: 3424873596ce ("mm: Add AS_UNMOVABLE to mark mapping as completely unmovable")
> Signed-off-by: Vlastimil Babka <vbabka at suse.cz>
Superficially looks good to me. But I don't really understand this
code path to Ack.
--
Kiryl Shutsemau / Kirill A. Shutemov
More information about the Linux-security-module-archive
mailing list