lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 06 Oct 2014 19:27:59 +0900
From:	Heesub Shin <heesub.shin@...sung.com>
To:	Pintu Kumar <pintu.k@...sung.com>, akpm@...ux-foundation.org,
	gregkh@...uxfoundation.org, john.stultz@...aro.org,
	rebecca@...roid.com, ccross@...roid.com,
	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Cc:	pintu_agarwal@...oo.com, vishnu.ps@...sung.com,
	iqbal.ams@...sung.com
Subject: Re: [PATCH 1/1] [ion]: system-heap use PAGE_ALLOC_COSTLY_ORDER for
 high order

Hello Kumar,

On 10/06/2014 05:31 PM, Pintu Kumar wrote:
> The Android ion_system_heap uses allocation fallback mechanism
> based on 8,4,0 order pages available in the system.
> It changes gfp flags based on higher order allocation request.
> This higher order value is hard-coded as 4, instead of using
> the system defined higher order value.
> Thus replacing this hard-coded value with PAGE_ALLOC_COSTLY_ORDER
> which is defined as 3.
> This will help mapping the higher order request in system heap with
> the actual allocation request.

Quite reasonable.

Reviewed-by: Heesub Shin <heesub.shin@...sung.com>

BTW, Anyone knows how the allocation order (8,4 and 0) was decided? I 
think only Google guys might know the answer.

regards,
heesub

>
> Signed-off-by: Pintu Kumar <pintu.k@...sung.com>
> ---
>   drivers/staging/android/ion/ion_system_heap.c |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c
> index da2a63c..e6c393f 100644
> --- a/drivers/staging/android/ion/ion_system_heap.c
> +++ b/drivers/staging/android/ion/ion_system_heap.c
> @@ -65,7 +65,7 @@ static struct page *alloc_buffer_page(struct ion_system_heap *heap,
>   	} else {
>   		gfp_t gfp_flags = low_order_gfp_flags;
>
> -		if (order > 4)
> +		if (order > PAGE_ALLOC_COSTLY_ORDER)
>   			gfp_flags = high_order_gfp_flags;
>   		page = alloc_pages(gfp_flags | __GFP_COMP, order);
>   		if (!page)
> @@ -276,7 +276,7 @@ struct ion_heap *ion_system_heap_create(struct ion_platform_heap *unused)
>   		struct ion_page_pool *pool;
>   		gfp_t gfp_flags = low_order_gfp_flags;
>
> -		if (orders[i] > 4)
> +		if (orders[i] > PAGE_ALLOC_COSTLY_ORDER)
>   			gfp_flags = high_order_gfp_flags;
>   		pool = ion_page_pool_create(gfp_flags, orders[i]);
>   		if (!pool)
>
--
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