Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\oom_kill.c Create Date:2022-07-28 14:05:55
Last Modify:2022-05-23 13:16:41 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Determine the type of allocation constraint.

Proto:static enum oom_constraint constrained_alloc(struct oom_control *oc)

Type:enum oom_constraint

Parameter:

TypeParameterName
struct oom_control *oc
256  high_zoneidx = gfp_zone(Used to determine cpuset and node locality requirement )
257  bool cpuset_limited = false
260  If is_memcg_oom(oc) Then
261  Used by oom implementation, do not set = If mem_cgroup_get_max(Memory cgroup in which oom is invoked, or NULL for global oom ) Else 1
262  Return CONSTRAINT_MEMCG
266  Used by oom implementation, do not set = totalram_pages() + total_swap_pages
268  If Not IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_NUMA) Then Return CONSTRAINT_NONE
271  If Not Used to determine cpuset Then Return CONSTRAINT_NONE
278  If Used to determine cpuset and node locality requirement & __GFP_THISNODE Then Return CONSTRAINT_NONE
286  If Used to determine mempolicy && Not nodes_subset(The following particular system nodemasks and operations* on them manage all possible and online nodes.[N_MEMORY], * Used to determine mempolicy ) Then
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  Return 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  If Not cpuset_zone_allowed(zone, Used to determine cpuset and node locality requirement ) Then cpuset_limited = true
300  If cpuset_limited Then
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  Return CONSTRAINT_CPUSET
306  Return CONSTRAINT_NONE
Caller
NameDescribe
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)