[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.1.00.0910020243190.22702@chino.kir.corp.google.com>
Date: Fri, 2 Oct 2009 02:50:39 -0700 (PDT)
From: David Rientjes <rientjes@...gle.com>
To: Neil Brown <neilb@...e.de>
cc: Suresh Jayaraman <sjayaraman@...e.de>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
netdev@...r.kernel.org, Miklos Szeredi <mszeredi@...e.cz>,
Wouter Verhelst <w@...r.be>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
trond.myklebust@....uio.no
Subject: Re: [PATCH 04/31] mm: tag reseve pages
On Fri, 2 Oct 2009, Neil Brown wrote:
> Normally if zones are above their watermarks, page->reserve will not
> be set.
> This is because __alloc_page_nodemask (which seems to be the main
> non-inline entrypoint) first calls get_page_from_freelist with
> alloc_flags set to ALLOC_WMARK_LOW|ALLOC_CPUSET.
> Only if this fails does __alloc_page_nodemask call
> __alloc_pages_slowpath which potentially sets ALLOC_NO_WATERMARKS in
> alloc_flags.
>
> So page->reserved being set actually tells us:
> PF_MEMALLOC or GFP_MEMALLOC were used, and
> a WMARK_LOW allocation attempt failed very recently
>
> which is close enough to "the emergency reserves were used" I think.
>
There're a couple cornercases for GFP_ATOMIC, though:
- it isn't restricted by cpuset, so ALLOC_CPUSET will never get set for
the slowpath allocs and may very well allow the allocation to succeed
in zones far above their min watermark.
- it allows for allocating beyond the min watermark in allowed zones
simply by setting ALLOC_HARDER; these types of "reserve" allocations
wouldn't be marked as page->reserve with your patches if
ALLOC_NO_WATERMARKS wasn't set because of the allocation context.
The second one is debatable whether it fits your definition of reserve or
not, but there's an inconsistency if it doesn't because the allocation may
succeed in "no watermark" context (for example, in hard irq context) even
though that privilege wasn't necessary to successfully allocate: perhaps
it only needed ALLOC_HARDER.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists