History

rcu: Improve tree.c comments and add code cleanups

This commit cleans up some comments and code in kernel/rcu/tree.c.

Zhouyi Zhou committed 5 years ago

Commit 277ffe11 parent ce7c1691 file · +12 −12Browse files

Unified · Split

kernel/rcu/tree.c+12−12
@@ -202,7 +202,7 @@ EXPORT_SYMBOL_GPL(rcu_get_gp_kthreads_prio); · 201 unmodified lines
202202 * the need for long delays to increase some race probabilities with the
203203 * need for fast grace periods to increase other race probabilities.
204204 */
205−#define PER_RCU_NODE_PERIOD 3 /* Number of grace periods between delays. */
205+#define PER_RCU_NODE_PERIOD 3 /* Number of grace periods between delays for debugging. */
206206
207207 /*
208208 * Compute the mask of online CPUs for the specified rcu_node structure.
@@ -937,7 +937,7 @@ EXPORT_SYMBOL_GPL(rcu_idle_exit); · 728 unmodified lines
937937 */
938938 void noinstr rcu_user_exit(void)
939939 {
940− rcu_eqs_exit(1);
940+ rcu_eqs_exit(true);
941941 }
942942
943943 /**
@@ -1203,7 +1203,7 @@ EXPORT_SYMBOL_GPL(rcu_lockdep_current_cpu_online); · 259 unmodified lines
12031203 #endif /* #if defined(CONFIG_PROVE_RCU) && defined(CONFIG_HOTPLUG_CPU) */
12041204
12051205 /*
1206− * We are reporting a quiescent state on behalf of some other CPU, so
1206+ * When trying to report a quiescent state on behalf of some other CPU,
12071207 * it is our responsibility to check for and handle potential overflow
12081208 * of the rcu_node ->gp_seq counter with respect to the rcu_data counters.
12091209 * After all, the CPU might be in deep idle state, and thus executing no
@@ -2607,7 +2607,7 @@ static void rcu_do_batch(struct rcu_data *rdp) · 1397 unmodified lines
26072607 * state, for example, user mode or idle loop. It also schedules RCU
26082608 * core processing. If the current grace period has gone on too long,
26092609 * it will ask the scheduler to manufacture a context switch for the sole
2610− * purpose of providing a providing the needed quiescent state.
2610+ * purpose of providing the needed quiescent state.
26112611 */
26122612 void rcu_sched_clock_irq(int user)
26132613 {
@@ -3236,7 +3236,7 @@ put_cached_bnode(struct kfree_rcu_cpu *krcp, · 622 unmodified lines
32363236
32373237 /*
32383238 * This function is invoked in workqueue context after a grace period.
3239− * It frees all the objects queued on ->bhead_free or ->head_free.
3239+ * It frees all the objects queued on ->bkvhead_free or ->head_free.
32403240 */
32413241 static void kfree_rcu_work(struct work_struct *work)
32423242 {
@@ -3263,7 +3263,7 @@ static void kfree_rcu_work(struct work_struct *work) · 20 unmodified lines
32633263 krwp->head_free = NULL;
32643264 raw_spin_unlock_irqrestore(&krcp->lock, flags);
32653265
3266− // Handle two first channels.
3266+ // Handle the first two channels.
32673267 for (i = 0; i < FREE_N_CHANNELS; i++) {
32683268 for (; bkvhead[i]; bkvhead[i] = bnext) {
32693269 bnext = bkvhead[i]->next;
@@ -3530,11 +3530,11 @@ add_ptr_to_bulk_krc_lock(struct kfree_rcu_cpu **krcp, · 260 unmodified lines
35303530 }
35313531
35323532 /*
3533− * Queue a request for lazy invocation of appropriate free routine after a
3534− * grace period. Please note there are three paths are maintained, two are the
3535− * main ones that use array of pointers interface and third one is emergency
3536− * one, that is used only when the main path can not be maintained temporary,
3537− * due to memory pressure.
3533+ * Queue a request for lazy invocation of the appropriate free routine
3534+ * after a grace period. Please note that three paths are maintained,
3535+ * two for the common case using arrays of pointers and a third one that
3536+ * is used only when the main paths cannot be used, for example, due to
3537+ * memory pressure.
35383538 *
35393539 * Each kvfree_call_rcu() request is added to a batch. The batch will be drained
35403540 * every KFREE_DRAIN_JIFFIES number of jiffies. All the objects in the batch will
@@ -4708,7 +4708,7 @@ void __init rcu_init(void) · 1167 unmodified lines
47084708 rcutree_online_cpu(cpu);
47094709 }
47104710
4711− /* Create workqueue for expedited GPs and for Tree SRCU. */
4711+ /* Create workqueue for Tree SRCU and for expedited GPs. */
47124712 rcu_gp_wq = alloc_workqueue("rcu_gp", WQ_MEM_RECLAIM, 0);
47134713 WARN_ON(!rcu_gp_wq);
47144714 rcu_par_gp_wq = alloc_workqueue("rcu_par_gp", WQ_MEM_RECLAIM, 0);

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