Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\fork.c Create Date:2022-07-28 08:57:49
Last Modify:2020-03-17 11:04:53 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:set_max_threads

Proto:static void set_max_threads(unsigned int max_threads_suggested)

Type:void

Parameter:

TypeParameterName
unsigned intmax_threads_suggested
763  nr_pages = totalram_pages()
769  If ls64 - find last set bit in a 64-bit word*@x: the word to search* This is defined in a similar way as the libc and compiler builtin* ffsll, but returns the position of the most significant set bit + ls64 - find last set bit in a 64-bit word*@x: the word to search* This is defined in a similar way as the libc and compiler builtin* ffsll, but returns the position of the most significant set bit > 64 Then threads = Maximum number of threads
771  Else threads = div64_u64 - unsigned 64bit divide with 64bit divisor*@dividend: 64bit dividend*@divisor: 64bit divisor* This implementation is a modified version of the algorithm proposed* by the book 'Hacker's Delight'. The original source and full proof
775  If threads > max_threads_suggested Then threads = max_threads_suggested
778  unable limit on nr_threads = clamp_t - return a value clamped to a given range using a given type*@type: the type of variable to use*@val: current value*@lo: minimum allowable value*@hi: maximum allowable value* This macro does no typechecking and uses temporary variables of type(u64, threads, Minimum number of threads to boot the kernel, Maximum number of threads)
Caller
NameDescribe
fork_init