The patch titled Subject: userns: use irqsave variant of refcount_dec_and_lock() has been added to the -mm tree. Its filename is userns-use-irqsave-variant-of-refcount_dec_and_lock.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/userns-use-irqsave-variant-of-refcount_dec_and_lock.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/userns-use-irqsave-variant-of-refcount_dec_and_lock.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/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Anna-Maria Gleixner <anna-maria@xxxxxxxxxxxxx> Subject: userns: use irqsave variant of refcount_dec_and_lock() The irqsave variant of refcount_dec_and_lock handles irqsave/restore when taking/releasing the spin lock. With this variant the call of local_irq_save/restore is no longer required. [bigeasy@xxxxxxxxxxxxx: s@atomic_dec_and_lock@refcount_dec_and_lock@g] Link: http://lkml.kernel.org/r/20180703200141.28415-7-bigeasy@xxxxxxxxxxxxx Signed-off-by: Anna-Maria Gleixner <anna-maria@xxxxxxxxxxxxx> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> Acked-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx> Cc: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- diff -puN kernel/user.c~userns-use-irqsave-variant-of-refcount_dec_and_lock kernel/user.c --- a/kernel/user.c~userns-use-irqsave-variant-of-refcount_dec_and_lock +++ a/kernel/user.c @@ -169,11 +169,8 @@ void free_uid(struct user_struct *up) if (!up) return; - local_irq_save(flags); - if (refcount_dec_and_lock(&up->__count, &uidhash_lock)) + if (refcount_dec_and_lock_irqsave(&up->__count, &uidhash_lock, &flags)) free_user(up, flags); - else - local_irq_restore(flags); } struct user_struct *alloc_uid(kuid_t uid) _ Patches currently in -mm which might be from anna-maria@xxxxxxxxxxxxx are bdi-use-irqsave-variant-of-refcount_dec_and_lock.patch userns-use-irqsave-variant-of-refcount_dec_and_lock.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