Lines Matching refs:sdp
125 struct srcu_data *sdp; in init_srcu_struct_data() local
131 WARN_ON_ONCE(ARRAY_SIZE(sdp->srcu_lock_count) != in init_srcu_struct_data()
132 ARRAY_SIZE(sdp->srcu_unlock_count)); in init_srcu_struct_data()
134 sdp = per_cpu_ptr(ssp->sda, cpu); in init_srcu_struct_data()
135 spin_lock_init(&ACCESS_PRIVATE(sdp, lock)); in init_srcu_struct_data()
136 rcu_segcblist_init(&sdp->srcu_cblist); in init_srcu_struct_data()
137 sdp->srcu_cblist_invoking = false; in init_srcu_struct_data()
138 sdp->srcu_gp_seq_needed = ssp->srcu_gp_seq; in init_srcu_struct_data()
139 sdp->srcu_gp_seq_needed_exp = ssp->srcu_gp_seq; in init_srcu_struct_data()
140 sdp->mynode = NULL; in init_srcu_struct_data()
141 sdp->cpu = cpu; in init_srcu_struct_data()
142 INIT_WORK(&sdp->work, srcu_invoke_callbacks); in init_srcu_struct_data()
143 timer_setup(&sdp->delay_work, srcu_delay_timer, 0); in init_srcu_struct_data()
144 sdp->ssp = ssp; in init_srcu_struct_data()
170 struct srcu_data *sdp; in init_srcu_struct_nodes() local
219 sdp = per_cpu_ptr(ssp->sda, cpu); in init_srcu_struct_nodes()
220 sdp->mynode = &snp_first[cpu / levelspread[level]]; in init_srcu_struct_nodes()
221 for (snp = sdp->mynode; snp != NULL; snp = snp->srcu_parent) { in init_srcu_struct_nodes()
226 sdp->grpmask = 1 << (cpu - sdp->mynode->grplo); in init_srcu_struct_nodes()
358 static void spin_lock_irqsave_sdp_contention(struct srcu_data *sdp, unsigned long *flags) in spin_lock_irqsave_sdp_contention() argument
360 struct srcu_struct *ssp = sdp->ssp; in spin_lock_irqsave_sdp_contention()
362 if (spin_trylock_irqsave_rcu_node(sdp, *flags)) in spin_lock_irqsave_sdp_contention()
367 spin_lock_irqsave_rcu_node(sdp, *flags); in spin_lock_irqsave_sdp_contention()
604 struct srcu_data *sdp = per_cpu_ptr(ssp->sda, cpu); in cleanup_srcu_struct() local
606 del_timer_sync(&sdp->delay_work); in cleanup_srcu_struct()
607 flush_work(&sdp->work); in cleanup_srcu_struct()
608 if (WARN_ON(rcu_segcblist_n_cbs(&sdp->srcu_cblist))) in cleanup_srcu_struct()
662 struct srcu_data *sdp; in srcu_gp_start() local
666 sdp = per_cpu_ptr(ssp->sda, 0); in srcu_gp_start()
668 sdp = this_cpu_ptr(ssp->sda); in srcu_gp_start()
671 spin_lock_rcu_node(sdp); /* Interrupts already disabled. */ in srcu_gp_start()
672 rcu_segcblist_advance(&sdp->srcu_cblist, in srcu_gp_start()
674 (void)rcu_segcblist_accelerate(&sdp->srcu_cblist, in srcu_gp_start()
676 spin_unlock_rcu_node(sdp); /* Interrupts remain disabled. */ in srcu_gp_start()
688 struct srcu_data *sdp = container_of(t, struct srcu_data, delay_work); in srcu_delay_timer() local
690 queue_work_on(sdp->cpu, rcu_gp_wq, &sdp->work); in srcu_delay_timer()
693 static void srcu_queue_delayed_work_on(struct srcu_data *sdp, in srcu_queue_delayed_work_on() argument
697 queue_work_on(sdp->cpu, rcu_gp_wq, &sdp->work); in srcu_queue_delayed_work_on()
701 timer_reduce(&sdp->delay_work, jiffies + delay); in srcu_queue_delayed_work_on()
708 static void srcu_schedule_cbs_sdp(struct srcu_data *sdp, unsigned long delay) in srcu_schedule_cbs_sdp() argument
710 srcu_queue_delayed_work_on(sdp, delay); in srcu_schedule_cbs_sdp()
750 struct srcu_data *sdp; in srcu_gp_end() local
805 sdp = per_cpu_ptr(ssp->sda, cpu); in srcu_gp_end()
806 spin_lock_irqsave_rcu_node(sdp, flags); in srcu_gp_end()
807 if (ULONG_CMP_GE(gpseq, sdp->srcu_gp_seq_needed + 100)) in srcu_gp_end()
808 sdp->srcu_gp_seq_needed = gpseq; in srcu_gp_end()
809 if (ULONG_CMP_GE(gpseq, sdp->srcu_gp_seq_needed_exp + 100)) in srcu_gp_end()
810 sdp->srcu_gp_seq_needed_exp = gpseq; in srcu_gp_end()
811 spin_unlock_irqrestore_rcu_node(sdp, flags); in srcu_gp_end()
882 static void srcu_funnel_gp_start(struct srcu_struct *ssp, struct srcu_data *sdp, in srcu_funnel_gp_start() argument
886 int idx = rcu_seq_ctr(s) % ARRAY_SIZE(sdp->mynode->srcu_have_cbs); in srcu_funnel_gp_start()
896 snp_leaf = sdp->mynode; in srcu_funnel_gp_start()
907 snp->srcu_data_have_cbs[idx] |= sdp->grpmask; in srcu_funnel_gp_start()
910 srcu_schedule_cbs_sdp(sdp, do_norm ? SRCU_INTERVAL : 0); in srcu_funnel_gp_start()
919 snp->srcu_data_have_cbs[idx] |= sdp->grpmask; in srcu_funnel_gp_start()
1032 struct srcu_data *sdp; in srcu_might_be_idle() local
1038 sdp = raw_cpu_ptr(ssp->sda); in srcu_might_be_idle()
1039 spin_lock_irqsave_rcu_node(sdp, flags); in srcu_might_be_idle()
1040 if (rcu_segcblist_pend_cbs(&sdp->srcu_cblist)) { in srcu_might_be_idle()
1041 spin_unlock_irqrestore_rcu_node(sdp, flags); in srcu_might_be_idle()
1044 spin_unlock_irqrestore_rcu_node(sdp, flags); in srcu_might_be_idle()
1088 struct srcu_data *sdp; in srcu_gp_start_if_needed() local
1096 sdp = per_cpu_ptr(ssp->sda, 0); in srcu_gp_start_if_needed()
1098 sdp = raw_cpu_ptr(ssp->sda); in srcu_gp_start_if_needed()
1099 spin_lock_irqsave_sdp_contention(sdp, &flags); in srcu_gp_start_if_needed()
1101 rcu_segcblist_enqueue(&sdp->srcu_cblist, rhp); in srcu_gp_start_if_needed()
1102 rcu_segcblist_advance(&sdp->srcu_cblist, in srcu_gp_start_if_needed()
1105 (void)rcu_segcblist_accelerate(&sdp->srcu_cblist, s); in srcu_gp_start_if_needed()
1106 if (ULONG_CMP_LT(sdp->srcu_gp_seq_needed, s)) { in srcu_gp_start_if_needed()
1107 sdp->srcu_gp_seq_needed = s; in srcu_gp_start_if_needed()
1110 if (!do_norm && ULONG_CMP_LT(sdp->srcu_gp_seq_needed_exp, s)) { in srcu_gp_start_if_needed()
1111 sdp->srcu_gp_seq_needed_exp = s; in srcu_gp_start_if_needed()
1114 spin_unlock_irqrestore_rcu_node(sdp, flags); in srcu_gp_start_if_needed()
1120 sdp_mynode = sdp->mynode; in srcu_gp_start_if_needed()
1123 srcu_funnel_gp_start(ssp, sdp, s, do_norm); in srcu_gp_start_if_needed()
1376 struct srcu_data *sdp; in srcu_barrier_cb() local
1379 sdp = container_of(rhp, struct srcu_data, srcu_barrier_head); in srcu_barrier_cb()
1380 ssp = sdp->ssp; in srcu_barrier_cb()
1393 static void srcu_barrier_one_cpu(struct srcu_struct *ssp, struct srcu_data *sdp) in srcu_barrier_one_cpu() argument
1395 spin_lock_irq_rcu_node(sdp); in srcu_barrier_one_cpu()
1397 sdp->srcu_barrier_head.func = srcu_barrier_cb; in srcu_barrier_one_cpu()
1398 debug_rcu_head_queue(&sdp->srcu_barrier_head); in srcu_barrier_one_cpu()
1399 if (!rcu_segcblist_entrain(&sdp->srcu_cblist, in srcu_barrier_one_cpu()
1400 &sdp->srcu_barrier_head)) { in srcu_barrier_one_cpu()
1401 debug_rcu_head_unqueue(&sdp->srcu_barrier_head); in srcu_barrier_one_cpu()
1404 spin_unlock_irq_rcu_node(sdp); in srcu_barrier_one_cpu()
1542 struct srcu_data *sdp; in srcu_invoke_callbacks() local
1545 sdp = container_of(work, struct srcu_data, work); in srcu_invoke_callbacks()
1547 ssp = sdp->ssp; in srcu_invoke_callbacks()
1549 spin_lock_irq_rcu_node(sdp); in srcu_invoke_callbacks()
1550 rcu_segcblist_advance(&sdp->srcu_cblist, in srcu_invoke_callbacks()
1552 if (sdp->srcu_cblist_invoking || in srcu_invoke_callbacks()
1553 !rcu_segcblist_ready_cbs(&sdp->srcu_cblist)) { in srcu_invoke_callbacks()
1554 spin_unlock_irq_rcu_node(sdp); in srcu_invoke_callbacks()
1559 sdp->srcu_cblist_invoking = true; in srcu_invoke_callbacks()
1560 rcu_segcblist_extract_done_cbs(&sdp->srcu_cblist, &ready_cbs); in srcu_invoke_callbacks()
1562 spin_unlock_irq_rcu_node(sdp); in srcu_invoke_callbacks()
1576 spin_lock_irq_rcu_node(sdp); in srcu_invoke_callbacks()
1577 rcu_segcblist_add_len(&sdp->srcu_cblist, -len); in srcu_invoke_callbacks()
1578 (void)rcu_segcblist_accelerate(&sdp->srcu_cblist, in srcu_invoke_callbacks()
1580 sdp->srcu_cblist_invoking = false; in srcu_invoke_callbacks()
1581 more = rcu_segcblist_ready_cbs(&sdp->srcu_cblist); in srcu_invoke_callbacks()
1582 spin_unlock_irq_rcu_node(sdp); in srcu_invoke_callbacks()
1584 srcu_schedule_cbs_sdp(sdp, 0); in srcu_invoke_callbacks()
1687 struct srcu_data *sdp; in srcu_torture_stats_print() local
1689 sdp = per_cpu_ptr(ssp->sda, cpu); in srcu_torture_stats_print()
1690 u0 = data_race(sdp->srcu_unlock_count[!idx]); in srcu_torture_stats_print()
1691 u1 = data_race(sdp->srcu_unlock_count[idx]); in srcu_torture_stats_print()
1699 l0 = data_race(sdp->srcu_lock_count[!idx]); in srcu_torture_stats_print()
1700 l1 = data_race(sdp->srcu_lock_count[idx]); in srcu_torture_stats_print()
1706 "C."[rcu_segcblist_empty(&sdp->srcu_cblist)]); in srcu_torture_stats_print()