All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Nazarewicz <mina86@mina86.com>
To: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>, linux-mm@kvack.org
Cc: m.szyprowski@samsung.com, minchan@kernel.org, mgorman@suse.de,
	kyungmin.park@samsung.com
Subject: Re: [PATCH 1/4] cma: fix counting of isolated pages
Date: Fri, 24 Aug 2012 18:26:29 +0200	[thread overview]
Message-ID: <xa1tzk5k2r4a.fsf@mina86.com> (raw)
In-Reply-To: <1345805120-797-2-git-send-email-b.zolnierkie@samsung.com>

[-- Attachment #1: Type: text/plain, Size: 1479 bytes --]

Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> writes:
> 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().

Other than a minor comment, looks reasonable to me.

> ---
>  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 b94429e..e9bbd7c 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -688,7 +688,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 (get_pageblock_migratetype(page) != MIGRATE_ISOLATE)

No need to call get_pageblock_migratetype().  You have this information
in migratetype variable.

> +		__mod_zone_page_state(zone, NR_FREE_PAGES, 1 << order);
>  	spin_unlock(&zone->lock);
>  }
>  

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--

[-- Attachment #2.1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2.2: Type: application/pgp-signature, Size: 835 bytes --]

  reply	other threads:[~2012-08-24 16:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-24 10:45 [PATCH 0/4] cma: fix watermark checking Bartlomiej Zolnierkiewicz
2012-08-24 10:45 ` [PATCH 1/4] cma: fix counting of isolated pages Bartlomiej Zolnierkiewicz
2012-08-24 16:26   ` Michal Nazarewicz [this message]
2012-08-24 10:45 ` [PATCH 2/4] cma: count free CMA pages Bartlomiej Zolnierkiewicz
2012-08-24 16:42   ` Michal Nazarewicz
2012-08-24 10:45 ` [PATCH 3/4] mm: add accounting for CMA pages and use them for watermark calculation Bartlomiej Zolnierkiewicz
2012-08-24 10:45 ` [PATCH 4/4] cma: fix watermark checking 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=xa1tzk5k2r4a.fsf@mina86.com \
    --to=mina86@mina86.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-mm@kvack.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mgorman@suse.de \
    --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 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.