Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\resctrl\rdtgroup.c Create Date:2022-07-28 08:10:57
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:rdtgroup_cpus_write

Proto:static ssize_t rdtgroup_cpus_write(struct kernfs_open_file *of, char *buf, size_t nbytes, loff_t off)

Type:ssize_t

Parameter:

TypeParameterName
struct kernfs_open_file *of
char *buf
size_tnbytes
loff_toff
448  If Not buf Then Return -EINVAL
451  If Not zalloc_cpumask_var( & tmpmask, GFP_KERNEL) Then Return -ENOMEM
453  If Not zalloc_cpumask_var( & newmask, GFP_KERNEL) Then
454  free_cpumask_var(tmpmask)
455  Return -ENOMEM
457  If Not zalloc_cpumask_var( & tmpmask1, GFP_KERNEL) Then
458  free_cpumask_var(tmpmask)
459  free_cpumask_var(newmask)
460  Return -ENOMEM
463  rdtgrp = rdtgroup_kn_lock_live( published fields )
464  If Not rdtgrp Then
465  ret = -ENOENT
466  Go to unlock
469  If mode == RDT_MODE_PSEUDO_LOCKED || mode == RDT_MODE_PSEUDO_LOCKSETUP Then
471  ret = -EINVAL
472  rdt_last_cmd_puts("Pseudo-locking in progress\n")
473  Go to unlock
476  If is_cpu_list(of) Then ret = pulist_parse - extract a cpumask from a user string of ranges*@buf: the buffer to extract from*@dstp: the cpumask to set.* Returns -errno, or 0 for success.
478  Else ret = pumask_parse - extract a cpumask from a string*@buf: the buffer to extract from*@dstp: the cpumask to set.* Returns -errno, or 0 for success.
481  If ret Then
482  rdt_last_cmd_puts("Bad CPU list/mask\n")
483  Go to unlock
487  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
488  If pumask_weight - Count of bits in *srcp*@srcp: the cpumask to count bits (< nr_cpu_ids) in. Then
489  ret = -EINVAL
490  rdt_last_cmd_puts("Can only assign online CPUs\n")
491  Go to unlock
494  If type == RDTCTRL_GROUP Then ret = cpus_ctrl_write(rdtgrp, newmask, tmpmask, tmpmask1)
496  Else if type == RDTMON_GROUP Then ret = cpus_mon_write(rdtgrp, newmask, tmpmask)
498  Else ret = -EINVAL
501  unlock :
502  rdtgroup_kn_unlock( published fields )
503  free_cpumask_var(tmpmask)
504  free_cpumask_var(newmask)
505  free_cpumask_var(tmpmask1)
507  Return If ret Else nbytes