The patch titled Subject: autofs4: don't take spinlock when not needed in autofs4_lookup_expiring has been added to the -mm tree. Its filename is autofs4-dont-take-spinlock-when-not-needed-in-autofs4_lookup_expiring.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/autofs4-dont-take-spinlock-when-not-needed-in-autofs4_lookup_expiring.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/autofs4-dont-take-spinlock-when-not-needed-in-autofs4_lookup_expiring.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: NeilBrown <neilb@xxxxxxx> Subject: autofs4: don't take spinlock when not needed in autofs4_lookup_expiring If the expiring_list is empty, we can avoid a costly spinlock in the rcu-walk path through autofs4_d_manage (once the rest of the path becomes rcu-walk friendly). Signed-off-by: NeilBrown <neilb@xxxxxxx> Reviewed-by: Ian Kent <raven@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/autofs4/root.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff -puN fs/autofs4/root.c~autofs4-dont-take-spinlock-when-not-needed-in-autofs4_lookup_expiring fs/autofs4/root.c --- a/fs/autofs4/root.c~autofs4-dont-take-spinlock-when-not-needed-in-autofs4_lookup_expiring +++ a/fs/autofs4/root.c @@ -166,8 +166,10 @@ static struct dentry *autofs4_lookup_act const unsigned char *str = name->name; struct list_head *p, *head; - spin_lock(&sbi->lookup_lock); head = &sbi->active_list; + if (list_empty(head)) + return NULL; + spin_lock(&sbi->lookup_lock); list_for_each(p, head) { struct autofs_info *ino; struct dentry *active; @@ -218,8 +220,10 @@ static struct dentry *autofs4_lookup_exp const unsigned char *str = name->name; struct list_head *p, *head; - spin_lock(&sbi->lookup_lock); head = &sbi->expiring_list; + if (list_empty(head)) + return NULL; + spin_lock(&sbi->lookup_lock); list_for_each(p, head) { struct autofs_info *ino; struct dentry *expiring; _ Patches currently in -mm which might be from neilb@xxxxxxx are autofs4-remove-unused-autofs4_ispending.patch autofs4-remove-a-redundant-assignment.patch autofs4-comment-typo-remove-a-a-doubled-word.patch autofs4-remove-some-unused-inline-functions.patch autofs4-dont-take-spinlock-when-not-needed-in-autofs4_lookup_expiring.patch linux-next.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html