The patch titled Subject: lib/percpu_ida.c: don't do alloc from per-CPU list if there is none has been added to the -mm tree. Its filename is lib-percpu_idac-dont-do-alloc-from-per-cpu-list-if-there-is-none.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/lib-percpu_idac-dont-do-alloc-from-per-cpu-list-if-there-is-none.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/lib-percpu_idac-dont-do-alloc-from-per-cpu-list-if-there-is-none.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: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> Subject: lib/percpu_ida.c: don't do alloc from per-CPU list if there is none In 804209d8a009 ("lib/percpu_ida.c: use _irqsave() instead of local_irq_save() + spin_lock") I inlined alloc_local_tag() and mixed up the >= check from percpu_ida_alloc() with the one in alloc_local_tag(). Don't alloc from per-CPU freelist if ->nr_free is zero. Link: http://lkml.kernel.org/r/20180613075830.c3zeva52fuj6fxxv@xxxxxxxxxxxxx Fixes: 804209d8a009 ("lib/percpu_ida.c: use _irqsave() instead of local_irq_save() + spin_lock") Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> Reported-by: David Disseldorp <ddiss@xxxxxxx> Tested-by: David Disseldorp <ddiss@xxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx> Cc: Shaohua Li <shli@xxxxxx> Cc: Kent Overstreet <kent.overstreet@xxxxxxxxx> Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx> Cc: Jens Axboe <axboe@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- diff -puN lib/percpu_ida.c~lib-percpu_idac-dont-do-alloc-from-per-cpu-list-if-there-is-none lib/percpu_ida.c --- a/lib/percpu_ida.c~lib-percpu_idac-dont-do-alloc-from-per-cpu-list-if-there-is-none +++ a/lib/percpu_ida.c @@ -141,7 +141,7 @@ int percpu_ida_alloc(struct percpu_ida * spin_lock_irqsave(&tags->lock, flags); /* Fastpath */ - if (likely(tags->nr_free >= 0)) { + if (likely(tags->nr_free)) { tag = tags->freelist[--tags->nr_free]; spin_unlock_irqrestore(&tags->lock, flags); return tag; _ Patches currently in -mm which might be from bigeasy@xxxxxxxxxxxxx are lib-percpu_idac-dont-do-alloc-from-per-cpu-list-if-there-is-none.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