From: Michal Hocko Memory reclaim can miss quite a lot of pages freed through call_rcu because it itself doen't trigger RCU grace period. cond_resched() is not sufficient for that. Call rcu_barrier to wait for those callbacks to execute before retrying the reclaim loop again. Signed-off-by: Michal Hocko --- mm/page_alloc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 6624293e4d78..399a7682b2c9 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4701,6 +4701,9 @@ should_reclaim_retry(gfp_t gfp_mask, unsigned order, schedule_timeout_uninterruptible(1); else cond_resched(); + + /* Wait for any potential call_rcu memory freers */ + rcu_barrier(); out: /* Before OOM, exhaust highatomic_reserve */ if (!ret) -- 2.56.1