Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:full_fit_alloc_test

Proto:static int full_fit_alloc_test(void)

Type:int

Parameter:Nothing

227  rv = -1
230  junk_length = ls - find last set bit in word*@x: the word to search* This is defined in a similar way as the libc and compiler builtin* ffs, but returns the position of the most significant set bit.* fls(value) returns 0 if value is 0 or the position of the last
231  junk_length *= 32 * 1024 * 1024 / PAGE_SIZE
233  ptr = vmalloc( size of * * junk_length)
234  If Not ptr Then Return rv
237  junk_ptr = vmalloc( size of * * junk_length)
238  If Not junk_ptr Then
239  vfree(ptr)
240  Return rv
243  When i < junk_length cycle
244  ptr[i] = vmalloc(1 * PAGE_SIZE)
245  junk_ptr[i] = vmalloc(1 * PAGE_SIZE)
248  When i < junk_length cycle vfree(junk_ptr[i])
251  When i < test_loop_count cycle
252  tmp = vmalloc(1 * PAGE_SIZE)
254  If Not tmp Then Go to error
257  *tmp = 1
258  vfree(tmp)
262  rv = 0
264  error :
265  When i < junk_length cycle vfree(ptr[i])
268  vfree(ptr)
269  vfree(junk_ptr)
271  Return rv