History

rcu: Clean up after the SRCU-fastification of RCU Tasks Trace

Now that RCU Tasks Trace has been re-implemented in terms of SRCU-fast, the ->trc_ipi_to_cpu, ->trc_blkd_cpu, ->trc_blkd_node, ->trc_holdout_list, and ->trc_reader_special task_struct fields are no longer used. In addition, the rcu_tasks_trace_qs(), rcu_tasks_trace_qs_blkd(), exit_tasks_rcu_finish_trace(), and rcu_spawn_tasks_trace_kthread(), show_rcu_tasks_trace_gp_kthread(), rcu_tasks_trace_get_gp_data(), rcu_tasks_trace_torture_stats_print(), and get_rcu_tasks_trace_gp_kthread() functions and all the other functions that they invoke are no longer used. Also, the TRC_NEED_QS and TRC_NEED_QS_CHECKED CPP macros are no longer used. Neither are the rcu_tasks_trace_lazy_ms and rcu_task_ipi_delay rcupdate module parameters and the TASKS_TRACE_RCU_READ_MB Kconfig option. This commit therefore removes all of them. [ paulmck: Apply Alexei Starovoitov feedback. ]

Paul E. McKenney committed 10 months ago

Commit a73fc3d1 parent 46e323513 files · +2 −174Browse files

Unified · Split

13 files
  1. Documentation/admin-guide/kernel-parameters.txt +0 −15
  2. include/linux/rcupdate.h +1 −30
  3. include/linux/rcupdate_trace.h +0 −2
  4. include/linux/sched.h +0 −5
  5. init/init_task.c +0 −3
  6. kernel/fork.c +0 −3
  7. kernel/rcu/Kconfig +0 −18
  8. kernel/rcu/rcu.h +0 −9
  9. kernel/rcu/rcuscale.c +0 −7
  10. kernel/rcu/rcutorture.c +0 −2
  11. kernel/rcu/tasks.h +1 −78
  12. tools/testing/selftests/rcutorture/configs/rcu/TRACE01 +0 −1
  13. tools/testing/selftests/rcutorture/configs/rcu/TRACE02 +0 −1
Documentation/admin-guide/kernel-parameters.txt+0−15
@@ -6249,13 +6249,6 @@ Kernel parameters · 6248 unmodified lines
62496249 dynamically) adjusted. This parameter is intended
62506250 for use in testing.
62516251
6252− rcupdate.rcu_task_ipi_delay= [KNL]
6253− Set time in jiffies during which RCU tasks will
6254− avoid sending IPIs, starting with the beginning
6255− of a given grace period. Setting a large
6256− number avoids disturbing real-time workloads,
6257− but lengthens grace periods.
6258−
62596252 rcupdate.rcu_task_lazy_lim= [KNL]
62606253 Number of callbacks on a given CPU that will
62616254 cancel laziness on that CPU. Use -1 to disable
@@ -6299,14 +6292,6 @@ Kernel parameters · 37 unmodified lines
62996292 of zero will disable batching. Batching is
63006293 always disabled for synchronize_rcu_tasks().
63016294
6302− rcupdate.rcu_tasks_trace_lazy_ms= [KNL]
6303− Set timeout in milliseconds RCU Tasks
6304− Trace asynchronous callback batching for
6305− call_rcu_tasks_trace(). A negative value
6306− will take the default. A value of zero will
6307− disable batching. Batching is always disabled
6308− for synchronize_rcu_tasks_trace().
6309−
63106295 rcupdate.rcu_self_test= [KNL]
63116296 Run the RCU early boot self tests
63126297
include/linux/rcupdate.h+1−30
@@ -175,36 +175,7 @@ void rcu_tasks_torture_stats_print(char *tt, char *tf); · 174 unmodified lines
175175 # define synchronize_rcu_tasks synchronize_rcu
176176 # endif
177177
178−# ifdef CONFIG_TASKS_TRACE_RCU
179−// Bits for ->trc_reader_special.b.need_qs field.
180−#define TRC_NEED_QS 0x1 // Task needs a quiescent state.
181−#define TRC_NEED_QS_CHECKED 0x2 // Task has been checked for needing quiescent state.
182−
183−u8 rcu_trc_cmpxchg_need_qs(struct task_struct *t, u8 old, u8 new);
184−void rcu_tasks_trace_qs_blkd(struct task_struct *t);
185−
186−# define rcu_tasks_trace_qs(t) \
187− do { \
188− int ___rttq_nesting = READ_ONCE((t)->trc_reader_nesting); \
189− \
190− if (unlikely(READ_ONCE((t)->trc_reader_special.b.need_qs) == TRC_NEED_QS) && \
191− likely(!___rttq_nesting)) { \
192− rcu_trc_cmpxchg_need_qs((t), TRC_NEED_QS, TRC_NEED_QS_CHECKED); \
193− } else if (___rttq_nesting && ___rttq_nesting != INT_MIN && \
194− !READ_ONCE((t)->trc_reader_special.b.blocked)) { \
195− rcu_tasks_trace_qs_blkd(t); \
196− } \
197− } while (0)
198−void rcu_tasks_trace_torture_stats_print(char *tt, char *tf);
199−# else
200−# define rcu_tasks_trace_qs(t) do { } while (0)
201−# endif
202−
203−#define rcu_tasks_qs(t, preempt) \
204−do { \
205− rcu_tasks_classic_qs((t), (preempt)); \
206− rcu_tasks_trace_qs(t); \
207−} while (0)
178+#define rcu_tasks_qs(t, preempt) rcu_tasks_classic_qs((t), (preempt))
208179
209180 # ifdef CONFIG_TASKS_RUDE_RCU
210181 void synchronize_rcu_tasks_rude(void);
include/linux/rcupdate_trace.h+0−2
@@ -136,9 +136,7 @@ static inline void rcu_barrier_tasks_trace(void) · 135 unmodified lines
136136 }
137137
138138 // Placeholders to enable stepwise transition.
139−void rcu_tasks_trace_get_gp_data(int *flags, unsigned long *gp_seq);
140139 void __init rcu_tasks_trace_suppress_unused(void);
141−struct task_struct *get_rcu_tasks_trace_gp_kthread(void);
142140
143141 #else
144142 /*
include/linux/sched.h+0−5
@@ -946,11 +946,6 @@ struct task_struct { · 945 unmodified lines
946946 #ifdef CONFIG_TASKS_TRACE_RCU
947947 int trc_reader_nesting;
948948 struct srcu_ctr __percpu *trc_reader_scp;
949− int trc_ipi_to_cpu;
950− union rcu_special trc_reader_special;
951− struct list_head trc_holdout_list;
952− struct list_head trc_blkd_node;
953− int trc_blkd_cpu;
954949 #endif /* #ifdef CONFIG_TASKS_TRACE_RCU */
955950
956951 struct sched_info sched_info;
init/init_task.c+0−3
@@ -195,9 +195,6 @@ struct task_struct init_task __aligned(L1_CACHE_BYTES) = { · 194 unmodified lines
195195 #endif
196196 #ifdef CONFIG_TASKS_TRACE_RCU
197197 .trc_reader_nesting = 0,
198− .trc_reader_special.s = 0,
199− .trc_holdout_list = LIST_HEAD_INIT(init_task.trc_holdout_list),
200− .trc_blkd_node = LIST_HEAD_INIT(init_task.trc_blkd_node),
201198 #endif
202199 #ifdef CONFIG_CPUSETS
203200 .mems_allowed_seq = SEQCNT_SPINLOCK_ZERO(init_task.mems_allowed_seq,
kernel/fork.c+0−3
@@ -1828,9 +1828,6 @@ static inline void rcu_copy_process(struct task_struct *p) · 1827 unmodified lines
18281828 #endif /* #ifdef CONFIG_TASKS_RCU */
18291829 #ifdef CONFIG_TASKS_TRACE_RCU
18301830 p->trc_reader_nesting = 0;
1831− p->trc_reader_special.s = 0;
1832− INIT_LIST_HEAD(&p->trc_holdout_list);
1833− INIT_LIST_HEAD(&p->trc_blkd_node);
18341831 #endif /* #ifdef CONFIG_TASKS_TRACE_RCU */
18351832 }
18361833
kernel/rcu/Kconfig+0−18
@@ -313,24 +313,6 @@ config RCU_NOCB_CPU_CB_BOOST · 312 unmodified lines
313313 Say Y here if you want to set RT priority for offloading kthreads.
314314 Say N here if you are building a !PREEMPT_RT kernel and are unsure.
315315
316−config TASKS_TRACE_RCU_READ_MB
317− bool "Tasks Trace RCU readers use memory barriers in user and idle"
318− depends on RCU_EXPERT && TASKS_TRACE_RCU
319− default PREEMPT_RT || NR_CPUS < 8
320− help
321− Use this option to further reduce the number of IPIs sent
322− to CPUs executing in userspace or idle during tasks trace
323− RCU grace periods. Given that a reasonable setting of
324− the rcupdate.rcu_task_ipi_delay kernel boot parameter
325− eliminates such IPIs for many workloads, proper setting
326− of this Kconfig option is important mostly for aggressive
327− real-time installations and for battery-powered devices,
328− hence the default chosen above.
329−
330− Say Y here if you hate IPIs.
331− Say N here if you hate read-side memory barriers.
332− Take the default if you are unsure.
333−
334316 config RCU_LAZY
335317 bool "RCU callback lazy invocation functionality"
336318 depends on RCU_NOCB_CPU
kernel/rcu/rcu.h+0−9
@@ -544,10 +544,6 @@ struct task_struct *get_rcu_tasks_rude_gp_kthread(void); · 543 unmodified lines
544544 void rcu_tasks_rude_get_gp_data(int *flags, unsigned long *gp_seq);
545545 #endif // # ifdef CONFIG_TASKS_RUDE_RCU
546546
547−#ifdef CONFIG_TASKS_TRACE_RCU
548−void rcu_tasks_trace_get_gp_data(int *flags, unsigned long *gp_seq);
549−#endif
550−
551547 #ifdef CONFIG_TASKS_RCU_GENERIC
552548 void tasks_cblist_init_generic(void);
553549 #else /* #ifdef CONFIG_TASKS_RCU_GENERIC */
@@ -673,11 +669,6 @@ void show_rcu_tasks_rude_gp_kthread(void); · 119 unmodified lines
673669 #else
674670 static inline void show_rcu_tasks_rude_gp_kthread(void) {}
675671 #endif
676−#if !defined(CONFIG_TINY_RCU) && defined(CONFIG_TASKS_TRACE_RCU)
677−void show_rcu_tasks_trace_gp_kthread(void);
678−#else
679−static inline void show_rcu_tasks_trace_gp_kthread(void) {}
680−#endif
681672
682673 #ifdef CONFIG_TINY_RCU
683674 static inline bool rcu_cpu_beenfullyonline(int cpu) { return true; }
kernel/rcu/rcuscale.c+0−7
@@ -400,11 +400,6 @@ static void tasks_trace_scale_read_unlock(int idx) · 399 unmodified lines
400400 rcu_read_unlock_trace();
401401 }
402402
403−static void rcu_tasks_trace_scale_stats(void)
404−{
405− rcu_tasks_trace_torture_stats_print(scale_type, SCALE_FLAG);
406−}
407−
408403 static struct rcu_scale_ops tasks_tracing_ops = {
409404 .ptype = RCU_TASKS_FLAVOR,
410405 .init = rcu_sync_scale_init,
@@ -416,8 +411,6 @@ static struct rcu_scale_ops tasks_tracing_ops = { · 5 unmodified lines
416411 .gp_barrier = rcu_barrier_tasks_trace,
417412 .sync = synchronize_rcu_tasks_trace,
418413 .exp_sync = synchronize_rcu_tasks_trace,
419− .rso_gp_kthread = get_rcu_tasks_trace_gp_kthread,
420− .stats = IS_ENABLED(CONFIG_TINY_RCU) ? NULL : rcu_tasks_trace_scale_stats,
421414 .name = "tasks-tracing"
422415 };
423416
kernel/rcu/rcutorture.c+0−2
@@ -1180,8 +1180,6 @@ static struct rcu_torture_ops tasks_tracing_ops = { · 1179 unmodified lines
11801180 .exp_sync = synchronize_rcu_tasks_trace,
11811181 .call = call_rcu_tasks_trace,
11821182 .cb_barrier = rcu_barrier_tasks_trace,
1183− .gp_kthread_dbg = show_rcu_tasks_trace_gp_kthread,
1184− .get_gp_data = rcu_tasks_trace_get_gp_data,
11851183 .cbflood_max = 50000,
11861184 .irq_capable = 1,
11871185 .slow_gps = 1,
kernel/rcu/tasks.h+1−78
@@ -161,11 +161,6 @@ static void tasks_rcu_exit_srcu_stall(struct timer_list *unused); · 160 unmodified lines
161161 static DEFINE_TIMER(tasks_rcu_exit_srcu_stall_timer, tasks_rcu_exit_srcu_stall);
162162 #endif
163163
164−/* Avoid IPIing CPUs early in the grace period. */
165−#define RCU_TASK_IPI_DELAY (IS_ENABLED(CONFIG_TASKS_TRACE_RCU_READ_MB) ? HZ / 2 : 0)
166−static int rcu_task_ipi_delay __read_mostly = RCU_TASK_IPI_DELAY;
167−module_param(rcu_task_ipi_delay, int, 0644);
168−
169164 /* Control stall timeouts. Disable with <= 0, otherwise jiffies till stall. */
170165 #define RCU_TASK_BOOT_STALL_TIMEOUT (HZ * 30)
171166 #define RCU_TASK_STALL_TIMEOUT (HZ * 60 * 10)
@@ -800,8 +795,6 @@ static void rcu_tasks_torture_stats_print_generic(struct rcu_tasks *rtp, char *t · 628 unmodified lines
800795
801796 #endif // #ifndef CONFIG_TINY_RCU
802797
803−static void exit_tasks_rcu_finish_trace(struct task_struct *t);
804−
805798 #if defined(CONFIG_TASKS_RCU)
806799
807800 ////////////////////////////////////////////////////////////////////////
@@ -1321,13 +1314,11 @@ void exit_tasks_rcu_finish(void) · 513 unmodified lines
13211314 raw_spin_lock_irqsave_rcu_node(rtpcp, flags);
13221315 list_del_init(&t->rcu_tasks_exit_list);
13231316 raw_spin_unlock_irqrestore_rcu_node(rtpcp, flags);
1324−
1325− exit_tasks_rcu_finish_trace(t);
13261317 }
13271318
13281319 #else /* #ifdef CONFIG_TASKS_RCU */
13291320 void exit_tasks_rcu_start(void) { }
1330−void exit_tasks_rcu_finish(void) { exit_tasks_rcu_finish_trace(current); }
1321+void exit_tasks_rcu_finish(void) { }
13311322 #endif /* #else #ifdef CONFIG_TASKS_RCU */
13321323
13331324 #ifdef CONFIG_TASKS_RUDE_RCU
@@ -1475,69 +1466,6 @@ void __init rcu_tasks_trace_suppress_unused(void) · 141 unmodified lines
14751466 #endif // #ifndef CONFIG_TINY_RCU
14761467 }
14771468
1478−/*
1479− * Do a cmpxchg() on ->trc_reader_special.b.need_qs, allowing for
1480− * the four-byte operand-size restriction of some platforms.
1481− *
1482− * Returns the old value, which is often ignored.
1483− */
1484−u8 rcu_trc_cmpxchg_need_qs(struct task_struct *t, u8 old, u8 new)
1485−{
1486− return cmpxchg(&t->trc_reader_special.b.need_qs, old, new);
1487−}
1488−EXPORT_SYMBOL_GPL(rcu_trc_cmpxchg_need_qs);
1489−
1490−/* Add a newly blocked reader task to its CPU's list. */
1491−void rcu_tasks_trace_qs_blkd(struct task_struct *t)
1492−{
1493−}
1494−EXPORT_SYMBOL_GPL(rcu_tasks_trace_qs_blkd);
1495−
1496−/* Communicate task state back to the RCU tasks trace stall warning request. */
1497−struct trc_stall_chk_rdr {
1498− int nesting;
1499− int ipi_to_cpu;
1500− u8 needqs;
1501−};
1502−
1503−/* Report any needed quiescent state for this exiting task. */
1504−static void exit_tasks_rcu_finish_trace(struct task_struct *t)
1505−{
1506−}
1507−
1508−int rcu_tasks_trace_lazy_ms = -1;
1509−module_param(rcu_tasks_trace_lazy_ms, int, 0444);
1510−
1511−static int __init rcu_spawn_tasks_trace_kthread(void)
1512−{
1513− return 0;
1514−}
1515−
1516−#if !defined(CONFIG_TINY_RCU)
1517−void show_rcu_tasks_trace_gp_kthread(void)
1518−{
1519−}
1520−EXPORT_SYMBOL_GPL(show_rcu_tasks_trace_gp_kthread);
1521−
1522−void rcu_tasks_trace_torture_stats_print(char *tt, char *tf)
1523−{
1524−}
1525−EXPORT_SYMBOL_GPL(rcu_tasks_trace_torture_stats_print);
1526−#endif // !defined(CONFIG_TINY_RCU)
1527−
1528−struct task_struct *get_rcu_tasks_trace_gp_kthread(void)
1529−{
1530− return NULL;
1531−}
1532−EXPORT_SYMBOL_GPL(get_rcu_tasks_trace_gp_kthread);
1533−
1534−void rcu_tasks_trace_get_gp_data(int *flags, unsigned long *gp_seq)
1535−{
1536−}
1537−EXPORT_SYMBOL_GPL(rcu_tasks_trace_get_gp_data);
1538−
1539−#else /* #ifdef CONFIG_TASKS_TRACE_RCU */
1540−static void exit_tasks_rcu_finish_trace(struct task_struct *t) { }
15411469 #endif /* #else #ifdef CONFIG_TASKS_TRACE_RCU */
15421470
15431471 #ifndef CONFIG_TINY_RCU
@@ -1545,7 +1473,6 @@ void show_rcu_tasks_gp_kthreads(void) · 1 unmodified line
15451473 {
15461474 show_rcu_tasks_classic_gp_kthread();
15471475 show_rcu_tasks_rude_gp_kthread();
1548− show_rcu_tasks_trace_gp_kthread();
15491476 }
15501477 #endif /* #ifndef CONFIG_TINY_RCU */
15511478
@@ -1684,10 +1611,6 @@ static int __init rcu_init_tasks_generic(void) · 132 unmodified lines
16841611 rcu_spawn_tasks_rude_kthread();
16851612 #endif
16861613
1687−#ifdef CONFIG_TASKS_TRACE_RCU
1688− rcu_spawn_tasks_trace_kthread();
1689−#endif
1690−
16911614 // Run the self-tests.
16921615 rcu_tasks_initiate_self_tests();
16931616
tools/testing/selftests/rcutorture/configs/rcu/TRACE01+0−1
@@ -10,5 +10,4 @@ CONFIG_PROVE_LOCKING=n · 9 unmodified lines
1010 #CHECK#CONFIG_PROVE_RCU=n
1111 CONFIG_FORCE_TASKS_TRACE_RCU=y
1212 #CHECK#CONFIG_TASKS_TRACE_RCU=y
13−CONFIG_TASKS_TRACE_RCU_READ_MB=y
1413 CONFIG_RCU_EXPERT=y
tools/testing/selftests/rcutorture/configs/rcu/TRACE02+0−1
@@ -9,6 +9,5 @@ CONFIG_PROVE_LOCKING=y · 8 unmodified lines
99 #CHECK#CONFIG_PROVE_RCU=y
1010 CONFIG_FORCE_TASKS_TRACE_RCU=y
1111 #CHECK#CONFIG_TASKS_TRACE_RCU=y
12−CONFIG_TASKS_TRACE_RCU_READ_MB=n
1312 CONFIG_RCU_EXPERT=y
1413 CONFIG_DEBUG_OBJECTS=y

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t