The patch titled Subject: mm: page_alloc: use migrate_disable() in drain_local_pages_wq() has been added to the -mm tree. Its filename is mm-page_alloc-use-migrate_disable-in-drain_local_pages_wq.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/mm-page_alloc-use-migrate_disable-in-drain_local_pages_wq.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/mm-page_alloc-use-migrate_disable-in-drain_local_pages_wq.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> Subject: mm: page_alloc: use migrate_disable() in drain_local_pages_wq() drain_local_pages_wq() disables preemption to avoid CPU migration during CPU hotplug and can't use cpus_read_lock(). Using migrate_disable() works here, too. The scheduler won't take the CPU offline until the task left the migrate-disable section. The problem with disabled preemption here is that drain_local_pages() acquires locks which are turned into sleeping locks on PREEMPT_RT and can't be acquired with disabled preemption. Use migrate_disable() in drain_local_pages_wq(). Link: https://lkml.kernel.org/r/20211015210933.viw6rjvo64qtqxn4@xxxxxxxxxxxxx Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/page_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/mm/page_alloc.c~mm-page_alloc-use-migrate_disable-in-drain_local_pages_wq +++ a/mm/page_alloc.c @@ -3139,9 +3139,9 @@ static void drain_local_pages_wq(struct * cpu which is alright but we also have to make sure to not move to * a different one. */ - preempt_disable(); + migrate_disable(); drain_local_pages(drain->zone); - preempt_enable(); + migrate_enable(); } /* _ Patches currently in -mm which might be from bigeasy@xxxxxxxxxxxxx are mm-page_alloc-use-migrate_disable-in-drain_local_pages_wq.patch mm-disable-zsmalloc-on-preempt_rt.patch documentation-kcov-include-typesh-in-the-example.patch documentation-kcov-define-ip-in-the-example.patch kcov-allocate-per-cpu-memory-on-the-relevant-node.patch kcov-avoid-enabledisable-interrupts-if-in_task.patch kcov-replace-local_irq_save-with-a-local_lock_t.patch