Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:pidlist_uniq - given a kmalloc()ed list, strip out all duplicate entries* Returns the number of unique elements.

Proto:static int pidlist_uniq(pid_t *list, int length)

Type:int

Parameter:

TypeParameterName
pid_t *list
intlength
243  dest = 1
249  If length == 0 || length == 1 Then Return length
252  When src < length cycle
254  When list[src] == list[src - 1] cycle
255  src++
256  If src == length Then Go to after
260  list[dest] = list[src]
261  dest++
263  after :
264  Return dest
Caller
NameDescribe
pidlist_array_loadLoad a cgroup's pidarray with either procs' tgids or tasks' pids