Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__gup_benchmark_ioctl

Proto:static int __gup_benchmark_ioctl(unsigned int cmd, struct gup_benchmark *gup)

Type:int

Parameter:

TypeParameterName
unsigned intcmd
struct gup_benchmark *gup
29  ret = 0
31  If size > ULONG_MAX Then Return -EINVAL
34  nr_pages = size / PAGE_SIZE
35  pages = kvcalloc(nr_pages, size of * , GFP_KERNEL)
36  If Not pages Then Return -ENOMEM
39  i = 0
40  nr = nr_pages_per_call
41  start_time = ktime_get()
42  When addr < addr + size cycle
43  If nr != nr_pages_per_call Then Break
46  next = addr + nr * PAGE_SIZE
47  If next > addr + size Then
48  next = addr + size
49  nr = (next - addr) / PAGE_SIZE
53  Case cmd == GUP_FAST_BENCHMARK
62  Case cmd == GUP_BENCHMARK
66  Default
72  If nr <= 0 Then Break
74  i += nr
76  end_time = ktime_get()
78  get_delta_usec = ktime_us_delta(end_time, start_time)
79  size = addr - addr
81  start_time = ktime_get()
82  When i < nr_pages cycle
83  If Not pages[i] Then Break
87  end_time = ktime_get()
88  put_delta_usec = ktime_us_delta(end_time, start_time)
90  kvfree() - Free memory.*@addr: Pointer to allocated memory.* kvfree frees memory allocated by any of vmalloc(), kmalloc() or kvmalloc().* It is slightly more efficient to use kfree() or vfree() if you are certain* that you know which one to use.
91  out :
92  Return ret
Caller
NameDescribe
gup_benchmark_ioctl