Re: [RFC][-mm][PATCH 1/6] oom-killer: updates for classification ofOOM
From: Christoph Lameter
Date: Mon Nov 02 2009 - 12:11:37 EST
On Mon, 2 Nov 2009, KAMEZAWA Hiroyuki wrote:
> /*
> - * Types of limitations to the nodes from which allocations may occur
> + * Types of limitations to zones from which allocations may occur
> */
"Types of limitations that may cause OOMs"? MEMCG limitations are not zone
based.
> */
>
> -unsigned long badness(struct task_struct *p, unsigned long uptime)
> +static unsigned long __badness(struct task_struct *p,
> + unsigned long uptime, enum oom_constraint constraint,
> + struct mem_cgroup *mem)
> {
> unsigned long points, cpu_time, run_time;
> struct mm_struct *mm;
Why rename this function? You are adding a global_badness anyways.
> + /*
> + * In numa environ, almost all allocation will be against NORMAL zone.
The typical allocations will be against the policy_zone! SGI IA64 (and
others) have policy_zone == GFP_DMA.
> + * But some small area, ex)GFP_DMA for ia64 or GFP_DMA32 for x86-64
> + * can cause OOM. We can use policy_zone for checking lowmem.
> + */
Simply say that we are checking if the zone constraint is below the policy
zone?
> + * Now, only mempolicy specifies nodemask. But if nodemask
> + * covers all nodes, this oom is global oom.
> + */
> + if (nodemask && !nodes_equal(node_states[N_HIGH_MEMORY], *nodemask))
> + ret = CONSTRAINT_MEMORY_POLICY;
Huh? A cpuset can also restrict the nodes?
> + /*
> + * If not __GFP_THISNODE, zonelist containes all nodes. And if
Dont see any __GFP_THISNODE checks here.
> panic("out of memory from page fault. panic_on_oom is selected.\n");
>
> read_lock(&tasklist_lock);
> - __out_of_memory(0, 0); /* unknown gfp_mask and order */
> + /*
> + * Considering nature of pages required for page-fault,this must be
> + * global OOM (if not cpuset...). Then, CONSTRAINT_NONE is correct.
> + * zonelist, nodemasks are unknown...
> + */
> + __out_of_memory(0, CONSTRAINT_NONE, 0, NULL);
> read_unlock(&tasklist_lock);
Page faults can occur on processes that have memory restrictions.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/