The quilt patch titled Subject: mm/page_ext: move functions around for minor cleanups to page_ext has been removed from the -mm tree. Its filename was mm-page_ext-move-functions-around-for-minor-cleanups-to-page_ext.patch This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm ------------------------------------------------------ From: Kemeng Shi <shikemeng@xxxxxxxxxxxxxxx> Subject: mm/page_ext: move functions around for minor cleanups to page_ext Date: Fri, 14 Jul 2023 19:47:49 +0800 1. move page_ext_get and page_ext_put down to remove forward declaration of lookup_page_ext. 2. move page_ext_init_flatmem_late down to existing non SPARS block to remove a new non SPARS block and to keep code for non SPARS tight. Link: https://lkml.kernel.org/r/20230714114749.1743032-4-shikemeng@xxxxxxxxxxxxxxx Signed-off-by: Kemeng Shi <shikemeng@xxxxxxxxxxxxxxx> Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/page_ext.c | 96 +++++++++++++++++++++++------------------------- 1 file changed, 46 insertions(+), 50 deletions(-) --- a/mm/page_ext.c~mm-page_ext-move-functions-around-for-minor-cleanups-to-page_ext +++ a/mm/page_ext.c @@ -90,7 +90,6 @@ static struct page_ext_operations *page_ unsigned long page_ext_size; static unsigned long total_usage; -static struct page_ext *lookup_page_ext(const struct page *page); bool early_page_ext __meminitdata; static int __init setup_early_page_ext(char *str) @@ -137,62 +136,16 @@ static void __init invoke_init_callbacks } } -#ifndef CONFIG_SPARSEMEM -void __init page_ext_init_flatmem_late(void) -{ - invoke_init_callbacks(); -} -#endif - static inline struct page_ext *get_entry(void *base, unsigned long index) { return base + page_ext_size * index; } -/** - * page_ext_get() - Get the extended information for a page. - * @page: The page we're interested in. - * - * Ensures that the page_ext will remain valid until page_ext_put() - * is called. - * - * Return: NULL if no page_ext exists for this page. - * Context: Any context. Caller may not sleep until they have called - * page_ext_put(). - */ -struct page_ext *page_ext_get(struct page *page) -{ - struct page_ext *page_ext; - - rcu_read_lock(); - page_ext = lookup_page_ext(page); - if (!page_ext) { - rcu_read_unlock(); - return NULL; - } - - return page_ext; -} - -/** - * page_ext_put() - Working with page extended information is done. - * @page_ext: Page extended information received from page_ext_get(). - * - * The page extended information of the page may not be valid after this - * function is called. - * - * Return: None. - * Context: Any context with corresponding page_ext_get() is called. - */ -void page_ext_put(struct page_ext *page_ext) +#ifndef CONFIG_SPARSEMEM +void __init page_ext_init_flatmem_late(void) { - if (unlikely(!page_ext)) - return; - - rcu_read_unlock(); + invoke_init_callbacks(); } -#ifndef CONFIG_SPARSEMEM - void __meminit pgdat_page_ext_init(struct pglist_data *pgdat) { @@ -536,3 +489,46 @@ void __meminit pgdat_page_ext_init(struc } #endif + +/** + * page_ext_get() - Get the extended information for a page. + * @page: The page we're interested in. + * + * Ensures that the page_ext will remain valid until page_ext_put() + * is called. + * + * Return: NULL if no page_ext exists for this page. + * Context: Any context. Caller may not sleep until they have called + * page_ext_put(). + */ +struct page_ext *page_ext_get(struct page *page) +{ + struct page_ext *page_ext; + + rcu_read_lock(); + page_ext = lookup_page_ext(page); + if (!page_ext) { + rcu_read_unlock(); + return NULL; + } + + return page_ext; +} + +/** + * page_ext_put() - Working with page extended information is done. + * @page_ext: Page extended information received from page_ext_get(). + * + * The page extended information of the page may not be valid after this + * function is called. + * + * Return: None. + * Context: Any context with corresponding page_ext_get() is called. + */ +void page_ext_put(struct page_ext *page_ext) +{ + if (unlikely(!page_ext)) + return; + + rcu_read_unlock(); +} _ Patches currently in -mm which might be from shikemeng@xxxxxxxxxxxxxxx are mm-page_ext-add-common-function-to-get-client-data-from-page_ext.patch mm-page_ext-use-page_ext_data-helper-in-page_table_check.patch mm-page_ext-use-page_ext_data-helper-in-page_owner.patch mm-page_poison-remove-unused-page_exth-from-page_poison.patch mm-vmstat-remove-unused-page_exth-from-vmstat.patch mm-page_ext-move-page_ext_operations-definition-under-config_page_extension.patch mm-compaction-set-compact_cached_free_pfn-correctly-in-update_pageblock_skip.patch mm-compaction-remove-unnecessary-cursor-page-in-isolate_freepages_block.patch mm-compaction-remove-unnecessary-else-continue-at-end-of-loop-in-isolate_freepages_block.patch mm-compaction-correct-last_migrated_pfn-update-in-compact_zone.patch mm-compaction-skip-page-block-marked-skip-in-isolate_migratepages_block.patch mm-compaction-correct-comment-of-fast_find_migrateblock-in-isolate_migratepages.patch mm-compaction-correct-comment-of-cached-migrate-pfn-update.patch mm-compaction-correct-comment-to-complete-migration-failure.patch mm-compaction-remove-unnecessary-return-for-void-function.patch mm-compaction-only-set-skip-flag-if-cc-no_set_skip_hint-is-false.patch mm-page_alloc-remove-track-of-active-pcp-lists-range-in-bulk-free.patch mm-page_alloc-remove-unnecessary-parameter-batch-of-nr_pcp_free.patch mm-compaction-remove-unused-parameter-pgdata-of-fragmentation_score_wmark.patch mm-page_alloc-remove-unnecessary-inner-__get_pfnblock_flags_mask.patch mm-page_alloc-use-get_pfnblock_migratetype-to-avoid-extra-page_to_pfn.patch