Re: Terminate process that fails on a constrained allocation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A couple of comments ...

It took me an extra couple of passes to understand this code.

I wonder if the following, essentially equivalent (if I didn't
break something - never tested this) is easier to understand:

#ifdef CONFIG_NUMA
		/*
		 * In the NUMA case we may have gotten here because the
		 * memory policies or cpusets have restricted the allocation.
		 */
		{
			nodemask_t nodes;	/* compute nodes not allowd */

			nodes = node_online_map;
			for (z = zonelist->zones; *z; z++)
				if (cpuset_zone_allowed(*z, gfp_mask))
					node_clear((*z)->zone_pgdat->node_id,
							nodes);
			/*
			 * If there are any nodes left set in 'nodes', these
			 * are nodes the cpuset or mempolicy settings aren't
			 * letting us use.  In that case, return NULL to the
			 * current task, rather than invoking out_of_memory()
			 * on the system.
			 */
			if (!nodes_empty(nodes))
				return NULL;
		}
#endif

Second point - I thought I had already throttled the oom_killer
to some degree, with the lines, in mm/oom_kill.c select_bad_process():

                /* If p's nodes don't overlap ours, it won't help to kill p. */
                if (!cpuset_excl_nodes_overlap(p))
                        continue;

What your patch is doing affectively disables the oom_killer for
big numa systems, rather than having it operate within the set
of tasks using overlapping resources.

Do we need this more radical constraint on the oom_killer?

-- 
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <[email protected]> 1.925.600.0401
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux