Re: [PATCH v0 1/2] perf: Add an option to ask for high order allocations for AUX buffers

From: Mel Gorman
Date: Wed Feb 13 2019 - 14:17:12 EST


On Wed, Feb 13, 2019 at 06:54:34PM +0100, Peter Zijlstra wrote:
> On Wed, Feb 13, 2019 at 05:47:56PM +0000, Mel Gorman wrote:
> > If there is a tangiable performance benefit from using contiguous regions
> > then I would suggest optimistically allocating them with appropriate
> > GFP flags to avoid large latencies at startup time and fall back if
> > necessary.
>
> Right; the code does the fallback thing. It successively tries smaller
> order allocations until 0-order fails.
>
> It currently uses:
>
> #define PERF_AUX_GFP (GFP_KERNEL | __GFP_ZERO | __GFP_NOWARN | __GFP_NORETRY)
>
> Is that what you could consider appropriate?

Yeah, spot on. Conceivably the semantics of __GFP_NORETY will change a
little at some point in the next year but not in any way I'd consider
harmful (depends on how THP and locality discussions go). Even *if*
we did something harmful, there will be complaints before it's problematic.

--
Mel Gorman
SUSE Labs