函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Build sched domains for a given set of CPUs and attach the sched domains* to the individual CPUs

函数原型:static int build_sched_domains(const struct cpumask *cpu_map, struct sched_domain_attr *attr)

返回类型:int

参数:

类型参数名称
const struct cpumask *cpu_map
struct sched_domain_attr *attr
1984  alloc_state等于sa_none
1987  struct rq * rq = NULL
1988  ret等于负ENOMEM
1990  bool has_asym = false
1992  如果WARN_ON(pumask_empty - *srcp == 0*@srcp: the cpumask to that all cpus < nr_cpu_ids are clear.)则转到:error
1995  alloc_state等于__visit_domain_allocation_hell( & d, cpu_map)
1996  如果alloc_state不等于sa_rootdomain则转到:error
1999  tl_asym等于Find the sched_domain_topology_level where all CPU capacities are visible* for all CPUs.
2005  sd = NULL
2007  dflags等于0
2009  如果tl恒等于tl_asym
2010  dflags或等于SD_ASYM_CPUCAPACITY
2011  has_asym = true
2014  如果WARN_ON(!Ensure topology masks are sane, i.e. there are no conflicts (overlaps) for* any two given CPUs at this (non-NUMA) topology level.)则转到:error
2017  sd等于build_sched_domain(tl, cpu_map, attr, sd, dflags, i)
2019  如果tl恒等于sched_domain_topologyper_cpu_ptr(sd, i)等于sd
2021  如果flags按位与SDTL_OVERLAPflags或等于SD_OVERLAP
2023  如果pumask_equal - *src1p == *src2p*@src1p: the first input*@src2p: the second input退出
2030 sd循环
2031  span_weight等于pumask_weight - Count of bits in *srcp*@srcp: the cpumask to count bits (< nr_cpu_ids) in.
2032  如果flags按位与SD_OVERLAP
2033  如果build_overlap_sched_groups(sd, i)则转到:error
2035  否则
2043 i大于等于0循环
2044  如果非测试CPU信息则继续下一循环
2047 sd循环
2054  _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
2056  rq等于cpu_rq(i)
2057  sd等于per_cpu_ptr(sd, i)
2060  如果cpu_capacity_orig大于READ_ONCE(max_cpu_capacity)则WRITE_ONCE(max_cpu_capacity, cpu_capacity_orig)
2063  Attach the domain 'sd' to 'cpu' as its base domain. Callers must* hold the hotplug lock.
2065  _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()
2067  如果has_asymstatic_branch_inc_cpuslocked( & sched_asym_cpucapacity)
2070  如果rqsched_debug_enabled
2071  打印信息("root domain span: %*pbl (max cpu_capacity = %lu)\n", cpumask_pr_args - printf args to output a cpumask*@maskp: cpumask to be printed* Can be used to provide arguments for '%*pb[l]' when printing a cpumask.(cpu_map), max_cpu_capacity)
2075  ret等于0
2076  error :
2077  __free_domain_allocs( & d, alloc_state, cpu_map)
2079  返回:ret
调用者
名称描述
sched_init_domainsSet up scheduler domains and groups. For now this just excludes isolated* CPUs, but could be used to exclude other special cases in the future.
partition_sched_domains_lockedPartition sched domains as specified by the 'ndoms_new'* cpumasks in the array doms_new[] of cpumasks. This compares* doms_new[] to the current sched domain partitioning, doms_cur[].* It destroys each deleted domain and builds each new domain.