diff options
| -rw-r--r-- | kernel/rcutree.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c index dc8c5284fe06..81e0394e46af 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c | |||
| @@ -937,6 +937,18 @@ check_for_new_grace_period(struct rcu_state *rsp, struct rcu_data *rdp) | |||
| 937 | } | 937 | } |
| 938 | 938 | ||
| 939 | /* | 939 | /* |
| 940 | * Initialize the specified rcu_data structure's callback list to empty. | ||
| 941 | */ | ||
| 942 | static void init_callback_list(struct rcu_data *rdp) | ||
| 943 | { | ||
| 944 | int i; | ||
| 945 | |||
| 946 | rdp->nxtlist = NULL; | ||
| 947 | for (i = 0; i < RCU_NEXT_SIZE; i++) | ||
| 948 | rdp->nxttail[i] = &rdp->nxtlist; | ||
| 949 | } | ||
| 950 | |||
| 951 | /* | ||
| 940 | * Advance this CPU's callbacks, but only if the current grace period | 952 | * Advance this CPU's callbacks, but only if the current grace period |
| 941 | * has ended. This may be called only from the CPU to whom the rdp | 953 | * has ended. This may be called only from the CPU to whom the rdp |
| 942 | * belongs. In addition, the corresponding leaf rcu_node structure's | 954 | * belongs. In addition, the corresponding leaf rcu_node structure's |
| @@ -1328,8 +1340,6 @@ static void | |||
| 1328 | rcu_send_cbs_to_orphanage(int cpu, struct rcu_state *rsp, | 1340 | rcu_send_cbs_to_orphanage(int cpu, struct rcu_state *rsp, |
| 1329 | struct rcu_node *rnp, struct rcu_data *rdp) | 1341 | struct rcu_node *rnp, struct rcu_data *rdp) |
| 1330 | { | 1342 | { |
| 1331 | int i; | ||
| 1332 | |||
| 1333 | /* | 1343 | /* |
| 1334 | * Orphan the callbacks. First adjust the counts. This is safe | 1344 | * Orphan the callbacks. First adjust the counts. This is safe |
| 1335 | * because ->onofflock excludes _rcu_barrier()'s adoption of | 1345 | * because ->onofflock excludes _rcu_barrier()'s adoption of |
| @@ -1369,9 +1379,7 @@ rcu_send_cbs_to_orphanage(int cpu, struct rcu_state *rsp, | |||
| 1369 | } | 1379 | } |
| 1370 | 1380 | ||
| 1371 | /* Finally, initialize the rcu_data structure's list to empty. */ | 1381 | /* Finally, initialize the rcu_data structure's list to empty. */ |
| 1372 | rdp->nxtlist = NULL; | 1382 | init_callback_list(rdp); |
| 1373 | for (i = 0; i < RCU_NEXT_SIZE; i++) | ||
| 1374 | rdp->nxttail[i] = &rdp->nxtlist; | ||
| 1375 | } | 1383 | } |
| 1376 | 1384 | ||
| 1377 | /* | 1385 | /* |
| @@ -2407,16 +2415,13 @@ static void __init | |||
| 2407 | rcu_boot_init_percpu_data(int cpu, struct rcu_state *rsp) | 2415 | rcu_boot_init_percpu_data(int cpu, struct rcu_state *rsp) |
| 2408 | { | 2416 | { |
| 2409 | unsigned long flags; | 2417 | unsigned long flags; |
| 2410 | int i; | ||
| 2411 | struct rcu_data *rdp = per_cpu_ptr(rsp->rda, cpu); | 2418 | struct rcu_data *rdp = per_cpu_ptr(rsp->rda, cpu); |
| 2412 | struct rcu_node *rnp = rcu_get_root(rsp); | 2419 | struct rcu_node *rnp = rcu_get_root(rsp); |
| 2413 | 2420 | ||
| 2414 | /* Set up local state, ensuring consistent view of global state. */ | 2421 | /* Set up local state, ensuring consistent view of global state. */ |
| 2415 | raw_spin_lock_irqsave(&rnp->lock, flags); | 2422 | raw_spin_lock_irqsave(&rnp->lock, flags); |
| 2416 | rdp->grpmask = 1UL << (cpu - rdp->mynode->grplo); | 2423 | rdp->grpmask = 1UL << (cpu - rdp->mynode->grplo); |
| 2417 | rdp->nxtlist = NULL; | 2424 | init_callback_list(rdp); |
| 2418 | for (i = 0; i < RCU_NEXT_SIZE; i++) | ||
| 2419 | rdp->nxttail[i] = &rdp->nxtlist; | ||
| 2420 | rdp->qlen_lazy = 0; | 2425 | rdp->qlen_lazy = 0; |
| 2421 | rdp->qlen = 0; | 2426 | rdp->qlen = 0; |
| 2422 | rdp->dynticks = &per_cpu(rcu_dynticks, cpu); | 2427 | rdp->dynticks = &per_cpu(rcu_dynticks, cpu); |
