函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\oom_kill.c Create Date:2022-07-27 15:29:05
Last Modify:2022-05-23 13:16:41 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Determine the type of allocation constraint.

函数原型:static enum oom_constraint constrained_alloc(struct oom_control *oc)

返回类型:enum oom_constraint

参数:

类型参数名称
struct oom_control *oc
256  high_zoneidx等于gfp_zone(Used to determine cpuset and node locality requirement )
257  bool cpuset_limited = false
260  如果is_memcg_oom(oc)则
261  Used by oom implementation, do not set 等于如果mem_cgroup_get_max(Memory cgroup in which oom is invoked, or NULL for global oom )否则1
262  返回:CONSTRAINT_MEMCG
266  Used by oom implementation, do not set 等于totalram_pages()加total_swap_pages
268  如果非IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_NUMA)则返回:CONSTRAINT_NONE
271  如果非Used to determine cpuset 则返回:CONSTRAINT_NONE
278  如果Used to determine cpuset and node locality requirement 按位与__GFP_THISNODE则返回:CONSTRAINT_NONE
286  如果Used to determine mempolicy 且非nodes_subset(The following particular system nodemasks and operations* on them manage all possible and online nodes.[N_MEMORY], * Used to determine mempolicy )则
288  Used by oom implementation, do not set 等于total_swap_pages
289  for_each_node_mask(nid, * Used to determine mempolicy )
290  Used by oom implementation, do not set 加等于node_present_pages(nid)
291  返回:CONSTRAINT_MEMORY_POLICY
295  r_each_zone_zonelist_nodemask - helper macro to iterate over valid zones in a zonelist at or below a given zone index and within a nodemask*@zone - The current zone in the iterator*@z - The current pointer within zonelist->_zonerefs being iterated*@zlist (zone, z, Used to determine cpuset , high_zoneidx, Used to determine mempolicy )
297  如果非cpuset_zone_allowed(zone, Used to determine cpuset and node locality requirement )则cpuset_limited = true
300  如果cpuset_limited
301  Used by oom implementation, do not set 等于total_swap_pages
302  for_each_node_mask(nid, cpuset_current_mems_allowed)
303  Used by oom implementation, do not set 加等于node_present_pages(nid)
304  返回:CONSTRAINT_CPUSET
306  返回:CONSTRAINT_NONE
调用者
名称描述
out_of_memory_of_memory - kill the "best" process when we run out of memory*@oc: pointer to struct oom_control* If we run out of memory, we have the choice between either* killing a random task (bad), letting the system crash (worse)