函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\rcu\srcutree.c Create Date:2022-07-27 11:19:01
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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

函数原型:static void srcu_gp_end(struct srcu_struct *ssp)

返回类型:void

参数:

类型参数名称
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  如果ULONG_CMP_LT(srcu_gp_seq_needed_exp, gpseq)则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  如果last_lvlcbs等于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  如果ULONG_CMP_LT(srcu_gp_seq_needed_exp, gpseq)则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  如果cbsSchedule 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  如果非gpseq按位与Overflow-check frequency. N bits roughly says every 2**N grace periods. 的值且last_lvl则以cpu小于等于grphi循环
563  sdp等于per_cpu_ptr(sda, cpu)
564  spin_lock_irqsave_rcu_node(sdp, flags)
565  如果ULONG_CMP_GE(gpseq, srcu_gp_seq_needed + 100)则srcu_gp_seq_needed等于gpseq
568  如果ULONG_CMP_GE(gpseq, srcu_gp_seq_needed_exp + 100)则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  如果非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)则
583  Start an SRCU grace period.
584  spin_unlock_irq_rcu_node(ssp)
585  srcu_reschedule(ssp, 0)
586  否则
587  spin_unlock_irq_rcu_node(ssp)
调用者
名称描述
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.