[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1279893842-4246-3-git-send-email-david@fromorbit.com>
Date: Sat, 24 Jul 2010 00:04:02 +1000
From: Dave Chinner <david@...morbit.com>
To: npiggin@...nel.dk
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, fmayhar@...gle.com, johnstul@...ibm.com
Subject: [PATCH 2/2] xfs: shrinker should use a per-filesystem scan count
From: Dave Chinner <dchinner@...hat.com>
The shrinker uses a global static to aggregate excess scan counts.
This should be per filesystem like all the other shrinker context to
operate correctly.
Signed-off-by: Dave Chinner <dchinner@...hat.com>
---
fs/xfs/linux-2.6/xfs_sync.c | 5 ++---
fs/xfs/xfs_mount.h | 1 +
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c
index 05426bf..b0e6296 100644
--- a/fs/xfs/linux-2.6/xfs_sync.c
+++ b/fs/xfs/linux-2.6/xfs_sync.c
@@ -893,7 +893,6 @@ xfs_reclaim_inode_shrink(
unsigned long global,
gfp_t gfp_mask)
{
- static unsigned long nr_to_scan;
int nr;
struct xfs_mount *mp;
struct xfs_perag *pag;
@@ -908,14 +907,14 @@ xfs_reclaim_inode_shrink(
nr_reclaimable += pag->pag_ici_reclaimable;
xfs_perag_put(pag);
}
- shrinker_add_scan(&nr_to_scan, scanned, global, nr_reclaimable,
+ shrinker_add_scan(&mp->m_shrink_scan_nr, scanned, global, nr_reclaimable,
DEFAULT_SEEKS);
if (!(gfp_mask & __GFP_FS)) {
return 0;
}
done:
- nr = shrinker_do_scan(&nr_to_scan, SHRINK_BATCH);
+ nr = shrinker_do_scan(&mp->m_shrink_scan_nr, SHRINK_BATCH);
if (!nr)
return 0;
xfs_inode_ag_iterator(mp, xfs_reclaim_inode, 0,
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index 5761087..ed5531f 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -260,6 +260,7 @@ typedef struct xfs_mount {
__int64_t m_update_flags; /* sb flags we need to update
on the next remount,rw */
struct shrinker m_inode_shrink; /* inode reclaim shrinker */
+ unsigned long m_shrink_scan_nr; /* shrinker scan count */
} xfs_mount_t;
/*
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists