From: Mel Gorman <mel@csn.ul.ie>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Huang Shijie <shijie8@gmail.com>,
akpm@linux-foundation.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm : kill combined_idx
Date: Mon, 21 Dec 2009 19:43:37 +0000 [thread overview]
Message-ID: <20091221194337.GA23345@csn.ul.ie> (raw)
In-Reply-To: <20091221143139.7088a8d3.kamezawa.hiroyu@jp.fujitsu.com>
On Mon, Dec 21, 2009 at 02:31:39PM +0900, KAMEZAWA Hiroyuki wrote:
> On Mon, 21 Dec 2009 11:32:27 +0800
> Huang Shijie <shijie8@gmail.com> wrote:
>
> > In more then half of all the cases, `page' is head of the buddy pair
> > {page, buddy} in __free_one_page. That is because the allocation logic
> > always picks the head of a chunk, and puts the rest back to the buddy system.
> >
> > So calculating the combined page is not needed but waste some cycles in
> > more then half of all the cases.Just do the calculation when `page' is
> > bigger then the `buddy'.
> >
> > Signed-off-by: Huang Shijie <shijie8@gmail.com>
>
> Hmm...As far as I remember, this code design was for avoiding "if".
> Is this compare+jump is better than add+xor ?
>
Agreed. It's not clear that a compare+jump is cheaper than the add+xor.
How often it's the case that the page is the higher or lower half of the
buddy would depend heavily on the allocation/free pattern making it
hard, if not possible, to predict which is the more common case.
--
Mel Gorman
Part-time Phd Student Linux Technology Center
University of Limerick IBM Dublin Software Lab
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2009-12-21 19:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-21 3:32 [PATCH] mm : kill combined_idx Huang Shijie
2009-12-21 5:31 ` KAMEZAWA Hiroyuki
2009-12-21 19:43 ` Mel Gorman [this message]
2009-12-22 3:11 ` Huang Shijie
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=20091221194337.GA23345@csn.ul.ie \
--to=mel@csn.ul.ie \
--cc=akpm@linux-foundation.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=shijie8@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.