6.12-stable review patch. If anyone has any objections, please let me know. ------------------ This reverts commit 2127e6b79d9d579ea538a350d1bbe859e39814d5. Reported-by: Guenter Roeck Link: https://lore.kernel.org/r/49da816c-8082-46f1-bb12-f0d6187bb06a@roeck-us.net Signed-off-by: Sasha Levin --- include/linux/srcutiny.h | 4 ---- kernel/rcu/srcutiny.c | 19 +------------------ 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/include/linux/srcutiny.h b/include/linux/srcutiny.h index 6f39d3d8ef879..4d96bbdb45f08 100644 --- a/include/linux/srcutiny.h +++ b/include/linux/srcutiny.h @@ -11,7 +11,6 @@ #ifndef _LINUX_SRCU_TINY_H #define _LINUX_SRCU_TINY_H -#include #include struct srcu_struct { @@ -25,21 +24,18 @@ struct srcu_struct { struct rcu_head *srcu_cb_head; /* Pending callbacks: Head. */ struct rcu_head **srcu_cb_tail; /* Pending callbacks: Tail. */ struct work_struct srcu_work; /* For driving grace periods. */ - struct irq_work srcu_irq_work; /* Defer schedule_work() to irq work. */ #ifdef CONFIG_DEBUG_LOCK_ALLOC struct lockdep_map dep_map; #endif /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ }; void srcu_drive_gp(struct work_struct *wp); -void srcu_tiny_irq_work(struct irq_work *irq_work); #define __SRCU_STRUCT_INIT(name, __ignored, ___ignored) \ { \ .srcu_wq = __SWAIT_QUEUE_HEAD_INITIALIZER(name.srcu_wq), \ .srcu_cb_tail = &name.srcu_cb_head, \ .srcu_work = __WORK_INITIALIZER(name.srcu_work, srcu_drive_gp), \ - .srcu_irq_work = { .func = srcu_tiny_irq_work }, \ __SRCU_DEP_MAP_INIT(name) \ } diff --git a/kernel/rcu/srcutiny.c b/kernel/rcu/srcutiny.c index ddea40b68e5f6..4dcbf8aa80ff7 100644 --- a/kernel/rcu/srcutiny.c +++ b/kernel/rcu/srcutiny.c @@ -9,7 +9,6 @@ */ #include -#include #include #include #include @@ -38,7 +37,6 @@ static int init_srcu_struct_fields(struct srcu_struct *ssp) ssp->srcu_idx_max = 0; INIT_WORK(&ssp->srcu_work, srcu_drive_gp); INIT_LIST_HEAD(&ssp->srcu_work.entry); - init_irq_work(&ssp->srcu_irq_work, srcu_tiny_irq_work); return 0; } @@ -82,7 +80,6 @@ EXPORT_SYMBOL_GPL(init_srcu_struct); void cleanup_srcu_struct(struct srcu_struct *ssp) { WARN_ON(ssp->srcu_lock_nesting[0] || ssp->srcu_lock_nesting[1]); - irq_work_sync(&ssp->srcu_irq_work); flush_work(&ssp->srcu_work); WARN_ON(ssp->srcu_gp_running); WARN_ON(ssp->srcu_gp_waiting); @@ -171,20 +168,6 @@ void srcu_drive_gp(struct work_struct *wp) } EXPORT_SYMBOL_GPL(srcu_drive_gp); -/* - * Use an irq_work to defer schedule_work() to avoid acquiring the workqueue - * pool->lock while the caller might hold scheduler locks, causing lockdep - * splats due to workqueue_init() doing a wakeup. - */ -void srcu_tiny_irq_work(struct irq_work *irq_work) -{ - struct srcu_struct *ssp; - - ssp = container_of(irq_work, struct srcu_struct, srcu_irq_work); - schedule_work(&ssp->srcu_work); -} -EXPORT_SYMBOL_GPL(srcu_tiny_irq_work); - static void srcu_gp_start_if_needed(struct srcu_struct *ssp) { unsigned long cookie; @@ -198,7 +181,7 @@ static void srcu_gp_start_if_needed(struct srcu_struct *ssp) WRITE_ONCE(ssp->srcu_idx_max, cookie); if (!READ_ONCE(ssp->srcu_gp_running)) { if (likely(srcu_init_done)) - irq_work_queue(&ssp->srcu_irq_work); + schedule_work(&ssp->srcu_work); else if (list_empty(&ssp->srcu_work.entry)) list_add(&ssp->srcu_work.entry, &srcu_boot_list); } -- 2.53.0