[ Sasha's backport helper bot ]
Hi,
Summary of potential issues: ⚠️ Found matching upstream commit but patch is missing proper reference to it
Found matching upstream commit: fefc075182275057ce607effaa3daa9e6e3bdc73
Note: The patch differs from the upstream commit: --- 1: fefc075182275 ! 1: 66476a80746d9 mm/page_alloc: fix race condition in unaccepted memory handling @@ Commit message Cc: Johannes Weiner hannes@cmpxchg.org Cc: stable@vger.kernel.org [6.5+] Signed-off-by: Andrew Morton akpm@linux-foundation.org - - ## mm/internal.h ## -@@ mm/internal.h: unsigned long move_page_tables(struct pagetable_move_control *pmc); - - #ifdef CONFIG_UNACCEPTED_MEMORY - void accept_page(struct page *page); --void unaccepted_cleanup_work(struct work_struct *work); - #else /* CONFIG_UNACCEPTED_MEMORY */ - static inline void accept_page(struct page *page) - { - - ## mm/mm_init.c ## -@@ mm/mm_init.c: static void __meminit zone_init_free_lists(struct zone *zone) - - #ifdef CONFIG_UNACCEPTED_MEMORY - INIT_LIST_HEAD(&zone->unaccepted_pages); -- INIT_WORK(&zone->unaccepted_cleanup, unaccepted_cleanup_work); - #endif - } - + (cherry picked from commit fefc075182275057ce607effaa3daa9e6e3bdc73) + Signed-off-by: Kirill A. Shutemov kirill.shutemov@linux.intel.com
## mm/page_alloc.c ## @@ mm/page_alloc.c: bool has_managed_dma(void) @@ mm/page_alloc.c: bool has_managed_dma(void) - static bool lazy_accept = true;
--void unaccepted_cleanup_work(struct work_struct *work) --{ -- static_branch_dec(&zones_with_unaccepted_pages); --} -- static int __init accept_memory_parse(char *p) - { - if (!strcmp(p, "lazy")) { @@ mm/page_alloc.c: static bool page_contains_unaccepted(struct page *page, unsigned int order) static void __accept_page(struct zone *zone, unsigned long *flags, struct page *page) @@ mm/page_alloc.c: static void __accept_page(struct zone *zone, unsigned long *fla
__free_pages_ok(page, MAX_PAGE_ORDER, FPI_TO_TAIL); - -- if (last) { -- /* -- * There are two corner cases: -- * -- * - If allocation occurs during the CPU bring up, -- * static_branch_dec() cannot be used directly as -- * it causes a deadlock on cpu_hotplug_lock. -- * -- * Instead, use schedule_work() to prevent deadlock. -- * -- * - If allocation occurs before workqueues are initialized, -- * static_branch_dec() should be called directly. -- * -- * Workqueues are initialized before CPU bring up, so this -- * will not conflict with the first scenario. -- */ -- if (system_wq) -- schedule_work(&zone->unaccepted_cleanup); -- else -- unaccepted_cleanup_work(&zone->unaccepted_cleanup); -- } +- if (last) +- static_branch_dec(&zones_with_unaccepted_pages); }
void accept_page(struct page *page) @@ mm/page_alloc.c: static bool try_to_accept_memory_one(struct zone *zone) - return static_branch_unlikely(&zones_with_unaccepted_pages); -} - - static bool cond_accept_memory(struct zone *zone, unsigned int order, - int alloc_flags) + static bool cond_accept_memory(struct zone *zone, unsigned int order) { long to_accept, wmark; bool ret = false; ---
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.14.y | Success | Success |