Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Initialize a new grace period. Return false if no grace period required.

Proto:static bool rcu_gp_init(void)

Type:bool

Parameter:Nothing

1472  rnp = Return the root node of the rcu_state structure.
1474  WRITE_ONCE(Time of last GP kthread , jiffies)
1475  raw_spin_lock_irq_rcu_node(rnp)
1476  If Not READ_ONCE(Commands for GP task. ) Then
1478  raw_spin_unlock_irq_rcu_node(rnp)
1479  Return false
1481  WRITE_ONCE(Commands for GP task. , 0)
1483  If WARN_ON_ONCE(Return true if an RCU grace period is in progress. The READ_ONCE()s* permit this function to be invoked without holding the root rcu_node* structure's ->lock, but of course results can be subject to change.) Then
1488  raw_spin_unlock_irq_rcu_node(rnp)
1489  Return false
1493  Forward declarations for tree_stall.h
1495  Adjust sequence number for start of update-side operation.
1496  trace_rcu_grace_period(Name of structure. , Grace-period sequence #. , Strings used in tracepoints need to be exported via the* tracing system such that tools like perf and trace-cmd can* translate the string address pointers to actual text.("start"))
1497  raw_spin_unlock_irq_rcu_node(rnp)
1505  GP kthread sleep state. = Grace-period initialization hotplug.
1507  raw_spin_lock( & ofl_lock)
1508  raw_spin_lock_irq_rcu_node(rnp)
1509  If qsmaskinit == ginning of each grace period. && Not Necessary to wait for blocked tasks to Then
1512  raw_spin_unlock_irq_rcu_node(rnp)
1513  raw_spin_unlock( & ofl_lock)
1514  Continue
1518  oldmask = qsmaskinit
1519  qsmaskinit = ginning of each grace period.
1522  If Not oldmask != Not qsmaskinit Then
1523  If Not oldmask Then
1526  Else if rcu_preempt_has_tasks(rnp) Then
1528  Else
1541  If Necessary to wait for blocked tasks to && ( Not rcu_preempt_has_tasks(rnp) || qsmaskinit) Then
1543  Necessary to wait for blocked tasks to = false
1544  If Not qsmaskinit Then rcu_cleanup_dead_rnp(rnp)
1548  raw_spin_unlock_irq_rcu_node(rnp)
1549  raw_spin_unlock( & ofl_lock)
1551  rcu_gp_slow(Delay in jiffies for grace-period initialization delays, debug only. )
1565  GP kthread sleep state. = Grace-period initialization.
1566  rcu_for_each_node_breadth_first(rnp)
1567  rcu_gp_slow(gp_init_delay)
1568  raw_spin_lock_irqsave_rcu_node(rnp, flags)
1569  rdp = this_cpu_ptr( & rcu_data)
1570  rcu_preempt_check_blocked_tasks(rnp)
1571  CPUs or groups that need to switch in = qsmaskinit
1572  WRITE_ONCE(Track rsp->rcu_gp_seq. , Grace-period sequence #. )
1573  If rnp == This CPU's leaf of hierarchy Then Update CPU-local rcu_data state to record the beginnings and ends of* grace periods. The caller must hold the ->lock of the leaf rcu_node* structure corresponding to the current CPU, and must have irqs disabled.
1575  rcu_preempt_boost_start_gp(rnp)
1576  trace_rcu_grace_period_init(Name of structure. , Track rsp->rcu_gp_seq. , is at level 0. , lowest-numbered CPU or group here. , highest-numbered CPU or group here. , CPUs or groups that need to switch in )
1580  mask = CPUs or groups that need to switch in & ~ginning of each grace period.
1581  Mask of offline CPUs at GP init. = mask
1582  If (mask || Necessary to wait for blocked tasks to ) && Is this rcu_node a leaf? (rnp) Then Similar to rcu_report_qs_rdp(), for which it is a helper function
1584  Else raw_spin_unlock_irq_rcu_node(rnp)
1586  cond_resched_tasks_rcu_qs - Report potential quiescent states to RCU* This macro resembles cond_resched(), except that it is defined to* report potential quiescent states to RCU-tasks even if the cond_resched()()
1587  WRITE_ONCE(Time of last GP kthread , jiffies)
1590  Return true
Caller
NameDescribe
rcu_gp_kthreadBody of kthread that handles grace periods.