Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\cgroup\cpuset.c Create Date:2022-07-28 11:16:17
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:validate_change() - Used to validate that any proposed cpuset change* follows the structural rules for cpusets

Proto:static int validate_change(struct cpuset *cur, struct cpuset *trial)

Type:int

Parameter:

TypeParameterName
struct cpuset *cur
struct cpuset *trial
569  _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
572  ret = -EBUSY
573  cpuset_for_each_child - traverse online children of a cpuset*@child_cs: loop cursor pointing to the current child*@pos_css: used for iteration*@parent_cs: target cpuset to walk children of* Walk @child_cs through the online children of @parent_cs(c, css, cur)
574  If Not s_cpuset_subset(p, q) - Is cpuset p a subset of cpuset q?* One cpuset is a subset of another if all its allowed CPUs and* Memory Nodes are a subset of the other, and its exclusive flags* are only set if the other's are set. Call holding cpuset_mutex. Then Go to out
578  ret = 0
579  If cur == top_cpuset Then Go to out
582  par = parent_cs(cur)
585  ret = -EACCES
586  If Not Cgroup v2 behavior is used when on default hierarchy or the* cgroup_v2_mode flag is set. && Not s_cpuset_subset(p, q) - Is cpuset p a subset of cpuset q?* One cpuset is a subset of another if all its allowed CPUs and* Memory Nodes are a subset of the other, and its exclusive flags* are only set if the other's are set. Call holding cpuset_mutex. Then Go to out
593  ret = -EINVAL
594  cpuset_for_each_child - traverse online children of a cpuset*@child_cs: loop cursor pointing to the current child*@pos_css: used for iteration*@parent_cs: target cpuset to walk children of* Walk @child_cs through the online children of @parent_cs(c, css, par)
595  If (is_cpu_exclusive(trial) || is_cpu_exclusive(c)) && c != cur && pumask_intersects - (*src1p & *src2p) != 0*@src1p: the first input*@src2p: the second input Then Go to out
599  If (is_mem_exclusive(trial) || is_mem_exclusive(c)) && c != cur && nodes_intersects(mems_allowed, mems_allowed) Then Go to out
609  ret = -ENOSPC
610  If synchronization, the result can only be used as a hint || * Tasks are being attached to this cpuset. Used to prevent * zeroing cpus/mems_allowed between ->can_attach() and ->attach(). Then
611  If Not pumask_empty - *srcp == 0*@srcp: the cpumask to that all cpus < nr_cpu_ids are clear. && pumask_empty - *srcp == 0*@srcp: the cpumask to that all cpus < nr_cpu_ids are clear. Then Go to out
614  If Not nodes_empty(mems_allowed) && nodes_empty(mems_allowed) Then Go to out
623  ret = -EBUSY
624  If is_cpu_exclusive(cur) && Not cpuset_cpumask_can_shrink( user-configured CPUs and Memory Nodes allow to tasks , user-configured CPUs and Memory Nodes allow to tasks ) Then Go to out
629  ret = 0
630  out :
631  _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()
632  Return ret
Caller
NameDescribe
update_cpumaskpdate_cpumask - update the cpus_allowed mask of a cpuset and all tasks in it*@cs: the cpuset to consider*@trialcs: trial cpuset*@buf: buffer of cpu numbers written to this cpuset
update_nodemaskHandle user request to change the 'mems' memory placement* of a cpuset
update_flagpdate_flag - read a 0 or a 1 in a file and update associated flag* Call with cpuset_mutex held.