Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:vmpressure_register_event() - Bind vmpressure notifications to an eventfd*@memcg: memcg that is interested in vmpressure notifications*@eventfd: eventfd context to link notifications with*@args: event arguments (pressure level threshold, optional mode)*

Proto:int vmpressure_register_event(struct mem_cgroup *memcg, struct eventfd_ctx *eventfd, const char *args)

Type:int

Parameter:

TypeParameterName
struct mem_cgroup *memcg
struct eventfd_ctx *eventfd
const char *args
365  vmpr = Some nice accessors for the vmpressure.
367  mode = VMPRESSURE_NO_PASSTHROUGH
371  ret = 0
373  spec_orig = spec = kstrndup - allocate space for and copy an existing string*@s: the string to duplicate*@max: read at most @max chars from @s*@gfp: the GFP mask used in the kmalloc() call when allocating memory* Note: Use kmemdup_nul() instead if the size is known exactly
374  If Not spec Then
375  ret = -ENOMEM
376  Go to out
380  token = strsep - Split a string into tokens*@s: The string to be searched*@ct: The characters to search for* strsep() updates @s to point after the token, ready for the next call.* It returns empty tokens, too, behaving exactly like the libc function
381  ret = match_string - matches given string in an array*@array: array of strings*@n: number of strings in the array or -1 for NULL terminated arrays*@string: string to match with* Return:* index of a @string in the @array if matches, or %-EINVAL otherwise.
382  If ret < 0 Then Go to out
384  level = ret
387  token = strsep - Split a string into tokens*@s: The string to be searched*@ct: The characters to search for* strsep() updates @s to point after the token, ready for the next call.* It returns empty tokens, too, behaving exactly like the libc function
388  If token Then
389  ret = match_string - matches given string in an array*@array: array of strings*@n: number of strings in the array or -1 for NULL terminated arrays*@string: string to match with* Return:* index of a @string in the @array if matches, or %-EINVAL otherwise.
390  If ret < 0 Then Go to out
392  mode = ret
395  ev = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
396  If Not ev Then
397  ret = -ENOMEM
398  Go to out
401  efd = eventfd
402  level = level
403  mode = mode
405  mutex_lock( & Have to grab the lock on events traversal or modifications. )
406  list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
407  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
408  ret = 0
409  out :
410  kfree(spec_orig)
411  Return ret