Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\locking\test-ww_mutex.c Create Date:2022-07-28 09:55:08
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:get_random_order

Proto:static int *get_random_order(int count)

Type:int

Parameter:

TypeParameterName
intcount
354  order = kmalloc_array - allocate memory for an array.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc).
355  If Not order Then Return order
358  When n < count cycle order[n] = n
361  When n > 1 cycle
362  r = get_random_int() % (n + 1)
363  If r != n Then
364  tmp = order[n]
365  order[n] = order[r]
366  order[r] = tmp
370  Return order
Caller
NameDescribe
stress_inorder_work
stress_reorder_work