[PATCH v4 5/7] dma-buf: system_heap: Allocate higher order pages if available

Hillf Danton hdanton at sina.com
Thu Oct 29 07:02:21 UTC 2020


On Thu, 29 Oct 2020 00:16:22 +0000 John Stultz wrote:
> 
> +#define HIGH_ORDER_GFP  (((GFP_HIGHUSER | __GFP_ZERO | __GFP_NOWARN \
> +				| __GFP_NORETRY) & ~__GFP_RECLAIM) \
> +				| __GFP_COMP)
> +#define LOW_ORDER_GFP (GFP_HIGHUSER | __GFP_ZERO | __GFP_COMP)
> +static gfp_t order_flags[] = {HIGH_ORDER_GFP, LOW_ORDER_GFP, LOW_ORDER_GFP};
> +static const unsigned int orders[] = {8, 4, 0};
> +#define NUM_ORDERS ARRAY_SIZE(orders)

A two-line comment helps much understand the ORDERs above if it specifies the
reasons behind the detour to HPAGE_PMD_ORDER and PAGE_ALLOC_COSTLY_ORDER.


More information about the dri-devel mailing list