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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20120306031619.GB14274@barrios>
Date:	Tue, 6 Mar 2012 12:16:20 +0900
From:	Minchan Kim <minchan@...nel.org>
To:	Kautuk Consul <consul.kautuk@...il.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Mel Gorman <mgorman@...e.de>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	Tejun Heo <tj@...nel.org>, Minchan Kim <minchan.kim@...il.com>,
	linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] page_alloc.c: Slightly improve the logic in
 __alloc_pages_high_priority

Hi Kautuk,

On Mon, Mar 05, 2012 at 09:18:25AM -0500, Kautuk Consul wrote:
> The loop in __alloc_pages_high_priority() seems to be checking for
> (!page) and (gfp_mask & __GFP_NOFAIL) multiple times.
> 
> In fact, we don't really need to check (gfp_mask & __GFP_NOFAIL)
> for every iteration of the loop as the gfp_mask remains constant.
> 
> Slightly improve the logic in __alloc_pages_high_priority() to
> eliminate these multiple condition checks.

Thansk for your effort.

Surely we don't need mutliple condition check but it's not fast-path
and not a problem about readability. So I don't want to increase text
size unnecessary if it doesn't have a benefit.

barrios@...rios:~/linux-2.6$ size mm/page_alloc.o
   text	   data	    bss	    dec	    hex	filename
  32772	   1307	    576	  34655	   875f	mm/page_alloc.o
barrios@...rios:~/linux-2.6$ size mm/page_alloc.o.your_patch 
   text	   data	    bss	    dec	    hex	filename
  32804	   1307	    576	  34687	   877f	mm/page_alloc.o.patch
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ