linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: Minchan Kim <minchan@kernel.org>
Cc: linux-mm@kvack.org, m.szyprowski@samsung.com, mina86@mina86.com,
	mgorman@suse.de, hughd@google.com, kyungmin.park@samsung.com
Subject: Re: [PATCH v3 2/5] cma: fix counting of isolated pages
Date: Fri, 14 Sep 2012 14:41:49 +0200	[thread overview]
Message-ID: <201209141441.50263.b.zolnierkie@samsung.com> (raw)
In-Reply-To: <20120914022620.GG5085@bbox>

On Friday 14 September 2012 04:26:20 Minchan Kim wrote:
> On Tue, Sep 04, 2012 at 03:26:22PM +0200, Bartlomiej Zolnierkiewicz wrote:
> > Isolated free pages shouldn't be accounted to NR_FREE_PAGES counter.
> > Fix it by properly decreasing/increasing NR_FREE_PAGES counter in
> > set_migratetype_isolate()/unset_migratetype_isolate() and removing
> > counter adjustment for isolated pages from free_one_page() and
> > split_free_page().
> > 
> > Cc: Marek Szyprowski <m.szyprowski@samsung.com>
> > Cc: Michal Nazarewicz <mina86@mina86.com>
> > Cc: Minchan Kim <minchan@kernel.org>
> > Cc: Mel Gorman <mgorman@suse.de>
> > Cc: Hugh Dickins <hughd@google.com>
> > Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> > ---
> >  mm/page_alloc.c     |  7 +++++--
> >  mm/page_isolation.c | 13 ++++++++++---
> >  2 files changed, 15 insertions(+), 5 deletions(-)
> > 
> > diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> > index e9da55c..3acdf0f 100644
> > --- a/mm/page_alloc.c
> > +++ b/mm/page_alloc.c
> > @@ -691,7 +691,8 @@ static void free_one_page(struct zone *zone, struct page *page, int order,
> >  	zone->pages_scanned = 0;
> >  
> >  	__free_one_page(page, zone, order, migratetype);
> > -	__mod_zone_page_state(zone, NR_FREE_PAGES, 1 << order);
> > +	if (migratetype != MIGRATE_ISOLATE)
> 
> We can add unlikely.

Ok.

> > +		__mod_zone_page_state(zone, NR_FREE_PAGES, 1 << order);
> >  	spin_unlock(&zone->lock);
> >  }
> >  
> > @@ -1414,7 +1415,9 @@ int split_free_page(struct page *page, bool check_wmark)
> >  	list_del(&page->lru);
> >  	zone->free_area[order].nr_free--;
> >  	rmv_page_order(page);
> > -	__mod_zone_page_state(zone, NR_FREE_PAGES, -(1UL << order));
> > +
> > +	if (get_pageblock_migratetype(page) != MIGRATE_ISOLATE)
> 
> The get_pageblock_migratetype isn't cheap.
> You can use get_freepage_migratetype.

get_freepage_migratetype() is not yet upstream and I don't want to add
more dependencies to these patches so I'll update this later.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung Poland R&D Center

--
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>

  reply	other threads:[~2012-09-14 14:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-04 13:26 [PATCH v3 0/5] cma: fix watermark checking Bartlomiej Zolnierkiewicz
2012-09-04 13:26 ` [PATCH v3 1/5] mm: fix tracing in free_pcppages_bulk() Bartlomiej Zolnierkiewicz
2012-09-05 10:59   ` Mel Gorman
2012-09-14  1:50   ` Minchan Kim
2012-09-04 13:26 ` [PATCH v3 2/5] cma: fix counting of isolated pages Bartlomiej Zolnierkiewicz
2012-09-05 11:08   ` Mel Gorman
2012-09-06 16:41     ` Bartlomiej Zolnierkiewicz
2012-09-14  2:26   ` Minchan Kim
2012-09-14 12:41     ` Bartlomiej Zolnierkiewicz [this message]
2012-09-04 13:26 ` [PATCH v3 3/5] cma: count free CMA pages Bartlomiej Zolnierkiewicz
2012-09-14  3:02   ` Minchan Kim
2012-09-14 13:10     ` Bartlomiej Zolnierkiewicz
2012-09-04 13:26 ` [PATCH v3 4/5] mm: add accounting for CMA pages and use them for watermark calculation Bartlomiej Zolnierkiewicz
2012-09-14  3:43   ` Minchan Kim
2012-09-04 13:26 ` [PATCH v3 5/5] cma: fix watermark checking Bartlomiej Zolnierkiewicz
2012-09-14  4:13   ` Minchan Kim
2012-09-14 14:12     ` Bartlomiej Zolnierkiewicz

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=201209141441.50263.b.zolnierkie@samsung.com \
    --to=b.zolnierkie@samsung.com \
    --cc=hughd@google.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-mm@kvack.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mgorman@suse.de \
    --cc=mina86@mina86.com \
    --cc=minchan@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