函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\gup_benchmark.c Create Date:2022-07-27 17:51:25
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__gup_benchmark_ioctl

函数原型:static int __gup_benchmark_ioctl(unsigned int cmd, struct gup_benchmark *gup)

返回类型:int

参数:

类型参数名称
unsigned intcmd
struct gup_benchmark *gup
29  ret等于0
31  如果size大于ULONG_MAX则返回:负EINVAL
34  nr_pages等于sizePAGE_SIZE
35  pages等于kvcalloc(nr_pages, *的长度, GFP_KERNEL)
36  如果非pages则返回:负ENOMEM
39  i等于0
40  nr等于nr_pages_per_call
41  start_time等于ktime_get()
42 addr小于addrsize循环
43  如果nr不等于nr_pages_per_call退出
46  next等于addrnrPAGE_SIZE
47  如果next大于addrsize
48  next等于addrsize
49  nr等于nextaddr的差除PAGE_SIZE
53  :cmd恒等于GUP_FAST_BENCHMARK
62  :cmd恒等于GUP_BENCHMARK
66  默认
72  如果nr小于等于0则退出
74  i加等于nr
76  end_time等于ktime_get()
78  get_delta_usec等于ktime_us_delta(end_time, start_time)
79  size等于addraddr
81  start_time等于ktime_get()
82 i小于nr_pages循环
83  如果非pages[i]则退出
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  返回:ret
调用者
名称描述
gup_benchmark_ioctl