]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] dnotify_parent speedup
authorAndrew Morton <akpm@osdl.org>
Mon, 12 Apr 2004 07:55:11 +0000 (00:55 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 12 Apr 2004 07:55:11 +0000 (00:55 -0700)
From: Anton Blanchard <anton@samba.org>

Directory notify code was showing up in a dd bs=1024k from 2 raid arrays
on an emulex FC adapter:

3635     69.4896  vmlinux-2.6.5            .default_idle
332       6.3468  vmlinux-2.6.5            .__copy_tofrom_user
112       2.1411  vmlinux-2.6.5            .save_remaining_regs
76        1.4529  vmlinux-2.6.5            .scsi_dispatch_cmd
64        1.2235  vmlinux-2.6.5            .dnotify_parent
61        1.1661  vmlinux-2.6.5            .do_generic_mapping_read

We already have a sysctl to enable/disable it, the patch below uses it
in dnotify_parent. dnotify_parent disappears and idle time goes up:

4508     70.8582  vmlinux-2.6.5            .default_idle
253       3.9767  vmlinux-2.6.5            .__copy_tofrom_user
142       2.2320  vmlinux-2.6.5            .save_remaining_regs
88        1.3832  vmlinux-2.6.5            .shrink_zone
84        1.3203  vmlinux-2.6.5            .elx_drvr_unlock
75        1.1789  vmlinux-2.6.5            .scsi_dispatch_cmd
69        1.0846  vmlinux-2.6.5            .do_generic_mapping_read

Of course, to gain this small speedup isers need to know to set
/proc/sys/fs/dir-notify-enable to zero.  Nobody does that.

fs/dnotify.c

index bd5b433867d5b79437b7c68654ab7b79979d57af..38c62fe577fa2a5c747abd57568bf9e4c5a458ff 100644 (file)
@@ -154,6 +154,9 @@ void dnotify_parent(struct dentry *dentry, unsigned long event)
 {
        struct dentry *parent;
 
+       if (!dir_notify_enable)
+               return;
+
        spin_lock(&dentry->d_lock);
        parent = dentry->d_parent;
        if (parent->d_inode->i_dnotify_mask & event) {