From: Glauber Costa <glommer@parallels.com>
To: Steven Whitehouse <swhiteho@redhat.com>
Cc: Glauber Costa <glommer@openvz.org>,
linux-mm@kvack.org, cgroups@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Greg Thelen <gthelen@google.com>,
kamezawa.hiroyu@jp.fujitsu.com, Michal Hocko <mhocko@suse.cz>,
Johannes Weiner <hannes@cmpxchg.org>,
linux-fsdevel@vger.kernel.org, Dave Chinner <david@fromorbit.com>,
hughd@google.com, Dave Chinner <dchinner@redhat.com>,
Adrian Hunter <adrian.hunter@intel.com>
Subject: Re: [PATCH v7 18/34] fs: convert fs shrinkers to new scan/count API
Date: Mon, 20 May 2013 17:46:57 +0400 [thread overview]
Message-ID: <519A2951.9040908@parallels.com> (raw)
In-Reply-To: <1369038304.2728.37.camel@menhir>
On 05/20/2013 12:25 PM, Steven Whitehouse wrote:
> Hi,
>
> On Mon, 2013-05-20 at 00:07 +0400, Glauber Costa wrote:
>> From: Dave Chinner <dchinner@redhat.com>
>>
>> Convert the filesystem shrinkers to use the new API, and standardise
>> some of the behaviours of the shrinkers at the same time. For
>> example, nr_to_scan means the number of objects to scan, not the
>> number of objects to free.
>>
>> I refactored the CIFS idmap shrinker a little - it really needs to
>> be broken up into a shrinker per tree and keep an item count with
>> the tree root so that we don't need to walk the tree every time the
>> shrinker needs to count the number of objects in the tree (i.e.
>> all the time under memory pressure).
>>
>> [ glommer: fixes for ext4, ubifs, nfs, cifs and glock. Fixes are
>> needed mainly due to new code merged in the tree ]
>> Signed-off-by: Dave Chinner <dchinner@redhat.com>
>> Signed-off-by: Glauber Costa <glommer@openvz.org>
>> Acked-by: Mel Gorman <mgorman@suse.de>
>> Acked-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
>> Acked-by: Jan Kara <jack@suse.cz>
>> CC: Steven Whitehouse <swhiteho@redhat.com>
>> CC: Adrian Hunter <adrian.hunter@intel.com>
>> ---
>> fs/ext4/extents_status.c | 30 ++++++++++++++++------------
>> fs/gfs2/glock.c | 28 +++++++++++++++-----------
>> fs/gfs2/main.c | 3 ++-
>> fs/gfs2/quota.c | 12 +++++++-----
>> fs/gfs2/quota.h | 4 +++-
>> fs/mbcache.c | 51 ++++++++++++++++++++++++++++--------------------
>> fs/nfs/dir.c | 18 ++++++++++++++---
>> fs/nfs/internal.h | 4 +++-
>> fs/nfs/super.c | 3 ++-
>> fs/nfsd/nfscache.c | 31 ++++++++++++++++++++---------
>> fs/quota/dquot.c | 34 +++++++++++++++-----------------
>> fs/ubifs/shrinker.c | 20 +++++++++++--------
>> fs/ubifs/super.c | 3 ++-
>> fs/ubifs/ubifs.h | 3 ++-
>> 14 files changed, 151 insertions(+), 93 deletions(-)
> [snip]
>> return 0;
>> diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
>> index 3bd2748..4ddbccb 100644
>> --- a/fs/gfs2/glock.c
>> +++ b/fs/gfs2/glock.c
>> @@ -1428,21 +1428,22 @@ __acquires(&lru_lock)
>> * gfs2_dispose_glock_lru() above.
>> */
>>
>> -static void gfs2_scan_glock_lru(int nr)
>> +static long gfs2_scan_glock_lru(int nr)
>> {
>> struct gfs2_glock *gl;
>> LIST_HEAD(skipped);
>> LIST_HEAD(dispose);
>> + long freed = 0;
>>
>> spin_lock(&lru_lock);
>> - while(nr && !list_empty(&lru_list)) {
>> + while ((nr-- >= 0) && !list_empty(&lru_list)) {
>> gl = list_entry(lru_list.next, struct gfs2_glock, gl_lru);
>>
>> /* Test for being demotable */
>> if (!test_and_set_bit(GLF_LOCK, &gl->gl_flags)) {
>> list_move(&gl->gl_lru, &dispose);
>> atomic_dec(&lru_count);
>> - nr--;
>> + freed++;
>> continue;
>> }
>>
>
> This seems to change behaviour so that nr is no longer the number of
> items to be demoted, but instead the max number of items to scan in
> order to look for items to be demoted. Does that mean that nr has
> changed its meaning now?
>
> Steve.
>
No, this should be the max number to be demoted, no change.
This test above should then be freed < nr.
I will update, thanks for spotting.
--
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:[~2013-05-20 13:46 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-19 20:06 [PATCH v7 00/34] kmemcg shrinkers Glauber Costa
2013-05-19 20:06 ` [PATCH v7 01/34] fs: bump inode and dentry counters to long Glauber Costa
2013-05-19 20:06 ` [PATCH v7 02/34] super: fix calculation of shrinkable objects for small numbers Glauber Costa
2013-05-19 20:06 ` [PATCH v7 03/34] dcache: convert dentry_stat.nr_unused to per-cpu counters Glauber Costa
2013-05-19 20:06 ` [PATCH v7 04/34] dentry: move to per-sb LRU locks Glauber Costa
2013-05-19 20:06 ` [PATCH v7 05/34] dcache: remove dentries from LRU before putting on dispose list Glauber Costa
2013-05-19 20:06 ` [PATCH v7 06/34] mm: new shrinker API Glauber Costa
2013-05-19 20:07 ` [PATCH v7 07/34] shrinker: convert superblock shrinkers to new API Glauber Costa
2013-05-20 16:39 ` Glauber Costa
2013-05-20 23:40 ` Dave Chinner
2013-05-19 20:07 ` [PATCH v7 08/34] list: add a new LRU list type Glauber Costa
2013-05-19 20:07 ` [PATCH v7 09/34] inode: convert inode lru list to generic lru list code Glauber Costa
2013-05-19 20:07 ` [PATCH v7 10/34] dcache: convert to use new lru list infrastructure Glauber Costa
2013-05-19 20:07 ` [PATCH v7 11/34] list_lru: per-node " Glauber Costa
2013-05-19 20:07 ` [PATCH v7 12/34] shrinker: add node awareness Glauber Costa
2013-05-19 20:07 ` [PATCH v7 13/34] vmscan: per-node deferred work Glauber Costa
2013-05-19 20:07 ` [PATCH v7 14/34] list_lru: per-node API Glauber Costa
2013-05-19 20:07 ` [PATCH v7 15/34] fs: convert inode and dentry shrinking to be node aware Glauber Costa
2013-05-19 20:07 ` [PATCH v7 16/34] xfs: convert buftarg LRU to generic code Glauber Costa
2013-05-19 20:07 ` [PATCH v7 17/34] xfs: convert dquot cache lru to list_lru Glauber Costa
2013-05-19 20:07 ` [PATCH v7 18/34] fs: convert fs shrinkers to new scan/count API Glauber Costa
2013-05-20 8:25 ` Steven Whitehouse
2013-05-20 13:46 ` Glauber Costa [this message]
2013-05-20 15:25 ` Glauber Costa
2013-05-20 23:38 ` Dave Chinner
2013-05-20 23:42 ` Glauber Costa
2013-05-19 20:07 ` [PATCH v7 19/34] drivers: convert shrinkers to new count/scan API Glauber Costa
2013-06-03 20:03 ` Kent Overstreet
2013-06-04 9:06 ` Glauber Costa
2013-06-04 9:10 ` Glauber Costa
2013-05-19 20:07 ` [PATCH v7 20/34] i915: bail out earlier when shrinker cannot acquire mutex Glauber Costa
2013-05-19 20:07 ` [PATCH v7 21/34] shrinker: convert remaining shrinkers to count/scan API Glauber Costa
2013-05-19 20:07 ` [PATCH v7 22/34] hugepage: convert huge zero page shrinker to new shrinker API Glauber Costa
2013-05-19 20:07 ` [PATCH v7 23/34] shrinker: Kill old ->shrink API Glauber Costa
2013-05-19 20:07 ` [PATCH v7 24/34] vmscan: also shrink slab in memcg pressure Glauber Costa
2013-05-19 20:07 ` [PATCH v7 25/34] memcg,list_lru: duplicate LRUs upon kmemcg creation Glauber Costa
2013-05-19 20:07 ` [PATCH v7 26/34] lru: add an element to a memcg list Glauber Costa
2013-05-19 20:07 ` [PATCH v7 27/34] list_lru: per-memcg walks Glauber Costa
2013-05-19 20:07 ` [PATCH v7 28/34] memcg: per-memcg kmem shrinking Glauber Costa
2013-05-19 20:07 ` [PATCH v7 29/34] memcg: scan cache objects hierarchically Glauber Costa
2013-05-19 20:07 ` [PATCH v7 30/34] vmscan: take at least one pass with shrinkers Glauber Costa
2013-05-19 20:07 ` [PATCH v7 31/34] super: targeted memcg reclaim Glauber Costa
2013-05-19 20:07 ` [PATCH v7 32/34] memcg: move initialization to memcg creation Glauber Costa
2013-05-19 20:07 ` [PATCH v7 33/34] vmpressure: in-kernel notifications Glauber Costa
2013-05-19 20:07 ` [PATCH v7 34/34] memcg: reap dead memcgs upon global memory pressure Glauber Costa
2013-05-21 7:03 ` [PATCH v7 00/34] kmemcg shrinkers Glauber Costa
2013-05-21 7:18 ` Dave Chinner
2013-05-21 7:27 ` Glauber Costa
2013-05-22 6:26 ` Dave Chinner
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=519A2951.9040908@parallels.com \
--to=glommer@parallels.com \
--cc=adrian.hunter@intel.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=david@fromorbit.com \
--cc=dchinner@redhat.com \
--cc=glommer@openvz.org \
--cc=gthelen@google.com \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.cz \
--cc=swhiteho@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox