Skip to content

Commit

Permalink
mm/page_alloc: Use migrate_disable() in drain_local_pages_wq()
Browse files Browse the repository at this point in the history
The drain_local_pages_wq() uses preempt_disable() to ensure that there
will be no CPU migration while drain_local_pages() is invoked which
might happen if the CPU is going down.
drain_local_pages() acquires a sleeping lock on RT which can not be
acquired with disabled preemption.

Use migrate_disable() instead of preempt_disable(): On RT it ensures
that the CPU won't go down and on !RT it is replaced with
preempt_disable().

Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
Signed-off-by: Alexander Winkowski <[email protected]>
  • Loading branch information
Sebastian Andrzej Siewior authored and dereference23 committed Jun 18, 2023
1 parent c093645 commit 5acd724
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2668,9 +2668,9 @@ static void drain_local_pages_wq(struct work_struct *work)
* cpu which is allright 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();
}

/*
Expand Down

0 comments on commit 5acd724

Please sign in to comment.