函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:memory_high_write

函数原型:static ssize_t memory_high_write(struct kernfs_open_file *of, char *buf, size_t nbytes, loff_t off)

返回类型:ssize_t

参数:

类型参数名称
struct kernfs_open_file *of
char *buf
size_tnbytes
loff_toff
5938  memcg等于mem_cgroup_from_css(of_css(of))
5939  nr_retries等于MEM_CGROUP_RECLAIM_RETRIES
5940  bool drained = false
5944  buf等于strstrip(buf)
5945  err等于page_counter_memparse - memparse() for page counter limits*@buf: string to parse*@max: string meaning maximum possible value*@nr_pages: returns the result in number of pages* Returns -EINVAL, or 0 and @nr_pages on success. @nr_pages will be
5946  如果err则返回:err
5949  Upper bound of normal memory consumption range 等于high
5951  循环
5952  nr_pages等于page_counter_read( & Accounted resources )
5955  如果nr_pages小于等于high退出
5958  如果signal_pending(当前进程)则退出
5961  如果非drained
5963  drained = true
5964  继续下一循环
5967  reclaimed等于try_to_free_mem_cgroup_pages(memcg, nr_pages - high, GFP_KERNEL, true)
5970  如果非reclaimed且非nr_retries自减则退出
5974  返回:nbytes