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] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.10.1606201749110.133174@chino.kir.corp.google.com>
Date:	Mon, 20 Jun 2016 17:52:43 -0700 (PDT)
From:	David Rientjes <rientjes@...gle.com>
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,
	mhocko@...e.com, mina86@...a86.com, minchan@...nel.org,
	mgorman@...hsingularity.net, 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 Jun 2016, Ganesh Mahendran wrote:

> 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.
> +	 */

This seems obvious.

>  	if (!order || !may_enter_fs || !may_perform_io)
>  		return COMPACT_SKIPPED;
>  
>  	trace_mm_compaction_try_to_compact_pages(order, gfp_mask, mode);
>  
> +	current->flags |= PF_MEMALLOC;
>  	/* Compact each zone in the list */
>  	for_each_zone_zonelist_nodemask(zone, z, ac->zonelist, ac->high_zoneidx,
>  								ac->nodemask) {
> @@ -1768,6 +1772,7 @@ break_loop:
>  		all_zones_contended = 0;
>  		break;
>  	}
> +	current->flags &= ~PF_MEMALLOC;
>  
>  	/*
>  	 * If at least one zone wasn't deferred or skipped, we report if all

Compaction don't touch task_struct flags and PF_MEMALLOC is flag used 
primarily by the page allocator, moving this to try_to_compact_pages() 
doesn't make sense.

You could remove the !order check in try_to_compact_pages(), but I don't 
think it offers anything substantial.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ