Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:sync_runqueues_membarrier_state

Proto:static int sync_runqueues_membarrier_state(struct mm_struct *mm)

Type:int

Parameter:

TypeParameterName
struct mm_struct *mm
202  membarrier_state = atomic_read( & membarrier_state)
206  If atomic_read( & *@mm_users: The number of users including userspace. * Use mmget()/mmget_not_zero()/mmput() to modify. When this * drops to 0 (i.e. when the task exits and there are no other * temporary reference holders), we also release a reference on *@mm_count (which ) == 1 || num_online_cpus() == 1 Then
207  this_cpu_write(membarrier_state, membarrier_state)
216  smp_mb()
217  Return 0
220  If Not zalloc_cpumask_var( & tmpmask, GFP_KERNEL) Then Return -ENOMEM
228  synchronize_rcu()
237  cpus_read_lock()
238  _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
239  for_each_online_cpu(cpu)
240  rq = cpu_rq(cpu)
243  p = fetch RCU-protected pointer for dereferencing(curr)
244  If p && mm == mm Then __cpumask_set_cpu(cpu, tmpmask)
247  _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()
249  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.()
250  smp_call_function_many(tmpmask, ipi_sync_rq_state, mm, 1)
251  preempt_enable()
253  free_cpumask_var(tmpmask)
254  cpus_read_unlock()
256  Return 0
Caller
NameDescribe
membarrier_register_global_expedited
membarrier_register_private_expedited