diff options
author | Vishal Moola (Oracle) <vishal.moola@gmail.com> | 2023-06-14 05:13:09 +0300 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-06-20 02:19:34 +0300 |
commit | 28fb54f6a2fd6cc471165cce1650a57dfbf49746 (patch) | |
tree | 284fdd42b07827f7d3c42879fcfe37134aa7da8e /include/linux/mmzone.h | |
parent | 708ff4914dfb410761227a219c17c3e9dbd68c05 (diff) | |
download | linux-28fb54f6a2fd6cc471165cce1650a57dfbf49746.tar.xz |
mmzone: introduce folio_migratetype()
Introduce folio_migratetype() as a folio equivalent for
get_pageblock_migratetype(). This function intends to return the
migratetype the folio is located in, hence the name choice.
Link: https://lkml.kernel.org/r/20230614021312.34085-3-vishal.moola@gmail.com
Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux/mmzone.h')
-rw-r--r-- | include/linux/mmzone.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index f10902491ead..3e822335f214 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -105,6 +105,9 @@ extern int page_group_by_mobility_disabled; #define get_pageblock_migratetype(page) \ get_pfnblock_flags_mask(page, page_to_pfn(page), MIGRATETYPE_MASK) +#define folio_migratetype(folio) \ + get_pfnblock_flags_mask(&folio->page, folio_pfn(folio), \ + MIGRATETYPE_MASK) struct free_area { struct list_head free_list[MIGRATE_TYPES]; unsigned long nr_free; |