Skip to content

Commit

Permalink
rcu, debug: detect stalled grace periods, cleanups
Browse files Browse the repository at this point in the history
small cleanups.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Ingo Molnar committed Aug 11, 2008
1 parent 67182ae commit 78635fc
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions kernel/rcuclassic.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ static inline void record_gp_check_time(struct rcu_ctrlblk *rcp)
{
rcp->gp_check = get_seconds() + 3;
}

static void print_other_cpu_stall(struct rcu_ctrlblk *rcp)
{
int cpu;
Expand All @@ -303,11 +304,9 @@ static void print_other_cpu_stall(struct rcu_ctrlblk *rcp)

spin_lock(&rcp->lock);
delta = get_seconds() - rcp->gp_check;
if (delta < 2L ||
cpus_empty(rcp->cpumask)) {
if (delta < 2L || cpus_empty(rcp->cpumask)) {
spin_unlock(&rcp->lock);
return;
rcp->gp_check = get_seconds() + 30;
}
spin_unlock(&rcp->lock);

Expand All @@ -319,6 +318,7 @@ static void print_other_cpu_stall(struct rcu_ctrlblk *rcp)
printk(" (detected by %d, t=%lu/%lu)\n",
smp_processor_id(), get_seconds(), rcp->gp_check);
}

static void print_cpu_stall(struct rcu_ctrlblk *rcp)
{
printk(KERN_ERR "RCU detected CPU %d stall (t=%lu/%lu)\n",
Expand All @@ -329,8 +329,8 @@ static void print_cpu_stall(struct rcu_ctrlblk *rcp)
rcp->gp_check = get_seconds() + 30;
spin_unlock(&rcp->lock);
}
static inline void check_cpu_stall(struct rcu_ctrlblk *rcp,
struct rcu_data *rdp)

static void check_cpu_stall(struct rcu_ctrlblk *rcp, struct rcu_data *rdp)
{
long delta;

Expand All @@ -341,12 +341,11 @@ static inline void check_cpu_stall(struct rcu_ctrlblk *rcp,

print_cpu_stall(rcp);

} else if (!cpus_empty(rcp->cpumask) && delta >= 2L) {

/* They had two seconds to dump stack, so complain. */

print_other_cpu_stall(rcp);

} else {
if (!cpus_empty(rcp->cpumask) && delta >= 2L) {
/* They had two seconds to dump stack, so complain. */
print_other_cpu_stall(rcp);
}
}
}

Expand All @@ -355,8 +354,9 @@ static inline void check_cpu_stall(struct rcu_ctrlblk *rcp,
static inline void record_gp_check_time(struct rcu_ctrlblk *rcp)
{
}
static inline void check_cpu_stall(struct rcu_ctrlblk *rcp,
struct rcu_data *rdp)

static inline void
check_cpu_stall(struct rcu_ctrlblk *rcp, struct rcu_data *rdp)
{
}

Expand Down

0 comments on commit 78635fc

Please sign in to comment.