All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Hillf Danton <dhillf@gmail.com>
Cc: linux-mm@kvack.org, David Rientjes <rientjes@google.com>,
	Hugh Dickins <hughd@google.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Michal Hocko <mhocko@suse.cz>,
	LKML <linux-kernel@vger.kernel.org>,
	Andrea Arcangeli <aarcange@redhat.com>
Subject: Re: [PATCH] mm: vmscan: fix typo in isolating lru pages
Date: Thu, 29 Dec 2011 15:07:17 -0800	[thread overview]
Message-ID: <20111229150717.6c8ba825.akpm@linux-foundation.org> (raw)
In-Reply-To: <CAJd=RBAp=ooYGoDqJG0qkUhRuYTsSKG9h+bUvC0dvuVCvfkCgQ@mail.gmail.com>

On Thu, 29 Dec 2011 20:38:41 +0800
Hillf Danton <dhillf@gmail.com> wrote:

> It is not the tag page but the cursor page that we should process, and it looks
> a typo.
> 
> Signed-off-by: Hillf Danton <dhillf@gmail.com>
> Cc: Michal Hocko <mhocko@suse.cz>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: David Rientjes <rientjes@google.com>
> Cc: Hugh Dickins <hughd@google.com>
> ---
> 
> --- a/mm/vmscan.c	Thu Dec 29 20:20:16 2011
> +++ b/mm/vmscan.c	Thu Dec 29 20:23:30 2011
> @@ -1231,13 +1231,13 @@ static unsigned long isolate_lru_pages(u
> 
>  				mem_cgroup_lru_del(cursor_page);
>  				list_move(&cursor_page->lru, dst);
> -				isolated_pages = hpage_nr_pages(page);
> +				isolated_pages = hpage_nr_pages(cursor_page);
>  				nr_taken += isolated_pages;
>  				nr_lumpy_taken += isolated_pages;
>  				if (PageDirty(cursor_page))
>  					nr_lumpy_dirty += isolated_pages;
>  				scan++;
> -				pfn += isolated_pages-1;
> +				pfn += isolated_pages - 1;
>  			} else {
>  				/*
>  				 * Check if the page is freed already.

This problem looks pretty benign in mainline.  But Andrea's "mm:
vmscan: check if we isolated a compound page during lumpy scan" came
along and uses isolated_pages rather a lot more, including using it to
advance across the pfn array.

I jiggled your patch to suit current mainline then reworked everything
else so we end up with this result.

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: Hillf Danton <dhillf@gmail.com>
Cc: linux-mm@kvack.org, David Rientjes <rientjes@google.com>,
	Hugh Dickins <hughd@google.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Michal Hocko <mhocko@suse.cz>,
	LKML <linux-kernel@vger.kernel.org>,
	Andrea Arcangeli <aarcange@redhat.com>
Subject: Re: [PATCH] mm: vmscan: fix typo in isolating lru pages
Date: Thu, 29 Dec 2011 15:07:17 -0800	[thread overview]
Message-ID: <20111229150717.6c8ba825.akpm@linux-foundation.org> (raw)
In-Reply-To: <CAJd=RBAp=ooYGoDqJG0qkUhRuYTsSKG9h+bUvC0dvuVCvfkCgQ@mail.gmail.com>

On Thu, 29 Dec 2011 20:38:41 +0800
Hillf Danton <dhillf@gmail.com> wrote:

> It is not the tag page but the cursor page that we should process, and it looks
> a typo.
> 
> Signed-off-by: Hillf Danton <dhillf@gmail.com>
> Cc: Michal Hocko <mhocko@suse.cz>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: David Rientjes <rientjes@google.com>
> Cc: Hugh Dickins <hughd@google.com>
> ---
> 
> --- a/mm/vmscan.c	Thu Dec 29 20:20:16 2011
> +++ b/mm/vmscan.c	Thu Dec 29 20:23:30 2011
> @@ -1231,13 +1231,13 @@ static unsigned long isolate_lru_pages(u
> 
>  				mem_cgroup_lru_del(cursor_page);
>  				list_move(&cursor_page->lru, dst);
> -				isolated_pages = hpage_nr_pages(page);
> +				isolated_pages = hpage_nr_pages(cursor_page);
>  				nr_taken += isolated_pages;
>  				nr_lumpy_taken += isolated_pages;
>  				if (PageDirty(cursor_page))
>  					nr_lumpy_dirty += isolated_pages;
>  				scan++;
> -				pfn += isolated_pages-1;
> +				pfn += isolated_pages - 1;
>  			} else {
>  				/*
>  				 * Check if the page is freed already.

This problem looks pretty benign in mainline.  But Andrea's "mm:
vmscan: check if we isolated a compound page during lumpy scan" came
along and uses isolated_pages rather a lot more, including using it to
advance across the pfn array.

I jiggled your patch to suit current mainline then reworked everything
else so we end up with this result.


  parent reply	other threads:[~2011-12-29 23:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-29 12:38 [PATCH] mm: vmscan: fix typo in isolating lru pages Hillf Danton
2011-12-29 12:38 ` Hillf Danton
2011-12-29 17:21 ` KOSAKI Motohiro
2011-12-29 17:21   ` KOSAKI Motohiro
2011-12-29 23:07 ` Andrew Morton [this message]
2011-12-29 23:07   ` Andrew Morton
2011-12-31 14:25   ` Hillf Danton
2011-12-31 14:25     ` Hillf Danton
2012-01-05  6:09 ` KAMEZAWA Hiroyuki
2012-01-05  6:09   ` KAMEZAWA Hiroyuki

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=20111229150717.6c8ba825.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=aarcange@redhat.com \
    --cc=dhillf@gmail.com \
    --cc=hughd@google.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=rientjes@google.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 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.