Skip to content

Commit 0fd210b

Browse files
committed
rcu: Allocate WQ with WQ_MEM_RECLAIM bit set
synchronize_rcu() users have to be processed regardless of memory pressure so our private WQ needs to have at least one execution context what WQ_MEM_RECLAIM flag guarantees. Reviewed-by: Paul E. McKenney <paulmck@kernel.org> Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org> Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
1 parent 462df2f commit 0fd210b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

kernel/rcu/tree.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1582,6 +1582,7 @@ static void rcu_sr_put_wait_head(struct llist_node *node)
15821582
/* Disabled by default. */
15831583
static int rcu_normal_wake_from_gp;
15841584
module_param(rcu_normal_wake_from_gp, int, 0644);
1585+
static struct workqueue_struct *sync_wq;
15851586

15861587
static void rcu_sr_normal_complete(struct llist_node *node)
15871588
{
@@ -1680,7 +1681,7 @@ static void rcu_sr_normal_gp_cleanup(void)
16801681
* of outstanding users(if still left) and releasing wait-heads
16811682
* added by rcu_sr_normal_gp_init() call.
16821683
*/
1683-
schedule_work(&rcu_state.srs_cleanup_work);
1684+
queue_work(sync_wq, &rcu_state.srs_cleanup_work);
16841685
}
16851686

16861687
/*
@@ -5585,6 +5586,9 @@ void __init rcu_init(void)
55855586
rcu_gp_wq = alloc_workqueue("rcu_gp", WQ_MEM_RECLAIM, 0);
55865587
WARN_ON(!rcu_gp_wq);
55875588

5589+
sync_wq = alloc_workqueue("sync_wq", WQ_MEM_RECLAIM, 0);
5590+
WARN_ON(!sync_wq);
5591+
55885592
/* Fill in default value for rcutree.qovld boot parameter. */
55895593
/* -After- the rcu_node ->lock fields are initialized! */
55905594
if (qovld < 0)

0 commit comments

Comments
 (0)