Commit 0079e33e authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] dnotify_parent speedup

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.
parent 2c1dcf6c
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment