Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:membarrier_global_expedited

Proto:static int membarrier_global_expedited(void)

Type:int

Parameter:Nothing

71  If num_online_cpus() == 1 Then Return 0
78  smp_mb()
80  If Not zalloc_cpumask_var( & tmpmask, GFP_KERNEL) Then Return -ENOMEM
83  cpus_read_lock()
84  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
85  for_each_online_cpu(cpu)
96  If cpu == These macros fold the SMP functionality into a single CPU system() Then Continue
99  If Not (READ_ONCE(membarrier_state) & MEMBARRIER_STATE_GLOBAL_EXPEDITED) Then Continue
108  p = fetch RCU-protected pointer for dereferencing(curr)
109  If Per task flags (PF_*), defined further below: & I am a kernel thread Then Continue
112  __cpumask_set_cpu(cpu, tmpmask)
114  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
116  Even if we don't have any preemption, we need preempt disable/enable* to be barriers, so that we don't have things like get_user/put_user* that can cause faults and scheduling migrate into our preempt-protected* region.()
117  smp_call_function_many(tmpmask, ipi_mb, NULL, 1)
118  preempt_enable()
120  free_cpumask_var(tmpmask)
121  cpus_read_unlock()
128  smp_mb()
129  Return 0
Caller
NameDescribe
SYSCALL_DEFINE2sys_membarrier - issue memory barriers on a set of threads*@cmd: Takes command values defined in enum membarrier_cmd