• Home
  • Raw
  • Download

Lines Matching refs:idx

412 static unsigned long srcu_readers_lock_idx(struct srcu_struct *ssp, int idx)  in srcu_readers_lock_idx()  argument
420 sum += READ_ONCE(cpuc->srcu_lock_count[idx]); in srcu_readers_lock_idx()
429 static unsigned long srcu_readers_unlock_idx(struct srcu_struct *ssp, int idx) in srcu_readers_unlock_idx() argument
437 sum += READ_ONCE(cpuc->srcu_unlock_count[idx]); in srcu_readers_unlock_idx()
446 static bool srcu_readers_active_idx_check(struct srcu_struct *ssp, int idx) in srcu_readers_active_idx_check() argument
450 unlocks = srcu_readers_unlock_idx(ssp, idx); in srcu_readers_active_idx_check()
486 return srcu_readers_lock_idx(ssp, idx) == unlocks; in srcu_readers_active_idx_check()
636 int idx; in __srcu_read_lock() local
638 idx = READ_ONCE(ssp->srcu_idx) & 0x1; in __srcu_read_lock()
639 this_cpu_inc(ssp->sda->srcu_lock_count[idx]); in __srcu_read_lock()
641 return idx; in __srcu_read_lock()
650 void __srcu_read_unlock(struct srcu_struct *ssp, int idx) in __srcu_read_unlock() argument
653 this_cpu_inc(ssp->sda->srcu_unlock_count[idx]); in __srcu_read_unlock()
748 int idx; in srcu_gp_end() local
760 idx = rcu_seq_state(ssp->srcu_gp_seq); in srcu_gp_end()
761 WARN_ON_ONCE(idx != SRCU_STATE_SCAN2); in srcu_gp_end()
780 idx = rcu_seq_ctr(gpseq) % ARRAY_SIZE(snp->srcu_have_cbs); in srcu_gp_end()
786 cbs = ss_state < SRCU_SIZE_BIG || snp->srcu_have_cbs[idx] == gpseq; in srcu_gp_end()
787 snp->srcu_have_cbs[idx] = gpseq; in srcu_gp_end()
788 rcu_seq_set_state(&snp->srcu_have_cbs[idx], 1); in srcu_gp_end()
795 mask = snp->srcu_data_have_cbs[idx]; in srcu_gp_end()
796 snp->srcu_data_have_cbs[idx] = 0; in srcu_gp_end()
887 int idx = rcu_seq_ctr(s) % ARRAY_SIZE(sdp->mynode->srcu_have_cbs); in srcu_funnel_gp_start() local
905 snp_seq = snp->srcu_have_cbs[idx]; in srcu_funnel_gp_start()
908 snp->srcu_data_have_cbs[idx] |= sdp->grpmask; in srcu_funnel_gp_start()
918 snp->srcu_have_cbs[idx] = s; in srcu_funnel_gp_start()
920 snp->srcu_data_have_cbs[idx] |= sdp->grpmask; in srcu_funnel_gp_start()
964 static bool try_check_zero(struct srcu_struct *ssp, int idx, int trycount) in try_check_zero() argument
971 if (srcu_readers_active_idx_check(ssp, idx)) in try_check_zero()
1085 int idx; in srcu_gp_start_if_needed() local
1094 idx = srcu_read_lock(ssp); in srcu_gp_start_if_needed()
1154 srcu_read_unlock(ssp, idx); in srcu_gp_start_if_needed()
1442 int idx; in srcu_barrier() local
1458 idx = srcu_read_lock(ssp); in srcu_barrier()
1464 srcu_read_unlock(ssp, idx); in srcu_barrier()
1496 int idx; in srcu_advance_state() local
1510 idx = rcu_seq_state(smp_load_acquire(&ssp->srcu_gp_seq)); /* ^^^ */ in srcu_advance_state()
1511 if (idx == SRCU_STATE_IDLE) { in srcu_advance_state()
1519 idx = rcu_seq_state(READ_ONCE(ssp->srcu_gp_seq)); in srcu_advance_state()
1520 if (idx == SRCU_STATE_IDLE) in srcu_advance_state()
1523 if (idx != SRCU_STATE_IDLE) { in srcu_advance_state()
1530 idx = 1 ^ (ssp->srcu_idx & 1); in srcu_advance_state()
1531 if (!try_check_zero(ssp, idx, 1)) { in srcu_advance_state()
1548 idx = 1 ^ (ssp->srcu_idx & 1); in srcu_advance_state()
1549 if (!try_check_zero(ssp, idx, 2)) { in srcu_advance_state()
1695 int idx; in srcu_torture_stats_print() local
1700 idx = ssp->srcu_idx & 0x1; in srcu_torture_stats_print()
1710 pr_cont(" per-CPU(idx=%d):", idx); in srcu_torture_stats_print()
1718 u0 = data_race(sdp->srcu_unlock_count[!idx]); in srcu_torture_stats_print()
1719 u1 = data_race(sdp->srcu_unlock_count[idx]); in srcu_torture_stats_print()
1727 l0 = data_race(sdp->srcu_lock_count[!idx]); in srcu_torture_stats_print()
1728 l1 = data_race(sdp->srcu_lock_count[idx]); in srcu_torture_stats_print()