All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mel Gorman <mgorman@suse.de>
To: Minchan Kim <minchan.kim@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Christoph Lameter <cl@linux.com>,
	Johannes Weiner <jweiner@redhat.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Rik van Riel <riel@redhat.com>,
	Andrea Arcangeli <aarcange@redhat.com>
Subject: Re: [RFC 3/8] vmscan: make isolate_lru_page with filter aware
Date: Thu, 28 Apr 2011 11:35:05 +0100	[thread overview]
Message-ID: <20110428103505.GS4658@suse.de> (raw)
In-Reply-To: <232562452317897b5acb1445803410d74233a923.1303833417.git.minchan.kim@gmail.com>

On Wed, Apr 27, 2011 at 01:25:20AM +0900, Minchan Kim wrote:
> In some __zone_reclaim case, we don't want to shrink mapped page.
> Nonetheless, we have isolated mapped page and re-add it into
> LRU's head. It's unnecessary CPU overhead and makes LRU churning.
> 
> Of course, when we isolate the page, the page might be mapped but
> when we try to migrate the page, the page would be not mapped.
> So it could be migrated. But race is rare and although it happens,
> it's no big deal.
> 
> Cc: Christoph Lameter <cl@linux.com>
> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> Cc: Mel Gorman <mgorman@suse.de>
> Cc: Rik van Riel <riel@redhat.com>
> Cc: Andrea Arcangeli <aarcange@redhat.com>
> Signed-off-by: Minchan Kim <minchan.kim@gmail.com>

> index 71d2da9..e8d6190 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -1147,7 +1147,8 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan,
>  
>  static unsigned long isolate_pages_global(unsigned long nr,
>  					struct list_head *dst,
> -					unsigned long *scanned, int order,
> +					unsigned long *scanned,
> +					struct scan_control *sc,
>  					int mode, struct zone *z,
>  					int active, int file)
>  {
> @@ -1156,8 +1157,8 @@ static unsigned long isolate_pages_global(unsigned long nr,
>  		lru += LRU_ACTIVE;
>  	if (file)
>  		lru += LRU_FILE;
> -	return isolate_lru_pages(nr, &z->lru[lru].list, dst, scanned, order,
> -					mode, file, 0, 0);
> +	return isolate_lru_pages(nr, &z->lru[lru].list, dst, scanned, sc->order,
> +					mode, file, 0, !sc->may_unmap);
>  }
>  

Why not take may_writepage into account for dirty pages?

>  /*
> @@ -1407,7 +1408,7 @@ shrink_inactive_list(unsigned long nr_to_scan, struct zone *zone,
>  
>  	if (scanning_global_lru(sc)) {
>  		nr_taken = isolate_pages_global(nr_to_scan,
> -			&page_list, &nr_scanned, sc->order,
> +			&page_list, &nr_scanned, sc,
>  			sc->reclaim_mode & RECLAIM_MODE_LUMPYRECLAIM ?
>  					ISOLATE_BOTH : ISOLATE_INACTIVE,
>  			zone, 0, file);
> @@ -1531,7 +1532,7 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone,
>  	spin_lock_irq(&zone->lru_lock);
>  	if (scanning_global_lru(sc)) {
>  		nr_taken = isolate_pages_global(nr_pages, &l_hold,
> -						&pgscanned, sc->order,
> +						&pgscanned, sc,
>  						ISOLATE_ACTIVE, zone,
>  						1, file);
>  		zone->pages_scanned += pgscanned;
> -- 
> 1.7.1
> 

-- 
Mel Gorman
SUSE Labs

WARNING: multiple messages have this Message-ID (diff)
From: Mel Gorman <mgorman@suse.de>
To: Minchan Kim <minchan.kim@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Christoph Lameter <cl@linux.com>,
	Johannes Weiner <jweiner@redhat.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Rik van Riel <riel@redhat.com>,
	Andrea Arcangeli <aarcange@redhat.com>
Subject: Re: [RFC 3/8] vmscan: make isolate_lru_page with filter aware
Date: Thu, 28 Apr 2011 11:35:05 +0100	[thread overview]
Message-ID: <20110428103505.GS4658@suse.de> (raw)
In-Reply-To: <232562452317897b5acb1445803410d74233a923.1303833417.git.minchan.kim@gmail.com>

On Wed, Apr 27, 2011 at 01:25:20AM +0900, Minchan Kim wrote:
> In some __zone_reclaim case, we don't want to shrink mapped page.
> Nonetheless, we have isolated mapped page and re-add it into
> LRU's head. It's unnecessary CPU overhead and makes LRU churning.
> 
> Of course, when we isolate the page, the page might be mapped but
> when we try to migrate the page, the page would be not mapped.
> So it could be migrated. But race is rare and although it happens,
> it's no big deal.
> 
> Cc: Christoph Lameter <cl@linux.com>
> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> Cc: Mel Gorman <mgorman@suse.de>
> Cc: Rik van Riel <riel@redhat.com>
> Cc: Andrea Arcangeli <aarcange@redhat.com>
> Signed-off-by: Minchan Kim <minchan.kim@gmail.com>

> index 71d2da9..e8d6190 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -1147,7 +1147,8 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan,
>  
>  static unsigned long isolate_pages_global(unsigned long nr,
>  					struct list_head *dst,
> -					unsigned long *scanned, int order,
> +					unsigned long *scanned,
> +					struct scan_control *sc,
>  					int mode, struct zone *z,
>  					int active, int file)
>  {
> @@ -1156,8 +1157,8 @@ static unsigned long isolate_pages_global(unsigned long nr,
>  		lru += LRU_ACTIVE;
>  	if (file)
>  		lru += LRU_FILE;
> -	return isolate_lru_pages(nr, &z->lru[lru].list, dst, scanned, order,
> -					mode, file, 0, 0);
> +	return isolate_lru_pages(nr, &z->lru[lru].list, dst, scanned, sc->order,
> +					mode, file, 0, !sc->may_unmap);
>  }
>  

Why not take may_writepage into account for dirty pages?

>  /*
> @@ -1407,7 +1408,7 @@ shrink_inactive_list(unsigned long nr_to_scan, struct zone *zone,
>  
>  	if (scanning_global_lru(sc)) {
>  		nr_taken = isolate_pages_global(nr_to_scan,
> -			&page_list, &nr_scanned, sc->order,
> +			&page_list, &nr_scanned, sc,
>  			sc->reclaim_mode & RECLAIM_MODE_LUMPYRECLAIM ?
>  					ISOLATE_BOTH : ISOLATE_INACTIVE,
>  			zone, 0, file);
> @@ -1531,7 +1532,7 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone,
>  	spin_lock_irq(&zone->lru_lock);
>  	if (scanning_global_lru(sc)) {
>  		nr_taken = isolate_pages_global(nr_pages, &l_hold,
> -						&pgscanned, sc->order,
> +						&pgscanned, sc,
>  						ISOLATE_ACTIVE, zone,
>  						1, file);
>  		zone->pages_scanned += pgscanned;
> -- 
> 1.7.1
> 

-- 
Mel Gorman
SUSE Labs

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

  parent reply	other threads:[~2011-04-28 10:35 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-26 16:25 [RFC 0/8] Prevent LRU churing Minchan Kim
2011-04-26 16:25 ` Minchan Kim
2011-04-26 16:25 ` [RFC 1/8] Only isolate page we can handle Minchan Kim
2011-04-26 16:25   ` Minchan Kim
2011-04-27  7:54   ` KAMEZAWA Hiroyuki
2011-04-27  7:54     ` KAMEZAWA Hiroyuki
2011-04-27  8:12     ` Minchan Kim
2011-04-27  8:12       ` Minchan Kim
2011-04-27  8:13   ` Minchan Kim
2011-04-27  8:13     ` Minchan Kim
2011-04-28 10:26   ` Mel Gorman
2011-04-28 10:26     ` Mel Gorman
2011-04-26 16:25 ` [RFC 2/8] compaction: make isolate_lru_page with filter aware Minchan Kim
2011-04-26 16:25   ` Minchan Kim
2011-04-27  7:55   ` KAMEZAWA Hiroyuki
2011-04-27  7:55     ` KAMEZAWA Hiroyuki
2011-04-28  8:48   ` Johannes Weiner
2011-04-28  8:48     ` Johannes Weiner
2011-04-29 15:15     ` Minchan Kim
2011-04-29 15:15       ` Minchan Kim
2011-05-01  7:27       ` KOSAKI Motohiro
2011-05-01  7:27         ` KOSAKI Motohiro
2011-04-28 10:31   ` Mel Gorman
2011-04-28 10:31     ` Mel Gorman
2011-04-26 16:25 ` [RFC 3/8] vmscan: " Minchan Kim
2011-04-26 16:25   ` Minchan Kim
2011-04-27  8:03   ` KAMEZAWA Hiroyuki
2011-04-27  8:03     ` KAMEZAWA Hiroyuki
2011-04-27 23:18     ` Minchan Kim
2011-04-27 23:18       ` Minchan Kim
2011-04-28  8:54     ` Johannes Weiner
2011-04-28  8:54       ` Johannes Weiner
2011-04-28  9:10       ` KAMEZAWA Hiroyuki
2011-04-28  9:10         ` KAMEZAWA Hiroyuki
2011-04-28 10:26         ` Johannes Weiner
2011-04-28 10:26           ` Johannes Weiner
2011-04-28 10:35   ` Mel Gorman [this message]
2011-04-28 10:35     ` Mel Gorman
2011-04-29 15:18     ` Minchan Kim
2011-04-29 15:18       ` Minchan Kim
2011-04-26 16:25 ` [RFC 4/8] Make clear description of putback_lru_page Minchan Kim
2011-04-26 16:25   ` Minchan Kim
2011-04-27  8:11   ` KAMEZAWA Hiroyuki
2011-04-27  8:11     ` KAMEZAWA Hiroyuki
2011-04-27 23:20     ` Minchan Kim
2011-04-27 23:20       ` Minchan Kim
2011-04-28  8:45       ` Johannes Weiner
2011-04-28  8:45         ` Johannes Weiner
2011-05-01 13:13         ` KOSAKI Motohiro
2011-05-01 13:13           ` KOSAKI Motohiro
2011-05-01 15:10           ` Minchan Kim
2011-05-01 15:10             ` Minchan Kim
2011-04-26 16:25 ` [RFC 5/8] compaction: remove active list counting Minchan Kim
2011-04-26 16:25   ` Minchan Kim
2011-04-27  8:15   ` KAMEZAWA Hiroyuki
2011-04-27  8:15     ` KAMEZAWA Hiroyuki
2011-04-27 23:42     ` Minchan Kim
2011-04-27 23:42       ` Minchan Kim
2011-04-28  9:02       ` Johannes Weiner
2011-04-28  9:02         ` Johannes Weiner
2011-04-28  8:58   ` Johannes Weiner
2011-04-28  8:58     ` Johannes Weiner
2011-04-29 15:19     ` Minchan Kim
2011-04-29 15:19       ` Minchan Kim
2011-04-28 10:50   ` Mel Gorman
2011-04-28 10:50     ` Mel Gorman
2011-04-29 15:25     ` Minchan Kim
2011-04-29 15:25       ` Minchan Kim
2011-05-01 13:19       ` KOSAKI Motohiro
2011-05-01 13:19         ` KOSAKI Motohiro
2011-05-01 15:09         ` Minchan Kim
2011-05-01 15:09           ` Minchan Kim
2011-04-26 16:25 ` [RFC 6/8] In order putback lru core Minchan Kim
2011-04-26 16:25   ` Minchan Kim
2011-04-27  4:20   ` Minchan Kim
2011-04-27  4:20     ` Minchan Kim
2011-04-27  8:34   ` KAMEZAWA Hiroyuki
2011-04-27  8:34     ` KAMEZAWA Hiroyuki
2011-04-27 23:43     ` Minchan Kim
2011-04-27 23:43       ` Minchan Kim
2011-04-27 23:46   ` Rik van Riel
2011-04-27 23:46     ` Rik van Riel
2011-04-27 23:59     ` Minchan Kim
2011-04-27 23:59       ` Minchan Kim
2011-04-28 11:06   ` Mel Gorman
2011-04-28 11:06     ` Mel Gorman
2011-04-29 15:47     ` Minchan Kim
2011-04-29 15:47       ` Minchan Kim
2011-05-01 13:47     ` KOSAKI Motohiro
2011-05-01 13:47       ` KOSAKI Motohiro
2011-05-01 15:29       ` Minchan Kim
2011-05-01 15:29         ` Minchan Kim
2011-05-09  3:21         ` KOSAKI Motohiro
2011-05-09  3:21           ` KOSAKI Motohiro
2011-04-26 16:25 ` [RFC 7/8] migration: make in-order-putback aware Minchan Kim
2011-04-26 16:25   ` Minchan Kim
2011-04-26 16:25 ` [RFC 8/8] compaction: make compaction use in-order putback Minchan Kim
2011-04-26 16:25   ` Minchan Kim
2011-04-27  4:22   ` Minchan Kim
2011-04-27  4:22     ` Minchan Kim
2011-04-27  8:39   ` KAMEZAWA Hiroyuki
2011-04-27  8:39     ` KAMEZAWA Hiroyuki
2011-04-27  9:08     ` Minchan Kim
2011-04-27  9:08       ` Minchan Kim

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=20110428103505.GS4658@suse.de \
    --to=mgorman@suse.de \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=jweiner@redhat.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan.kim@gmail.com \
    --cc=riel@redhat.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.