aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/srcutiny.h2
-rw-r--r--include/linux/srcutree.h3
-rw-r--r--kernel/rcu/srcutiny.c10
-rw-r--r--kernel/rcu/srcutree.c11
4 files changed, 11 insertions, 15 deletions
diff --git a/include/linux/srcutiny.h b/include/linux/srcutiny.h
index 2b5c0822e683..f41d2fb09f87 100644
--- a/include/linux/srcutiny.h
+++ b/include/linux/srcutiny.h
@@ -36,7 +36,6 @@ struct srcu_struct {
36 struct rcu_head *srcu_cb_head; /* Pending callbacks: Head. */ 36 struct rcu_head *srcu_cb_head; /* Pending callbacks: Head. */
37 struct rcu_head **srcu_cb_tail; /* Pending callbacks: Tail. */ 37 struct rcu_head **srcu_cb_tail; /* Pending callbacks: Tail. */
38 struct work_struct srcu_work; /* For driving grace periods. */ 38 struct work_struct srcu_work; /* For driving grace periods. */
39 struct list_head srcu_boot_entry; /* Early-boot callbacks. */
40#ifdef CONFIG_DEBUG_LOCK_ALLOC 39#ifdef CONFIG_DEBUG_LOCK_ALLOC
41 struct lockdep_map dep_map; 40 struct lockdep_map dep_map;
42#endif /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ 41#endif /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
@@ -49,7 +48,6 @@ void srcu_drive_gp(struct work_struct *wp);
49 .srcu_wq = __SWAIT_QUEUE_HEAD_INITIALIZER(name.srcu_wq), \ 48 .srcu_wq = __SWAIT_QUEUE_HEAD_INITIALIZER(name.srcu_wq), \
50 .srcu_cb_tail = &name.srcu_cb_head, \ 49 .srcu_cb_tail = &name.srcu_cb_head, \
51 .srcu_work = __WORK_INITIALIZER(name.srcu_work, srcu_drive_gp), \ 50 .srcu_work = __WORK_INITIALIZER(name.srcu_work, srcu_drive_gp), \
52 .srcu_boot_entry = LIST_HEAD_INIT(name.srcu_boot_entry), \
53 __SRCU_DEP_MAP_INIT(name) \ 51 __SRCU_DEP_MAP_INIT(name) \
54} 52}
55 53
diff --git a/include/linux/srcutree.h b/include/linux/srcutree.h
index 9cfa4610113a..0ae91b3a7406 100644
--- a/include/linux/srcutree.h
+++ b/include/linux/srcutree.h
@@ -94,7 +94,6 @@ struct srcu_struct {
94 /* callback for the barrier */ 94 /* callback for the barrier */
95 /* operation. */ 95 /* operation. */
96 struct delayed_work work; 96 struct delayed_work work;
97 struct list_head srcu_boot_entry; /* Early-boot callbacks. */
98#ifdef CONFIG_DEBUG_LOCK_ALLOC 97#ifdef CONFIG_DEBUG_LOCK_ALLOC
99 struct lockdep_map dep_map; 98 struct lockdep_map dep_map;
100#endif /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ 99#endif /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
@@ -110,7 +109,7 @@ struct srcu_struct {
110 .sda = &pcpu_name, \ 109 .sda = &pcpu_name, \
111 .lock = __SPIN_LOCK_UNLOCKED(name.lock), \ 110 .lock = __SPIN_LOCK_UNLOCKED(name.lock), \
112 .srcu_gp_seq_needed = -1UL, \ 111 .srcu_gp_seq_needed = -1UL, \
113 .srcu_boot_entry = LIST_HEAD_INIT(name.srcu_boot_entry), \ 112 .work = __DELAYED_WORK_INITIALIZER(name.work, NULL, 0), \
114 __SRCU_DEP_MAP_INIT(name) \ 113 __SRCU_DEP_MAP_INIT(name) \
115} 114}
116 115
diff --git a/kernel/rcu/srcutiny.c b/kernel/rcu/srcutiny.c
index d233f0c63f6f..b46e6683f8c9 100644
--- a/kernel/rcu/srcutiny.c
+++ b/kernel/rcu/srcutiny.c
@@ -48,7 +48,7 @@ static int init_srcu_struct_fields(struct srcu_struct *sp)
48 sp->srcu_gp_waiting = false; 48 sp->srcu_gp_waiting = false;
49 sp->srcu_idx = 0; 49 sp->srcu_idx = 0;
50 INIT_WORK(&sp->srcu_work, srcu_drive_gp); 50 INIT_WORK(&sp->srcu_work, srcu_drive_gp);
51 INIT_LIST_HEAD(&sp->srcu_boot_entry); 51 INIT_LIST_HEAD(&sp->srcu_work.entry);
52 return 0; 52 return 0;
53} 53}
54 54
@@ -185,8 +185,8 @@ void call_srcu(struct srcu_struct *sp, struct rcu_head *rhp,
185 if (!READ_ONCE(sp->srcu_gp_running)) { 185 if (!READ_ONCE(sp->srcu_gp_running)) {
186 if (likely(srcu_init_done)) 186 if (likely(srcu_init_done))
187 schedule_work(&sp->srcu_work); 187 schedule_work(&sp->srcu_work);
188 else if (list_empty(&sp->srcu_boot_entry)) 188 else if (list_empty(&sp->srcu_work.entry))
189 list_add(&sp->srcu_boot_entry, &srcu_boot_list); 189 list_add(&sp->srcu_work.entry, &srcu_boot_list);
190 } 190 }
191} 191}
192EXPORT_SYMBOL_GPL(call_srcu); 192EXPORT_SYMBOL_GPL(call_srcu);
@@ -224,8 +224,8 @@ void __init srcu_init(void)
224 srcu_init_done = true; 224 srcu_init_done = true;
225 while (!list_empty(&srcu_boot_list)) { 225 while (!list_empty(&srcu_boot_list)) {
226 sp = list_first_entry(&srcu_boot_list, 226 sp = list_first_entry(&srcu_boot_list,
227 struct srcu_struct, srcu_boot_entry); 227 struct srcu_struct, srcu_work.entry);
228 list_del_init(&sp->srcu_boot_entry); 228 list_del_init(&sp->srcu_work.entry);
229 schedule_work(&sp->srcu_work); 229 schedule_work(&sp->srcu_work);
230 } 230 }
231} 231}
diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
index 2e7f6b460150..86c7fd0a1bfe 100644
--- a/kernel/rcu/srcutree.c
+++ b/kernel/rcu/srcutree.c
@@ -186,7 +186,6 @@ static int init_srcu_struct_fields(struct srcu_struct *sp, bool is_static)
186 mutex_init(&sp->srcu_barrier_mutex); 186 mutex_init(&sp->srcu_barrier_mutex);
187 atomic_set(&sp->srcu_barrier_cpu_cnt, 0); 187 atomic_set(&sp->srcu_barrier_cpu_cnt, 0);
188 INIT_DELAYED_WORK(&sp->work, process_srcu); 188 INIT_DELAYED_WORK(&sp->work, process_srcu);
189 INIT_LIST_HEAD(&sp->srcu_boot_entry);
190 if (!is_static) 189 if (!is_static)
191 sp->sda = alloc_percpu(struct srcu_data); 190 sp->sda = alloc_percpu(struct srcu_data);
192 init_srcu_struct_nodes(sp, is_static); 191 init_srcu_struct_nodes(sp, is_static);
@@ -708,8 +707,8 @@ static void srcu_funnel_gp_start(struct srcu_struct *sp, struct srcu_data *sdp,
708 if (likely(srcu_init_done)) 707 if (likely(srcu_init_done))
709 queue_delayed_work(rcu_gp_wq, &sp->work, 708 queue_delayed_work(rcu_gp_wq, &sp->work,
710 srcu_get_delay(sp)); 709 srcu_get_delay(sp));
711 else if (list_empty(&sp->srcu_boot_entry)) 710 else if (list_empty(&sp->work.work.entry))
712 list_add(&sp->srcu_boot_entry, &srcu_boot_list); 711 list_add(&sp->work.work.entry, &srcu_boot_list);
713 } 712 }
714 spin_unlock_irqrestore_rcu_node(sp, flags); 713 spin_unlock_irqrestore_rcu_node(sp, flags);
715} 714}
@@ -1323,10 +1322,10 @@ void __init srcu_init(void)
1323 1322
1324 srcu_init_done = true; 1323 srcu_init_done = true;
1325 while (!list_empty(&srcu_boot_list)) { 1324 while (!list_empty(&srcu_boot_list)) {
1326 sp = list_first_entry(&srcu_boot_list, 1325 sp = list_first_entry(&srcu_boot_list, struct srcu_struct,
1327 struct srcu_struct, srcu_boot_entry); 1326 work.work.entry);
1328 check_init_srcu_struct(sp); 1327 check_init_srcu_struct(sp);
1329 list_del_init(&sp->srcu_boot_entry); 1328 list_del_init(&sp->work.work.entry);
1330 queue_work(rcu_gp_wq, &sp->work.work); 1329 queue_work(rcu_gp_wq, &sp->work.work);
1331 } 1330 }
1332} 1331}