All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: linux-mm@kvack.org, m.szyprowski@samsung.com, mina86@mina86.com,
	minchan@kernel.org, mgorman@suse.de, hughd@google.com,
	kyungmin.park@samsung.com
Subject: Re: [PATCH v4 1/4] mm: fix tracing in free_pcppages_bulk()
Date: Wed, 19 Sep 2012 12:28:01 -0700	[thread overview]
Message-ID: <20120919122801.ec1aa1df.akpm@linux-foundation.org> (raw)
In-Reply-To: <1347632974-20465-2-git-send-email-b.zolnierkie@samsung.com>

On Fri, 14 Sep 2012 16:29:31 +0200
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> wrote:

> page->private gets re-used in __free_one_page() to store page order
> (so trace_mm_page_pcpu_drain() may print order instead of migratetype)
> thus migratetype value must be cached locally.
> 
> Fixes regression introduced in a701623 ("mm: fix migratetype bug
> which slowed swapping").

Grumble.  Please describe a bug when fixing it!  I've added here the
text "This caused incorrect data to be attached to the
mm_page_pcpu_drain trace event", which is hopefully correct enough.

As it's been this way for 2.5 years, I assume that this can wait for
3.7.

> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -668,12 +668,15 @@ static void free_pcppages_bulk(struct zone *zone, int count,
>  			batch_free = to_free;
>  
>  		do {
> +			int mt;
> +
>  			page = list_entry(list->prev, struct page, lru);
>  			/* must delete as __free_one_page list manipulates */
>  			list_del(&page->lru);
> +			mt = page_private(page);
>  			/* MIGRATE_MOVABLE list may include MIGRATE_RESERVEs */
> -			__free_one_page(page, zone, 0, page_private(page));
> -			trace_mm_page_pcpu_drain(page, 0, page_private(page));
> +			__free_one_page(page, zone, 0, mt);
> +			trace_mm_page_pcpu_drain(page, 0, mt);
>  		} while (--to_free && --batch_free && !list_empty(list));
>  	}
>  	__mod_zone_page_state(zone, NR_FREE_PAGES, count);

More grumble.  Look:

akpm:/usr/src/25> grep migratetype mm/page_alloc.c | wc -l
115

We should respect the established naming conventions.  But reusing
local var `maigratetype' here is not good practice, so how about

--- a/mm/page_alloc.c~mm-fix-tracing-in-free_pcppages_bulk-fix
+++ a/mm/page_alloc.c
@@ -668,7 +668,7 @@ static void free_pcppages_bulk(struct zo
 			batch_free = to_free;
 
 		do {
-			int mt;
+			int mt;	/* migratetype of the to-be-freed page */
 
 			page = list_entry(list->prev, struct page, lru);
 			/* must delete as __free_one_page list manipulates */
_

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

  parent reply	other threads:[~2012-09-19 19:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-14 14:29 [PATCH v4 0/4] cma: fix watermark checking Bartlomiej Zolnierkiewicz
2012-09-14 14:29 ` [PATCH v4 1/4] mm: fix tracing in free_pcppages_bulk() Bartlomiej Zolnierkiewicz
2012-09-19  7:07   ` Yasuaki Ishimatsu
2012-09-19  7:32     ` Minchan Kim
2012-09-19  7:45       ` Yasuaki Ishimatsu
2012-09-19  8:03         ` Minchan Kim
2012-09-19 18:07   ` KOSAKI Motohiro
2012-09-19 19:28   ` Andrew Morton [this message]
2012-09-14 14:29 ` [PATCH v4 2/4] cma: fix counting of isolated pages Bartlomiej Zolnierkiewicz
2012-09-14 14:29 ` [PATCH v4 3/4] cma: count free CMA pages Bartlomiej Zolnierkiewicz
2012-09-14 14:29 ` [PATCH v4 4/4] cma: fix watermark checking Bartlomiej Zolnierkiewicz
2012-09-19 19:51   ` Andrew Morton
2012-09-24  9:30     ` Bartlomiej Zolnierkiewicz
2012-09-24 21:30       ` 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=20120919122801.ec1aa1df.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=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 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.