rcu: ->signaled better named ->fqs_state
The ->signaled field was named before complications in the form of dyntick-idle mode and offlined CPUs. These complications have required that force_quiescent_state() be implemented as a state machine, instead of simply unconditionally sending reschedule IPIs. Therefore, this commit renames ->signaled to ->fqs_state to catch up with the new force_quiescent_state() reality. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
This commit is contained in:
@@ -69,7 +69,7 @@ static struct lock_class_key rcu_node_class[NUM_RCU_LVLS];
|
|||||||
NUM_RCU_LVL_3, \
|
NUM_RCU_LVL_3, \
|
||||||
NUM_RCU_LVL_4, /* == MAX_RCU_LVLS */ \
|
NUM_RCU_LVL_4, /* == MAX_RCU_LVLS */ \
|
||||||
}, \
|
}, \
|
||||||
.signaled = RCU_GP_IDLE, \
|
.fqs_state = RCU_GP_IDLE, \
|
||||||
.gpnum = -300, \
|
.gpnum = -300, \
|
||||||
.completed = -300, \
|
.completed = -300, \
|
||||||
.onofflock = __RAW_SPIN_LOCK_UNLOCKED(&structname##_state.onofflock), \
|
.onofflock = __RAW_SPIN_LOCK_UNLOCKED(&structname##_state.onofflock), \
|
||||||
@@ -866,8 +866,8 @@ rcu_start_gp(struct rcu_state *rsp, unsigned long flags)
|
|||||||
/* Advance to a new grace period and initialize state. */
|
/* Advance to a new grace period and initialize state. */
|
||||||
rsp->gpnum++;
|
rsp->gpnum++;
|
||||||
trace_rcu_grace_period(rsp->name, rsp->gpnum, "start");
|
trace_rcu_grace_period(rsp->name, rsp->gpnum, "start");
|
||||||
WARN_ON_ONCE(rsp->signaled == RCU_GP_INIT);
|
WARN_ON_ONCE(rsp->fqs_state == RCU_GP_INIT);
|
||||||
rsp->signaled = RCU_GP_INIT; /* Hold off force_quiescent_state. */
|
rsp->fqs_state = RCU_GP_INIT; /* Hold off force_quiescent_state. */
|
||||||
rsp->jiffies_force_qs = jiffies + RCU_JIFFIES_TILL_FORCE_QS;
|
rsp->jiffies_force_qs = jiffies + RCU_JIFFIES_TILL_FORCE_QS;
|
||||||
record_gp_stall_check_time(rsp);
|
record_gp_stall_check_time(rsp);
|
||||||
|
|
||||||
@@ -877,7 +877,7 @@ rcu_start_gp(struct rcu_state *rsp, unsigned long flags)
|
|||||||
rnp->qsmask = rnp->qsmaskinit;
|
rnp->qsmask = rnp->qsmaskinit;
|
||||||
rnp->gpnum = rsp->gpnum;
|
rnp->gpnum = rsp->gpnum;
|
||||||
rnp->completed = rsp->completed;
|
rnp->completed = rsp->completed;
|
||||||
rsp->signaled = RCU_SIGNAL_INIT; /* force_quiescent_state OK. */
|
rsp->fqs_state = RCU_SIGNAL_INIT; /* force_quiescent_state OK */
|
||||||
rcu_start_gp_per_cpu(rsp, rnp, rdp);
|
rcu_start_gp_per_cpu(rsp, rnp, rdp);
|
||||||
rcu_preempt_boost_start_gp(rnp);
|
rcu_preempt_boost_start_gp(rnp);
|
||||||
trace_rcu_grace_period_init(rsp->name, rnp->gpnum,
|
trace_rcu_grace_period_init(rsp->name, rnp->gpnum,
|
||||||
@@ -927,7 +927,7 @@ rcu_start_gp(struct rcu_state *rsp, unsigned long flags)
|
|||||||
|
|
||||||
rnp = rcu_get_root(rsp);
|
rnp = rcu_get_root(rsp);
|
||||||
raw_spin_lock(&rnp->lock); /* irqs already disabled. */
|
raw_spin_lock(&rnp->lock); /* irqs already disabled. */
|
||||||
rsp->signaled = RCU_SIGNAL_INIT; /* force_quiescent_state now OK. */
|
rsp->fqs_state = RCU_SIGNAL_INIT; /* force_quiescent_state now OK. */
|
||||||
raw_spin_unlock(&rnp->lock); /* irqs remain disabled. */
|
raw_spin_unlock(&rnp->lock); /* irqs remain disabled. */
|
||||||
raw_spin_unlock_irqrestore(&rsp->onofflock, flags);
|
raw_spin_unlock_irqrestore(&rsp->onofflock, flags);
|
||||||
}
|
}
|
||||||
@@ -991,7 +991,7 @@ static void rcu_report_qs_rsp(struct rcu_state *rsp, unsigned long flags)
|
|||||||
|
|
||||||
rsp->completed = rsp->gpnum; /* Declare the grace period complete. */
|
rsp->completed = rsp->gpnum; /* Declare the grace period complete. */
|
||||||
trace_rcu_grace_period(rsp->name, rsp->completed, "end");
|
trace_rcu_grace_period(rsp->name, rsp->completed, "end");
|
||||||
rsp->signaled = RCU_GP_IDLE;
|
rsp->fqs_state = RCU_GP_IDLE;
|
||||||
rcu_start_gp(rsp, flags); /* releases root node's rnp->lock. */
|
rcu_start_gp(rsp, flags); /* releases root node's rnp->lock. */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1457,7 +1457,7 @@ static void force_quiescent_state(struct rcu_state *rsp, int relaxed)
|
|||||||
goto unlock_fqs_ret; /* no GP in progress, time updated. */
|
goto unlock_fqs_ret; /* no GP in progress, time updated. */
|
||||||
}
|
}
|
||||||
rsp->fqs_active = 1;
|
rsp->fqs_active = 1;
|
||||||
switch (rsp->signaled) {
|
switch (rsp->fqs_state) {
|
||||||
case RCU_GP_IDLE:
|
case RCU_GP_IDLE:
|
||||||
case RCU_GP_INIT:
|
case RCU_GP_INIT:
|
||||||
|
|
||||||
@@ -1473,7 +1473,7 @@ static void force_quiescent_state(struct rcu_state *rsp, int relaxed)
|
|||||||
force_qs_rnp(rsp, dyntick_save_progress_counter);
|
force_qs_rnp(rsp, dyntick_save_progress_counter);
|
||||||
raw_spin_lock(&rnp->lock); /* irqs already disabled */
|
raw_spin_lock(&rnp->lock); /* irqs already disabled */
|
||||||
if (rcu_gp_in_progress(rsp))
|
if (rcu_gp_in_progress(rsp))
|
||||||
rsp->signaled = RCU_FORCE_QS;
|
rsp->fqs_state = RCU_FORCE_QS;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RCU_FORCE_QS:
|
case RCU_FORCE_QS:
|
||||||
|
@@ -302,7 +302,7 @@ struct rcu_data {
|
|||||||
struct rcu_state *rsp;
|
struct rcu_state *rsp;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Values for signaled field in struct rcu_state. */
|
/* Values for fqs_state field in struct rcu_state. */
|
||||||
#define RCU_GP_IDLE 0 /* No grace period in progress. */
|
#define RCU_GP_IDLE 0 /* No grace period in progress. */
|
||||||
#define RCU_GP_INIT 1 /* Grace period being initialized. */
|
#define RCU_GP_INIT 1 /* Grace period being initialized. */
|
||||||
#define RCU_SAVE_DYNTICK 2 /* Need to scan dyntick state. */
|
#define RCU_SAVE_DYNTICK 2 /* Need to scan dyntick state. */
|
||||||
@@ -361,7 +361,7 @@ struct rcu_state {
|
|||||||
|
|
||||||
/* The following fields are guarded by the root rcu_node's lock. */
|
/* The following fields are guarded by the root rcu_node's lock. */
|
||||||
|
|
||||||
u8 signaled ____cacheline_internodealigned_in_smp;
|
u8 fqs_state ____cacheline_internodealigned_in_smp;
|
||||||
/* Force QS state. */
|
/* Force QS state. */
|
||||||
u8 fqs_active; /* force_quiescent_state() */
|
u8 fqs_active; /* force_quiescent_state() */
|
||||||
/* is running. */
|
/* is running. */
|
||||||
|
@@ -278,7 +278,7 @@ static void print_one_rcu_state(struct seq_file *m, struct rcu_state *rsp)
|
|||||||
gpnum = rsp->gpnum;
|
gpnum = rsp->gpnum;
|
||||||
seq_printf(m, "c=%lu g=%lu s=%d jfq=%ld j=%x "
|
seq_printf(m, "c=%lu g=%lu s=%d jfq=%ld j=%x "
|
||||||
"nfqs=%lu/nfqsng=%lu(%lu) fqlh=%lu\n",
|
"nfqs=%lu/nfqsng=%lu(%lu) fqlh=%lu\n",
|
||||||
rsp->completed, gpnum, rsp->signaled,
|
rsp->completed, gpnum, rsp->fqs_state,
|
||||||
(long)(rsp->jiffies_force_qs - jiffies),
|
(long)(rsp->jiffies_force_qs - jiffies),
|
||||||
(int)(jiffies & 0xffff),
|
(int)(jiffies & 0xffff),
|
||||||
rsp->n_force_qs, rsp->n_force_qs_ngp,
|
rsp->n_force_qs, rsp->n_force_qs_ngp,
|
||||||
|
Reference in New Issue
Block a user