From: Minchan Kim <minchan@kernel.org>
To: Kautuk Consul <consul.kautuk@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Mel Gorman <mgorman@suse.de>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Tejun Heo <tj@kernel.org>, Minchan Kim <minchan.kim@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] page_alloc.c: Slightly improve the logic in __alloc_pages_high_priority
Date: Tue, 6 Mar 2012 12:16:20 +0900 [thread overview]
Message-ID: <20120306031619.GB14274@barrios> (raw)
In-Reply-To: <1330957105-3595-1-git-send-email-consul.kautuk@gmail.com>
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@barrios:~/linux-2.6$ size mm/page_alloc.o
text data bss dec hex filename
32772 1307 576 34655 875f mm/page_alloc.o
barrios@barrios:~/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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2012-03-06 3:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-05 14:18 Kautuk Consul
2012-03-06 3:16 ` Minchan Kim [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120306031619.GB14274@barrios \
--to=minchan@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=consul.kautuk@gmail.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=minchan.kim@gmail.com \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox