Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6714c22 authored by Paul E. McKenney's avatar Paul E. McKenney Committed by Ingo Molnar
Browse files

rcu: Renamings to increase RCU clarity



Make RCU-sched, RCU-bh, and RCU-preempt be underlying
implementations, with "RCU" defined in terms of one of the
three.  Update the outdated rcu_qsctr_inc() names, as these
functions no longer increment anything.

Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: laijs@cn.fujitsu.com
Cc: dipankar@in.ibm.com
Cc: akpm@linux-foundation.org
Cc: mathieu.desnoyers@polymtl.ca
Cc: josht@linux.vnet.ibm.com
Cc: dvhltc@us.ibm.com
Cc: niv@us.ibm.com
Cc: peterz@infradead.org
Cc: rostedt@goodmis.org
LKML-Reference: <12509746132696-git-send-email->
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 9f77da9f
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -191,8 +191,7 @@ rcu/rcuhier (which displays the struct rcu_node hierarchy).

The output of "cat rcu/rcudata" looks as follows:

rcu:
rcu:
rcu_sched:
  0 c=17829 g=17829 pq=1 pqc=17829 qp=0 dt=10951/1 dn=0 df=1101 of=0 ri=36 ql=0 b=10
  1 c=17829 g=17829 pq=1 pqc=17829 qp=0 dt=16117/1 dn=0 df=1015 of=0 ri=0 ql=0 b=10
  2 c=17829 g=17829 pq=1 pqc=17829 qp=0 dt=1445/1 dn=0 df=1839 of=0 ri=0 ql=0 b=10
@@ -306,7 +305,7 @@ comma-separated-variable spreadsheet format.

The output of "cat rcu/rcugp" looks as follows:

rcu: completed=33062  gpnum=33063
rcu_sched: completed=33062  gpnum=33063
rcu_bh: completed=464  gpnum=464

Again, this output is for both "rcu" and "rcu_bh".  The fields are
@@ -413,7 +412,7 @@ o Each element of the form "1/1 0:127 ^0" represents one struct

The output of "cat rcu/rcu_pending" looks as follows:

rcu:
rcu_sched:
  0 np=255892 qsp=53936 cbr=0 cng=14417 gpc=10033 gps=24320 nf=6445 nn=146741
  1 np=261224 qsp=54638 cbr=0 cng=25723 gpc=16310 gps=2849 nf=5912 nn=155792
  2 np=237496 qsp=49664 cbr=0 cng=2762 gpc=45478 gps=1762 nf=1201 nn=136629
+16 −5
Original line number Diff line number Diff line
@@ -157,17 +157,28 @@ extern int rcu_scheduler_active;
 * - call_rcu_sched() and rcu_barrier_sched()
 * on the write-side to insure proper synchronization.
 */
#define rcu_read_lock_sched() preempt_disable()
#define rcu_read_lock_sched_notrace() preempt_disable_notrace()
static inline void rcu_read_lock_sched(void)
{
	preempt_disable();
}
static inline void rcu_read_lock_sched_notrace(void)
{
	preempt_disable_notrace();
}

/*
 * rcu_read_unlock_sched - marks the end of a RCU-classic critical section
 *
 * See rcu_read_lock_sched for more information.
 */
#define rcu_read_unlock_sched() preempt_enable()
#define rcu_read_unlock_sched_notrace() preempt_enable_notrace()

static inline void rcu_read_unlock_sched(void)
{
	preempt_enable();
}
static inline void rcu_read_unlock_sched_notrace(void)
{
	preempt_enable_notrace();
}


/**
+2 −2
Original line number Diff line number Diff line
@@ -40,8 +40,8 @@
#include <linux/cpumask.h>
#include <linux/seqlock.h>

extern void rcu_qsctr_inc(int cpu);
static inline void rcu_bh_qsctr_inc(int cpu) { }
extern void rcu_sched_qs(int cpu);
static inline void rcu_bh_qs(int cpu) { }

/*
 * Someone might want to pass call_rcu_bh as a function pointer.
+5 −3
Original line number Diff line number Diff line
@@ -30,8 +30,8 @@
#ifndef __LINUX_RCUTREE_H
#define __LINUX_RCUTREE_H

extern void rcu_qsctr_inc(int cpu);
extern void rcu_bh_qsctr_inc(int cpu);
extern void rcu_sched_qs(int cpu);
extern void rcu_bh_qs(int cpu);

extern int rcu_pending(int cpu);
extern int rcu_needs_cpu(int cpu);
@@ -73,7 +73,8 @@ static inline void __rcu_read_unlock_bh(void)

#define __synchronize_sched() synchronize_rcu()

#define call_rcu_sched(head, func) call_rcu(head, func)
extern void call_rcu_sched(struct rcu_head *head,
			   void (*func)(struct rcu_head *rcu));

static inline void synchronize_rcu_expedited(void)
{
@@ -91,6 +92,7 @@ extern void rcu_restart_cpu(int cpu);

extern long rcu_batches_completed(void);
extern long rcu_batches_completed_bh(void);
extern long rcu_batches_completed_sched(void);

static inline void rcu_init_sched(void)
{
+4 −4
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ static DEFINE_PER_CPU_SHARED_ALIGNED(struct rcu_dyntick_sched, rcu_dyntick_sched
	.dynticks = 1,
};

void rcu_qsctr_inc(int cpu)
void rcu_sched_qs(int cpu)
{
	struct rcu_dyntick_sched *rdssp = &per_cpu(rcu_dyntick_sched, cpu);

@@ -967,12 +967,12 @@ void rcu_check_callbacks(int cpu, int user)
	 * If this CPU took its interrupt from user mode or from the
	 * idle loop, and this is not a nested interrupt, then
	 * this CPU has to have exited all prior preept-disable
	 * sections of code.  So increment the counter to note this.
	 * sections of code.  So invoke rcu_sched_qs() to note this.
	 *
	 * The memory barrier is needed to handle the case where
	 * writes from a preempt-disable section of code get reordered
	 * into schedule() by this CPU's write buffer.  So the memory
	 * barrier makes sure that the rcu_qsctr_inc() is seen by other
	 * barrier makes sure that the rcu_sched_qs() is seen by other
	 * CPUs to happen after any such write.
	 */

@@ -980,7 +980,7 @@ void rcu_check_callbacks(int cpu, int user)
	    (idle_cpu(cpu) && !in_softirq() &&
	     hardirq_count() <= (1 << HARDIRQ_SHIFT))) {
		smp_mb();	/* Guard against aggressive schedule(). */
	     	rcu_qsctr_inc(cpu);
		rcu_sched_qs(cpu);
	}

	rcu_check_mb(cpu);
Loading