函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:membarrier_global_expedited

函数原型:static int membarrier_global_expedited(void)

返回类型:int

参数:

71  如果num_online_cpus()恒等于1则返回:0
78  smp_mb()
80  如果非zalloc_cpumask_var( & tmpmask, GFP_KERNEL)则返回:负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  遍历在线CPU(cpu)
96  如果cpu恒等于These macros fold the SMP functionality into a single CPU system()则继续下一循环
99  如果非READ_ONCE(membarrier_state)按位与MEMBARRIER_STATE_GLOBAL_EXPEDITED的值则继续下一循环
108  p等于cu_dereference() - fetch RCU-protected pointer for dereferencing*@p: The pointer to read, prior to dereferencing* This is a simple wrapper around rcu_dereference_check().(curr)
109  如果任务标志按位与I am a kernel thread 则继续下一循环
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  禁止抢占()
117  smp_call_function_many(tmpmask, ipi_mb, NULL, 1)
118  禁用抢占和中断()
120  释放CPU掩码
121  cpus_read_unlock()
128  smp_mb()
129  返回:0
调用者
名称描述
SYSCALL_DEFINE2sys_membarrier - issue memory barriers on a set of threads*@cmd: Takes command values defined in enum membarrier_cmd