From: Mel Gorman <mel@csn.ul.ie>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: NARAYANAN GOPALAKRISHNAN <narayanan.g@samsung.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"cl@linux-foundation.org" <cl@linux-foundation.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"kosaki.motohiro@jp.fujitsu.com" <kosaki.motohiro@jp.fujitsu.com>
Subject: Re: Performance degradation seen after using one list for hot/cold pages.
Date: Mon, 29 Jun 2009 10:15:43 +0100 [thread overview]
Message-ID: <20090629091542.GC28597@csn.ul.ie> (raw)
In-Reply-To: <20090623090630.f06b7b17.kamezawa.hiroyu@jp.fujitsu.com>
On Tue, Jun 23, 2009 at 09:06:30AM +0900, KAMEZAWA Hiroyuki wrote:
> On Mon, 22 Jun 2009 17:52:36 +0100
> Mel Gorman <mel@csn.ul.ie> wrote:
>
> > On Mon, Jun 22, 2009 at 11:32:03AM +0000, NARAYANAN GOPALAKRISHNAN wrote:
> > > Hi,
> > >
> > > We are running on VFAT.
> > > We are using iozone performance benchmarking tool (http://www.iozone.org/src/current/iozone3_326.tar) for testing.
> > >
> > > The parameters are
> > > /iozone -A -s10M -e -U /tmp -f /tmp/iozone_file
> > >
> > > Our block driver requires requests to be merged to get the best performance.
> > > This was not happening due to non-contiguous pages in all kernels >= 2.6.25.
> > >
> >
> > Ok, by the looks of things, all the aio_read() requests are due to readahead
> > as opposed to explicit AIO requests from userspace. In this case, nothing
> > springs to mind that would avoid excessive requests for cold pages.
> >
> > It looks like the simpliest solution is to go with the patch I posted.
> > Does anyone see a better alternative that doesn't branch in rmqueue_bulk()
> > or add back the hot/cold PCP lists?
> >
> No objection. But 2 questions...
>
> > - list_add(&page->lru, list);
> > + if (likely(cold == 0))
> > + list_add(&page->lru, list);
> > + else
> > + list_add_tail(&page->lru, list);
> > set_page_private(page, migratetype);
> > list = &page->lru;
> > }
>
> 1. if (likely(coild == 0))
> "likely" is necessary ?
>
Is likely/unlikely ever really necessary? The branch is small so maybe it
doesn't matter but the expectation is that the !cold path is hotter and more
commonly used. I can drop this is you like.
> 2. Why moving pointer "list" rather than following ?
>
> if (cold)
> list_add(&page->lru, list);
> else
> list_add_tail(&page->lru, list);
>
So that the list head from the caller is at the beginning of the newly
allocated contiguous pages. Lets say the free list looked something like
head -> 212 -> 200 -> 198
and then we add a few pages that are contiguous using list_add_tail
1 -> 2 -> 3 -> head -> 212 -> 200 -> 198
With this arrangement, we have to consume the existing pages before we get to
the contiguous pages and the struct pages that were more recently accessed
are further down the list so we potentially access a new cache line after
returning so the struct page for PFN 212 is accessed. With the list head
moving forward it, the returned list should look more like
head -> 1 -> 2 -> 3 -> 212 -> 200 -> 198
so we are accessing the contiguous pages first and a recently accessed struct
page. This was the intention at least of the list head moving forward.
--
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-06-29 9:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-22 11:32 Re: Re: Performance degradation seen after using one list for hot/cold pages NARAYANAN GOPALAKRISHNAN
2009-06-22 16:52 ` Mel Gorman
2009-06-23 0:06 ` KAMEZAWA Hiroyuki
2009-06-23 17:41 ` Christoph Lameter
2009-06-25 9:11 ` Minchan Kim
2009-06-29 9:15 ` Mel Gorman [this message]
2009-07-08 2:37 ` Performance degradation seen after using one list for hot/coldpages Narayanan Gopalakrishnan
2009-07-08 14:53 ` Christoph Lameter
2009-07-08 15:27 ` Mel Gorman
2009-07-08 21:32 ` Andrew Morton
-- strict thread matches above, loose matches on Subject: below --
2009-06-22 5:50 Performance degradation seen after using one list for hot/cold pages Narayanan Gopalakrishnan
2009-06-22 7:41 ` KAMEZAWA Hiroyuki
2009-06-22 10:06 ` Mel Gorman
2009-07-08 21:29 ` Andrew Morton
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=20090629091542.GC28597@csn.ul.ie \
--to=mel@csn.ul.ie \
--cc=akpm@linux-foundation.org \
--cc=cl@linux-foundation.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=narayanan.g@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).