Skip to content

Commit

Permalink
rcu: Check for have_rcu_nocb_mask instead of rcu_nocb_mask
Browse files Browse the repository at this point in the history
If we configure a kernel with CONFIG_NOCB_CPU=y, CONFIG_RCU_NOCB_CPU_NONE=y and
CONFIG_CPUMASK_OFFSTACK=n and do not pass in a rcu_nocb= boot parameter, the
cpumask rcu_nocb_mask can be garbage instead of NULL.

Hence this commit replaces checks for rcu_nocb_mask == NULL with a check for
have_rcu_nocb_mask.

Signed-off-by: Pranith Kumar <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>
Tested-by: Paul Gortmaker <[email protected]>
  • Loading branch information
pranith authored and paulmck committed Sep 16, 2014
1 parent 35ce7f2 commit 22c2f66
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kernel/rcu/tree_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -2578,7 +2578,7 @@ static void __init rcu_organize_nocb_kthreads(struct rcu_state *rsp)
struct rcu_data *rdp_leader = NULL; /* Suppress misguided gcc warn. */
struct rcu_data *rdp_prev = NULL;

if (rcu_nocb_mask == NULL)
if (!have_rcu_nocb_mask)
return;
if (ls == -1) {
ls = int_sqrt(nr_cpu_ids);
Expand Down Expand Up @@ -2608,9 +2608,9 @@ static void __init rcu_organize_nocb_kthreads(struct rcu_state *rsp)
/* Prevent __call_rcu() from enqueuing callbacks on no-CBs CPUs */
static bool init_nocb_callback_list(struct rcu_data *rdp)
{
if (rcu_nocb_mask == NULL ||
!cpumask_test_cpu(rdp->cpu, rcu_nocb_mask))
if (!rcu_is_nocb_cpu(rdp->cpu))
return false;

rdp->nxttail[RCU_NEXT_TAIL] = NULL;
return true;
}
Expand Down

0 comments on commit 22c2f66

Please sign in to comment.