mirror of
https://github.com/torvalds/linux.git
synced 2025-12-01 07:26:02 +07:00
mm/rmap: inline folio_test_large_maybe_mapped_shared() into callers
To prevent the function from being used when CONFIG_MM_ID is disabled, we intend to inline it into its few callers, which also would help maintain the expected code placement. Link: https://lkml.kernel.org/r/20250424155606.57488-1-lance.yang@linux.dev Signed-off-by: Lance Yang <lance.yang@linux.dev> Suggested-by: David Hildenbrand <david@redhat.com> Acked-by: David Hildenbrand <david@redhat.com> Cc: Mingzhe Yang <mingzhe.yang@ly.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
committed by
Andrew Morton
parent
ee43f26b49
commit
4428a35f91
@@ -3768,7 +3768,7 @@ static bool __wp_can_reuse_large_anon_folio(struct folio *folio,
|
||||
* If all folio references are from mappings, and all mappings are in
|
||||
* the page tables of this MM, then this folio is exclusive to this MM.
|
||||
*/
|
||||
if (folio_test_large_maybe_mapped_shared(folio))
|
||||
if (test_bit(FOLIO_MM_IDS_SHARED_BITNUM, &folio->_mm_ids))
|
||||
return false;
|
||||
|
||||
VM_WARN_ON_ONCE(folio_test_ksm(folio));
|
||||
@@ -3791,7 +3791,7 @@ static bool __wp_can_reuse_large_anon_folio(struct folio *folio,
|
||||
folio_lock_large_mapcount(folio);
|
||||
VM_WARN_ON_ONCE_FOLIO(folio_large_mapcount(folio) > folio_ref_count(folio), folio);
|
||||
|
||||
if (folio_test_large_maybe_mapped_shared(folio))
|
||||
if (test_bit(FOLIO_MM_IDS_SHARED_BITNUM, &folio->_mm_ids))
|
||||
goto unlock;
|
||||
if (folio_large_mapcount(folio) != folio_ref_count(folio))
|
||||
goto unlock;
|
||||
|
||||
Reference in New Issue
Block a user