Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47f3a867 authored by Paul Jackson's avatar Paul Jackson Committed by Linus Torvalds
Browse files

[PATCH] mm: fix __alloc_pages cpuset ALLOC_* flags



Two changes to the setting of the ALLOC_CPUSET flag in
mm/page_alloc.c:__alloc_pages()

- A bug fix - the "ignoring mins" case should not be honoring ALLOC_CPUSET.
  This case of all cases, since it is handling a request that will free up
  more memory than is asked for (exiting tasks, e.g.) should be allowed to
  escape cpuset constraints when memory is tight.

- A logic change to make it simpler.  Honor cpusets even on GFP_ATOMIC
  (!wait) requests.  With this, cpuset confinement applies to all requests
  except ALLOC_NO_WATERMARKS, so that in a subsequent cleanup patch, I can
  remove the ALLOC_CPUSET flag entirely.  Since I don't know any real reason
  this logic has to be either way, I am choosing the path of the simplest
  code.

Signed-off-by: default avatarPaul Jackson <pj@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a576219a
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -903,7 +903,6 @@ __alloc_pages(gfp_t gfp_mask, unsigned int order,
		alloc_flags |= ALLOC_HARDER;
		alloc_flags |= ALLOC_HARDER;
	if (gfp_mask & __GFP_HIGH)
	if (gfp_mask & __GFP_HIGH)
		alloc_flags |= ALLOC_HIGH;
		alloc_flags |= ALLOC_HIGH;
	if (wait)
	alloc_flags |= ALLOC_CPUSET;
	alloc_flags |= ALLOC_CPUSET;


	/*
	/*
@@ -926,7 +925,7 @@ __alloc_pages(gfp_t gfp_mask, unsigned int order,
nofail_alloc:
nofail_alloc:
			/* go through the zonelist yet again, ignoring mins */
			/* go through the zonelist yet again, ignoring mins */
			page = get_page_from_freelist(gfp_mask, order,
			page = get_page_from_freelist(gfp_mask, order,
				zonelist, ALLOC_NO_WATERMARKS|ALLOC_CPUSET);
				zonelist, ALLOC_NO_WATERMARKS);
			if (page)
			if (page)
				goto got_pg;
				goto got_pg;
			if (gfp_mask & __GFP_NOFAIL) {
			if (gfp_mask & __GFP_NOFAIL) {