Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ld affinity in two stages:* 1) spread present CPU on these vectors* 2) spread other possible CPUs on these vectors

Proto:static int irq_build_affinity_masks(unsigned int startvec, unsigned int numvecs, unsigned int firstvec, struct irq_affinity_desc *masks)

Type:int

Parameter:

TypeParameterName
unsigned intstartvec
unsigned intnumvecs
unsigned intfirstvec
struct irq_affinity_desc *masks
342  curvec = startvec , nr_present = 0 , nr_others = 0
345  ret = -ENOMEM
347  If Not zalloc_cpumask_var( & nmsk, GFP_KERNEL) Then Return ret
350  If Not zalloc_cpumask_var( & npresmsk, GFP_KERNEL) Then Go to fail_nmsk
353  node_to_cpumask = alloc_node_to_cpumask()
354  If Not node_to_cpumask Then Go to fail_npresmsk
358  get_online_cpus()
359  build_node_to_cpumask(node_to_cpumask)
362  ret = __irq_build_affinity_masks(curvec, numvecs, firstvec, node_to_cpumask, cpu_present_mask, nmsk, masks)
365  If ret < 0 Then Go to fail_build_affinity
367  nr_present = ret
375  If nr_present >= numvecs Then curvec = firstvec
377  Else curvec = firstvec + nr_present
379  pumask_andnot - *dstp = *src1p & ~*src2p*@dstp: the cpumask result*@src1p: the first input*@src2p: the second input* If *@dstp is empty, returns 0, else returns 1
380  ret = __irq_build_affinity_masks(curvec, numvecs, firstvec, node_to_cpumask, npresmsk, nmsk, masks)
383  If ret >= 0 Then nr_others = ret
386  fail_build_affinity :
387  put_online_cpus()
389  If ret >= 0 Then WARN_ON(nr_present + nr_others < numvecs)
392  free_node_to_cpumask(node_to_cpumask)
394  fail_npresmsk :
395  free_cpumask_var(npresmsk)
397  fail_nmsk :
398  free_cpumask_var(nmsk)
399  Return If ret < 0 Then ret Else 0
Caller
NameDescribe
irq_create_affinity_masksq_create_affinity_masks - Create affinity masks for multiqueue spreading*@nvecs: The total number of vectors*@affd: Description of the affinity requirements* Returns the irq_affinity_desc pointer or NULL if allocation failed.