kvfree_rcu: Use __GFP_NOMEMALLOC for single-argument kvfree_rcu()
authorPaul E. McKenney <paulmck@kernel.org>
Wed, 20 Jan 2021 16:21:47 +0000 (17:21 +0100)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 8 Mar 2021 22:18:07 +0000 (14:18 -0800)
This commit applies the __GFP_NOMEMALLOC gfp flag to memory allocations
carried out by the single-argument variant of kvfree_rcu(), thus avoiding
this can-sleep code path from dipping into the emergency reserves.

Acked-by: Michal Hocko <mhocko@suse.com>
Suggested-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree.c

index 1f8c980f41908a284945aab5ec5ca974badcc5e2..08b50441ebe8c6e05988bfb9bc4292654f9efe48 100644 (file)
@@ -3519,7 +3519,7 @@ add_ptr_to_bulk_krc_lock(struct kfree_rcu_cpu **krcp,
                if (!bnode && can_alloc) {
                        krc_this_cpu_unlock(*krcp, *flags);
                        bnode = (struct kvfree_rcu_bulk_data *)
-                               __get_free_page(GFP_KERNEL | __GFP_RETRY_MAYFAIL | __GFP_NOWARN);
+                               __get_free_page(GFP_KERNEL | __GFP_RETRY_MAYFAIL | __GFP_NOMEMALLOC | __GFP_NOWARN);
                        *krcp = krc_this_cpu_lock(flags);
                }