Re: [Lse-tech] [RFC] dcache scalability patch (2.4.17)

From: Christoph Hellwig (hch@infradead.org)
Date: Fri Jul 12 2002 - 09:13:22 EST


> diff -urN linux-2.4.17-base/fs/dcache.c linux-2.4.17-dc8/fs/dcache.c
> --- linux-2.4.17-base/fs/dcache.c Fri Dec 21 23:11:55 2001
> +++ linux-2.4.17-dc8/fs/dcache.c Fri Jul 12 16:18:39 2002
> @@ -25,6 +25,7 @@
> #include <linux/module.h>
>
> #include <asm/uaccess.h>
> +#include <linux/rcupdate.h>

Please try to include <linux/*.h> before <asm/*.h> headers.

> +static void d_callback(void *arg)
> +{
> + struct dentry * dentry = (struct dentry *)arg;
> +
> + if (dname_external(dentry))
> + kfree((void *) dentry->d_name.name);
> + kmem_cache_free(dentry_cache, dentry);
> +}

why do you cast to void * before calling kfree?

> - /* dput on a free dentry? */
> - if (!list_empty(&dentry->d_lru))
> - BUG();
> + spin_lock(&dentry->d_lock);
> + if (atomic_read(&dentry->d_count)) {
> + spin_unlock(&dentry->d_lock);
> + spin_unlock(&dcache_lock);
> + return;
> + }
> +

Please use tabs instead of eight spaces in kernel code.

Another implementation details is whether we shouldn't spin on a bit of
->d_vfs_flags instead of increasing struct dentry further. Maybe the
spin_lock_bit interface that wli prototypes might be a godd choise.

Else the patch looks fine to me, although I'm wondering why you target 2.4.17
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jul 15 2002 - 22:00:22 EST