Re: [PATCH] Per-superblock unused dentry LRU lists.



On Wed, 24 May 2006 11:24:12 +1000 David Chinner wrote:

Index: 2.6.x-xfs-new/fs/dcache.c
===================================================================
--- 2.6.x-xfs-new.orig/fs/dcache.c 2006-05-15 16:24:44.212207654 +1000
+++ 2.6.x-xfs-new/fs/dcache.c 2006-05-16 14:00:46.327462206 +1000
@@ -114,6 +113,38 @@ static void dentry_iput(struct dentry *
}
}

+static void
+dentry_lru_add(struct dentry *dentry)
+{
+ list_add(&dentry->d_lru, &dentry->d_sb->s_dentry_lru);
+ dentry_stat.nr_unused++;
+}
+
+static void
+dentry_lru_add_tail(struct dentry *dentry)
+{
+ list_add_tail(&dentry->d_lru, &dentry->d_sb->s_dentry_lru);
+ dentry_stat.nr_unused++;
+}
+
+static void
+dentry_lru_del(struct dentry *dentry)
+{
+ if (!list_empty(&dentry->d_lru)) {
+ list_del(&dentry->d_lru);
+ dentry_stat.nr_unused--;
+ }
+}
+
+static void
+dentry_lru_del_init(struct dentry *dentry)
+{
+ if (likely(!list_empty(&dentry->d_lru))) {
+ list_del_init(&dentry->d_lru);
+ dentry_stat.nr_unused--;
+ }
+}
+
/*
* This is dput
*

Please use regular kernel coding style for functions:
don't put qualifiers and names on separate lines.

@@ -377,6 +399,48 @@ static inline void prune_one_dentry(stru
spin_lock(&dcache_lock);
}

+/*
+ * Shrink the dentry LRU on æ given superblock.

on ? given superblock ?

+ */
+static void
+__shrink_dcache_sb(struct super_block *sb, int *count, int flags)
+{


---
~Randy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: Zoned counters V1 [14/14]: Remove wbs
    ... > * Work out the current dirty-memory clamping and background writeout ... > More majordomo info at http://vger.kernel.org/majordomo-info.html ... > Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: sched: trace: update trace_sched_wakeup()
    ... unsigned long flags; ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: [PATCH] swiotlb: make range_needs_mapping architecture-specific
    ... static void swiotlb_print_info ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: modpost error about size inconsitency
    ... minor conflicts with the eisa stuff. ... static void do_table(void *symval, unsigned long size, ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: sched: trace: update trace_sched_wakeup()
    ... unsigned long flags; ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)