Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__request_module - try to load a kernel module*@wait: wait (or not) for the operation to complete*@fmt: printf style format string for the name of the module*@...: arguments as specified in the format string

Proto:int __request_module(bool wait, const char *fmt, ...)

Type:int

Parameter:

TypeParameterName
boolwait
const char *fmt
137  WARN_ON_ONCE(wait && rrent_is_async - is %current an async worker task?* Returns %true if %current is an async worker task.)
139  If Not modprobe_path is set via /proc/sys.[0] Then Return 0
142  va_start(args, fmt)
143  ret = vsnprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@args: Arguments for the format string* This function generally
144  va_end(args)
145  If ret >= MODULE_NAME_LEN Then Return -ENAMETOOLONG
148  ret = security_kernel_module_request(module_name)
149  If ret Then Return ret
152  If atomic_dec_if_positive( & kmod_concurrent_max) < 0 Then
153  pr_warn_ratelimited("request_module: kmod_concurrent_max (%u) close to 0 (max_modprobes: %u), for module %s, throttling...", atomic_read( & kmod_concurrent_max), Assuming:* threads = div64_u64((u64) totalram_pages * (u64) PAGE_SIZE,* (u64) THREAD_SIZE * 8UL);* If you need less than 50 threads would mean we're dealing with systems* smaller than 3200 pages, module_name)
156  ret = wait_event_killable_timeout - sleep until a condition gets true or a timeout elapses*@wq_head: the waitqueue to wait on*@condition: a C expression for the event to wait for*@timeout: timeout, in jiffies* The process is put to sleep (TASK_KILLABLE) until (kmod_wq, atomic_dec_if_positive( & kmod_concurrent_max) >= 0, This is a restriction on having *all* MAX_KMOD_CONCURRENT threads* running at the same time without returning. When this happens we* believe you've somehow ended up with a recursive module dependency* creating a loop.* We have no option but to fail. * HZ)
159  If Not ret Then
162  Return -ETIME
164  pr_warn_ratelimited("request_module: sigkill sent for modprobe %s, giving up", module_name)
165  Return ret
169  trace_module_request(module_name, wait, _RET_IP_)
171  ret = call_modprobe(module_name, wait ? wait for the process to complete : wait for the exec, but not the process )
173  atomic_inc( & kmod_concurrent_max)
174  wake_up( & kmod_wq)
176  Return ret