Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:q_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.

Proto:struct irq_affinity_desc *irq_create_affinity_masks(unsigned int nvecs, struct irq_affinity *affd)

Type:struct irq_affinity_desc

Parameter:

TypeParameterName
unsigned intnvecs
struct irq_affinity *affd
419  struct irq_affinity_desc * masks = NULL
427  If nvecs > pre_vectors + post_vectors Then affvecs = nvecs - pre_vectors - post_vectors
429  Else affvecs = 0
436  If Not calc_sets Then calc_sets = default_calc_sets
440  calc_sets(affd, affvecs)
442  If WARN_ON_ONCE(nr_sets > IRQ_AFFINITY_MAX_SETS) Then Return NULL
446  If Not affvecs Then Return NULL
449  masks = kcalloc - allocate memory for an array. The memory is set to zero.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc).
450  If Not masks Then Return NULL
454  When curvec < pre_vectors cycle pumask_copy - *dstp = *srcp*@dstp: the result*@srcp: the input cpumask
461  When i < nr_sets cycle
462  this_vecs = set_size[i]
465  ret = ld affinity in two stages:* 1) spread present CPU on these vectors* 2) spread other possible CPUs on these vectors
467  If ret Then
469  Return NULL
471  curvec += this_vecs
472  usedvecs += this_vecs
476  If usedvecs >= affvecs Then curvec = pre_vectors + affvecs
478  Else curvec = pre_vectors + usedvecs
480  When curvec < nvecs cycle pumask_copy - *dstp = *srcp*@dstp: the result*@srcp: the input cpumask
484  When i < nvecs - post_vectors cycle is_managed = 1
487  Return masks