Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\rcu\srcutree.c Create Date:2022-07-28 10:18:40
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Note the end of an SRCU grace period. Initiates callback invocation* and starts a new grace period if needed.* The ->srcu_cb_mutex acquisition does not protect any data, but* instead prevents more than one grace period from starting while we

Proto:static void srcu_gp_end(struct srcu_struct *ssp)

Type:void

Parameter:

TypeParameterName
struct srcu_struct *ssp
526  mutex_lock( & srcu_cb_mutex)
529  spin_lock_irq_rcu_node(ssp)
530  idx = Return the state portion of a sequence number previously returned* by rcu_seq_snap() or rcu_seq_current().
531  WARN_ON_ONCE(idx != SRCU_STATE_SCAN2)
532  cbdelay = Return grace-period delay, zero if there are expedited grace* periods pending, SRCU_INTERVAL otherwise.
533  WRITE_ONCE(srcu_last_gp_end, ktime_get_mono_fast_ns())
534  Adjust sequence number for end of update-side operation.
535  gpseq = Return the current value the update side's sequence number, no ordering.
536  If ULONG_CMP_LT(srcu_gp_seq_needed_exp, gpseq) Then srcu_gp_seq_needed_exp = gpseq
538  spin_unlock_irq_rcu_node(ssp)
539  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
543  idx = Return the counter portion of a sequence number previously returned* by rcu_seq_snap() or rcu_seq_current(). % ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(srcu_have_cbs)
545  spin_lock_irq_rcu_node(snp)
546  cbs = false
547  last_lvl = snp >= level[rcu_num_lvls - 1]
548  If last_lvl Then cbs = srcu_have_cbs[idx] == gpseq
550  srcu_have_cbs[idx] = gpseq
551  Set the state portion of the pointed-to sequence number.* The caller is responsible for preventing conflicting updates.
552  If ULONG_CMP_LT(srcu_gp_seq_needed_exp, gpseq) Then srcu_gp_seq_needed_exp = gpseq
554  mask = srcu_data_have_cbs[idx]
555  srcu_data_have_cbs[idx] = 0
556  spin_unlock_irq_rcu_node(snp)
557  If cbs Then Schedule callback invocation for all srcu_data structures associated* with the specified srcu_node structure that have callbacks for the* just-completed grace period, the one corresponding to idx. If possible,
561  If Not (gpseq & Overflow-check frequency. N bits roughly says every 2**N grace periods. ) && last_lvl Then When cpu <= grphi cycle
563  sdp = per_cpu_ptr(sda, cpu)
564  spin_lock_irqsave_rcu_node(sdp, flags)
565  If ULONG_CMP_GE(gpseq, srcu_gp_seq_needed + 100) Then srcu_gp_seq_needed = gpseq
568  If ULONG_CMP_GE(gpseq, srcu_gp_seq_needed_exp + 100) Then srcu_gp_seq_needed_exp = gpseq
571  spin_unlock_irqrestore_rcu_node(sdp, flags)
576  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
579  spin_lock_irq_rcu_node(ssp)
580  gpseq = Return the current value the update side's sequence number, no ordering.
581  If Not Return the state portion of a sequence number previously returned* by rcu_seq_snap() or rcu_seq_current(). && ULONG_CMP_LT(gpseq, srcu_gp_seq_needed) Then
583  Start an SRCU grace period.
584  spin_unlock_irq_rcu_node(ssp)
585  srcu_reschedule(ssp, 0)
586  Else
587  spin_unlock_irq_rcu_node(ssp)
Caller
NameDescribe
srcu_advance_stateCore SRCU state machine. Push state bits of ->srcu_gp_seq* to SRCU_STATE_SCAN2, and invoke srcu_gp_end() when scan has* completed in that state.