Skip to content

Commit

Permalink
mm/page_alloc: add scheduling point to free_unref_page_list
Browse files Browse the repository at this point in the history
Freeing a large list of pages may cause rcu_sched starvatoin on
non-preemptible kernels

rcu: rcu_sched kthread starved for 5359 jiffies! g454793 f0x0
RCU_GP_WAIT_FQS(5) ->state=0x0 ->cpu=19
[...]
Call Trace:
  free_unref_page_list+0x19c/0x270
  release_pages+0x3cc/0x498
  tlb_flush_mmu_free+0x44/0x70
  zap_pte_range+0x450/0x738
  unmap_page_range+0x108/0x240
  unmap_vmas+0x74/0xf0
  unmap_region+0xb0/0x120
  do_munmap+0x264/0x438
  vm_munmap+0x58/0xa0
  sys_munmap+0x10/0x20
  syscall_common+0x24/0x38

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: wangjianxing <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Stephen Rothwell <[email protected]>
  • Loading branch information
wangjianxing authored and sfrothwell committed Mar 4, 2022
1 parent 3363f18 commit ef7fd62
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3479,6 +3479,9 @@ void free_unref_page_list(struct list_head *list)
*/
if (++batch_count == SWAP_CLUSTER_MAX) {
local_unlock_irqrestore(&pagesets.lock, flags);

cond_resched();

batch_count = 0;
local_lock_irqsave(&pagesets.lock, flags);
}
Expand Down

0 comments on commit ef7fd62

Please sign in to comment.