From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: npiggin@kernel.dk
Cc: kosaki.motohiro@jp.fujitsu.com, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [patch 03/35] mm: implement per-zone shrinker
Date: Tue, 19 Oct 2010 13:49:12 +0900 (JST) [thread overview]
Message-ID: <20101019134345.A1E9.A69D9226@jp.fujitsu.com> (raw)
In-Reply-To: <20101019034655.756353382@kernel.dk>
Hi
> Index: linux-2.6/include/linux/mm.h
> ===================================================================
> --- linux-2.6.orig/include/linux/mm.h 2010-10-19 14:19:40.000000000 +1100
> +++ linux-2.6/include/linux/mm.h 2010-10-19 14:36:48.000000000 +1100
> @@ -997,6 +997,10 @@
> /*
> * A callback you can register to apply pressure to ageable caches.
> *
> + * 'shrink_zone' is the new shrinker API. It is to be used in preference
> + * to 'shrink'. One must point to a shrinker function, the other must
> + * be NULL. See 'shrink_slab' for details about the shrink_zone API.
> + *
> * 'shrink' is passed a count 'nr_to_scan' and a 'gfpmask'. It should
> * look through the least-recently-used 'nr_to_scan' entries and
> * attempt to free them up. It should return the number of objects
> @@ -1013,13 +1017,53 @@
> int (*shrink)(struct shrinker *, int nr_to_scan, gfp_t gfp_mask);
> int seeks; /* seeks to recreate an obj */
>
> + /*
> + * shrink_zone - slab shrinker callback for reclaimable objects
> + * @shrink: this struct shrinker
> + * @zone: zone to scan
> + * @scanned: pagecache lru pages scanned in zone
> + * @total: total pagecache lru pages in zone
> + * @global: global pagecache lru pages (for zone-unaware shrinkers)
> + * @flags: shrinker flags
> + * @gfp_mask: gfp context we are operating within
> + *
> + * The shrinkers are responsible for calculating the appropriate
> + * pressure to apply, batching up scanning (and cond_resched,
> + * cond_resched_lock etc), and updating events counters including
> + * count_vm_event(SLABS_SCANNED, nr).
> + *
> + * This approach gives flexibility to the shrinkers. They know best how
> + * to do batching, how much time between cond_resched is appropriate,
> + * what statistics to increment, etc.
> + */
> + void (*shrink_zone)(struct shrinker *shrink,
> + struct zone *zone, unsigned long scanned,
> + unsigned long total, unsigned long global,
> + unsigned long flags, gfp_t gfp_mask);
Now we decided to don't remove old (*shrink)() interface and zone unaware
slab users continue to use it. so why do we need global argument?
If only zone aware shrinker user (*shrink_zone)(), we can remove it.
Personally I think we should remove it because a removing makes a clear
message that all shrinker need to implement zone awareness eventually.
--
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>
next prev parent reply other threads:[~2010-10-19 4:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20101019034216.319085068@kernel.dk>
2010-10-19 3:42 ` npiggin
2010-10-19 4:49 ` KOSAKI Motohiro [this message]
2010-10-19 5:33 ` Nick Piggin
2010-10-19 5:40 ` KOSAKI Motohiro
2010-10-19 3:42 ` [patch 04/35] vfs: convert inode and dentry caches to " npiggin
[not found] ` <20101019034658.744504135@kernel.dk>
[not found] ` <20101019123852.GA12506@dastard>
[not found] ` <20101020023556.GC3740@amd>
2010-10-20 3:12 ` [patch 31/35] fs: icache per-zone inode LRU Nick Piggin
2010-10-20 9:43 ` Dave Chinner
2010-10-20 10:02 ` 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=20101019134345.A1E9.A69D9226@jp.fujitsu.com \
--to=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=npiggin@kernel.dk \
/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