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  linux-cve-announce  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:	Thu, 16 Jun 2016 12:17:48 +0200
From:	Michal Hocko <mhocko@...nel.org>
To:	Ganesh Mahendran <opensource.ganesh@...il.com>
Cc:	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	akpm@...ux-foundation.org, vbabka@...e.cz, iamjoonsoo.kim@....com,
	mina86@...a86.com, minchan@...nel.org, mgorman@...hsingularity.net,
	rientjes@...gle.com, kirill.shutemov@...ux.intel.com,
	izumi.taku@...fujitsu.com, hannes@...xchg.org,
	khandual@...ux.vnet.ibm.com, bsingharora@...il.com
Subject: Re: [PATCH v3] mm/compaction: remove unnecessary order check in
 direct compact path

On Thu 16-06-16 10:42:36, Ganesh Mahendran wrote:
> In direct compact path, both __alloc_pages_direct_compact and
> try_to_compact_pages check (order == 0).
> 
> This patch removes the check in __alloc_pages_direct_compact() and
> move the modifying of current->flags to the entry point of direct
> page compaction where we really do the compaction.

I do not have strong opinion on whether the order should be checked at
try_to_compact_pages or __alloc_pages_direct_compact. The later one
sounds more suitable because no further steps are really appropriate for
order == 0. try_to_compact_pages is not used anywhere else to be order
aware (maybe it will in future, who knows). But this all is a matter of
taste.

[...]
> diff --git a/mm/compaction.c b/mm/compaction.c
> index fbb7b38..dcfaf57 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -1686,12 +1686,16 @@ enum compact_result try_to_compact_pages(gfp_t gfp_mask, unsigned int order,
>  
>  	*contended = COMPACT_CONTENDED_NONE;
>  
> -	/* Check if the GFP flags allow compaction */
> +	/*
> +	 * Check if this is an order-0 request and
> +	 * if the GFP flags allow compaction.
> +	 */

If you are touching this comment then it would be appropriate to change
it from "what is checked" into "why it is checked" because that is far
from obvious from this context. Especially !fs/io part.

>  	if (!order || !may_enter_fs || !may_perform_io)
>  		return COMPACT_SKIPPED;
>  

That being said, I am not really sure the patch is an improvement. If
anything I would much rather see the above comment updated.

Thanks!
-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ