linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: kosaki.motohiro@jp.fujitsu.com, Nick Piggin <npiggin@kernel.dk>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [patch] mm: vmscan implement per-zone shrinkers
Date: Mon, 15 Nov 2010 09:50:36 +0900 (JST)	[thread overview]
Message-ID: <20101115092452.BEF1.A69D9226@jp.fujitsu.com> (raw)
In-Reply-To: <20101114182614.BEE5.A69D9226@jp.fujitsu.com>

> > @@ -1835,8 +1978,6 @@ static void shrink_zone(int priority, st
> >  			break;
> >  	}
> >  
> > -	sc->nr_reclaimed = nr_reclaimed;
> > -
> >  	/*
> >  	 * Even if we did not try to evict anon pages at all, we want to
> >  	 * rebalance the anon lru active/inactive ratio.
> > @@ -1844,6 +1985,23 @@ static void shrink_zone(int priority, st
> >  	if (inactive_anon_is_low(zone, sc))
> >  		shrink_active_list(SWAP_CLUSTER_MAX, zone, sc, priority, 0);
> >  
> > +	/*
> > +	 * Don't shrink slabs when reclaiming memory from
> > +	 * over limit cgroups
> > +	 */
> > +	if (sc->may_reclaim_slab) {
> > +		struct reclaim_state *reclaim_state = current->reclaim_state;
> > +
> > +		shrink_slab(zone, sc->nr_scanned - nr_scanned,
> 
> Doubtful calculation. What mean "sc->nr_scanned - nr_scanned"?
> I think nr_scanned simply keep old slab balancing behavior.

And per-zone reclaim can lead to new issue. On 32bit highmem system,
theorically the system has following memory usage.

ZONE_HIGHMEM: 100% used for page cache
ZONE_NORMAL:  100% used for slab

So, traditional page-cache/slab balancing may not work. I think following
new calculation or somethinhg else is necessary.

	if (zone_reclaimable_pages() > NR_SLAB_RECLAIMABLE) {
		using current calculation
	} else {
		shrink number of "objects >> reclaim-priority" objects
		(as page cache scanning calculation)
	}

However, it can be separate this patch, perhaps.



> 
> 
> > +			lru_pages, global_lru_pages, sc->gfp_mask);
> > +		if (reclaim_state) {
> > +			nr_reclaimed += reclaim_state->reclaimed_slab;
> > +			reclaim_state->reclaimed_slab = 0;
> > +		}
> > +	}
> > +
> > +	sc->nr_reclaimed = nr_reclaimed;
> > +
> >  	throttle_vm_writeout(sc->gfp_mask);
> >  }



  reply	other threads:[~2010-11-15  0:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-09 12:32 [patch] mm: vmscan implement per-zone shrinkers Nick Piggin
2010-11-10  5:18 ` Dave Chinner
2010-11-10  6:32   ` Nick Piggin
2010-11-10  6:39     ` Nick Piggin
2010-11-10 11:05     ` Dave Chinner
2010-11-11  0:23       ` Nick Piggin
2010-11-11  5:21         ` Nick Piggin
2010-11-14 10:07 ` KOSAKI Motohiro
2010-11-15  0:50   ` KOSAKI Motohiro [this message]
2010-11-16  7:47     ` Nick Piggin
2010-11-16  7:53       ` Anca Emanuel
2010-11-16  8:05         ` Figo.zhang
2010-11-16  8:20           ` Anca Emanuel
2010-11-16  8:22             ` Figo.zhang
2010-11-16  8:26               ` Anca Emanuel
2010-11-17  2:41                 ` Figo.zhang
2010-11-17  4:29                   ` Anca Emanuel
2010-11-17  5:21                     ` Figo.zhang
2010-11-23  7:19                       ` KOSAKI Motohiro
2010-11-16  8:26         ` Nick Piggin
2010-11-23  7:21       ` KOSAKI Motohiro
2010-11-16  7:43   ` Nick Piggin

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=20101115092452.BEF1.A69D9226@jp.fujitsu.com \
    --to=kosaki.motohiro@jp.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@kernel.dk \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).