diff options
author | David Chinner <dgc@sgi.com> | 2007-08-16 01:21:11 -0400 |
---|---|---|
committer | Tim Shimmin <tes@chook.melbourne.sgi.com> | 2007-09-17 02:42:02 -0400 |
commit | 65de5567564e70edd01b6d4e95e548d7ba284872 (patch) | |
tree | 977aef83761c4ef87d95f1e192bc1ae9c7cbdeac /fs/xfs/xfs_mru_cache.h | |
parent | c2f828977ba5d17c13debba374ea252d18e5ccfb (diff) |
[XFS] On-demand reaping of the MRU cache
Instead of running the mru cache reaper all the time based on a timeout,
we should only run it when the cache has active objects. This allows CPUs
to sleep when there is no activity rather than be woken repeatedly just to
check if there is anything to do.
SGI-PV: 968554
SGI-Modid: xfs-linux-melb:xfs-kern:29305a
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Donald Douwsma <donaldd@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_mru_cache.h')
-rw-r--r-- | fs/xfs/xfs_mru_cache.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/xfs/xfs_mru_cache.h b/fs/xfs/xfs_mru_cache.h index 624fd10ee8e5..dd58ea1bbebe 100644 --- a/fs/xfs/xfs_mru_cache.h +++ b/fs/xfs/xfs_mru_cache.h | |||
@@ -32,11 +32,9 @@ typedef struct xfs_mru_cache | |||
32 | unsigned int grp_time; /* Time period spanned by grps. */ | 32 | unsigned int grp_time; /* Time period spanned by grps. */ |
33 | unsigned int lru_grp; /* Group containing time zero. */ | 33 | unsigned int lru_grp; /* Group containing time zero. */ |
34 | unsigned long time_zero; /* Time first element was added. */ | 34 | unsigned long time_zero; /* Time first element was added. */ |
35 | unsigned long next_reap; /* Time that the reaper should | ||
36 | next do something. */ | ||
37 | unsigned int reap_all; /* if set, reap all lists */ | ||
38 | xfs_mru_cache_free_func_t free_func; /* Function pointer for freeing. */ | 35 | xfs_mru_cache_free_func_t free_func; /* Function pointer for freeing. */ |
39 | struct delayed_work work; /* Workqueue data for reaping. */ | 36 | struct delayed_work work; /* Workqueue data for reaping. */ |
37 | unsigned int queued; /* work has been queued */ | ||
40 | } xfs_mru_cache_t; | 38 | } xfs_mru_cache_t; |
41 | 39 | ||
42 | int xfs_mru_cache_init(void); | 40 | int xfs_mru_cache_init(void); |
@@ -44,7 +42,7 @@ void xfs_mru_cache_uninit(void); | |||
44 | int xfs_mru_cache_create(struct xfs_mru_cache **mrup, unsigned int lifetime_ms, | 42 | int xfs_mru_cache_create(struct xfs_mru_cache **mrup, unsigned int lifetime_ms, |
45 | unsigned int grp_count, | 43 | unsigned int grp_count, |
46 | xfs_mru_cache_free_func_t free_func); | 44 | xfs_mru_cache_free_func_t free_func); |
47 | void xfs_mru_cache_flush(xfs_mru_cache_t *mru, int restart); | 45 | void xfs_mru_cache_flush(xfs_mru_cache_t *mru); |
48 | void xfs_mru_cache_destroy(struct xfs_mru_cache *mru); | 46 | void xfs_mru_cache_destroy(struct xfs_mru_cache *mru); |
49 | int xfs_mru_cache_insert(struct xfs_mru_cache *mru, unsigned long key, | 47 | int xfs_mru_cache_insert(struct xfs_mru_cache *mru, unsigned long key, |
50 | void *value); | 48 | void *value); |