From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Mel Gorman <mel@csn.ul.ie>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
LKML <linux-kernel@vger.kernel.org>,
Christoph Lameter <cl@linux-foundation.org>,
linux-mm <linux-mm@kvack.org>
Subject: Re: [RFC][PATCH] mm: the page of MIGRATE_RESERVE don't insert into pcp
Date: Fri, 7 Nov 2008 10:42:24 +0900 [thread overview]
Message-ID: <20081107104224.1631057e.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <20081106164644.GA14012@csn.ul.ie>
On Thu, 6 Nov 2008 16:46:45 +0000
Mel Gorman <mel@csn.ul.ie> wrote:
> > otherwise, the system have unnecessary memory starvation risk
> > because other cpu can't use this emergency pages.
> >
> >
> >
> > Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> > CC: Mel Gorman <mel@csn.ul.ie>
> > CC: Christoph Lameter <cl@linux-foundation.org>
> >
>
> This patch seems functionally sound but as Christoph points out, this
> adds another branch to the fast path. Now, I ran some tests and those that
> completed didn't show any problems but adding branches in the fast path can
> eventually lead to hard-to-detect performance problems.
>
dividing pcp-list into MIGRATE_TYPES is bad ?
If divided, we can get rid of scan.
Thanks,
-Kame
> Do you have a situation in mind that this patch fixes up?
>
> Thanks
>
> > ---
> > mm/page_alloc.c | 12 +++++++++++-
> > 1 file changed, 11 insertions(+), 1 deletion(-)
> >
> > Index: b/mm/page_alloc.c
> > ===================================================================
> > --- a/mm/page_alloc.c 2008-11-06 06:01:15.000000000 +0900
> > +++ b/mm/page_alloc.c 2008-11-06 06:27:41.000000000 +0900
> > @@ -1002,6 +1002,7 @@ static void free_hot_cold_page(struct pa
> > struct zone *zone = page_zone(page);
> > struct per_cpu_pages *pcp;
> > unsigned long flags;
> > + int migratetype = get_pageblock_migratetype(page);
> >
> > if (PageAnon(page))
> > page->mapping = NULL;
> > @@ -1018,16 +1019,25 @@ static void free_hot_cold_page(struct pa
> > pcp = &zone_pcp(zone, get_cpu())->pcp;
> > local_irq_save(flags);
> > __count_vm_event(PGFREE);
> > +
> > + set_page_private(page, migratetype);
> > +
> > + /* the page for emergency shouldn't be cached */
> > + if (migratetype == MIGRATE_RESERVE) {
> > + free_one_page(zone, page, 0);
> > + goto out;
> > + }
> > if (cold)
> > list_add_tail(&page->lru, &pcp->list);
> > else
> > list_add(&page->lru, &pcp->list);
> > - set_page_private(page, get_pageblock_migratetype(page));
> > pcp->count++;
> > if (pcp->count >= pcp->high) {
> > free_pages_bulk(zone, pcp->batch, &pcp->list, 0);
> > pcp->count -= pcp->batch;
> > }
> > +
> > +out:
> > local_irq_restore(flags);
> > put_cpu();
> > }
> >
> >
>
> --
> 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>
>
--
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:[~2008-11-07 1:43 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-06 0:16 KOSAKI Motohiro
2008-11-06 14:56 ` Christoph Lameter
2008-11-06 16:46 ` Mel Gorman
2008-11-07 1:42 ` KAMEZAWA Hiroyuki [this message]
2008-11-07 10:42 ` Mel Gorman
2008-11-07 11:02 ` KAMEZAWA Hiroyuki
2008-11-07 11:27 ` Mel Gorman
2008-11-07 18:45 ` Christoph Lameter
2008-11-11 8:13 ` KOSAKI Motohiro
2008-12-05 15:40 ` Mel Gorman
2008-12-07 8:22 ` KOSAKI Motohiro
2008-12-11 15:39 ` Mel Gorman
2008-11-07 4:37 ` KOSAKI Motohiro
2008-11-07 10:47 ` Mel Gorman
2008-11-11 13:39 ` KOSAKI Motohiro
2008-11-11 14:42 ` Mel Gorman
2008-11-14 4:31 ` KOSAKI Motohiro
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=20081107104224.1631057e.kamezawa.hiroyu@jp.fujitsu.com \
--to=kamezawa.hiroyu@jp.fujitsu.com \
--cc=cl@linux-foundation.org \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
/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