module: do percpu allocation after uniqueness check. No, really!
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 3 Jul 2013 00:36:28 +0000 (09:36 +0930)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Jul 2013 18:42:26 +0000 (11:42 -0700)
commit0b72ac9665b63dd029675ea601cb46defd2c974d
tree110983bb19dd69dd1a13baf9f2c5ceaa044d5ebd
parent2842e87389ad1af50afd3fb89b7832aae7f3a7c0
module: do percpu allocation after uniqueness check. No, really!

commit 8d8022e8aba85192e937f1f0f7450e256d66ae5c upstream.

v3.8-rc1-5-g1fb9341 was supposed to stop parallel kvm loads exhausting
percpu memory on large machines:

    Now we have a new state MODULE_STATE_UNFORMED, we can insert the
    module into the list (and thus guarantee its uniqueness) before we
    allocate the per-cpu region.

In my defence, it didn't actually say the patch did this.  Just that
we "can".

This patch actually *does* it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Tested-by: Jim Hull <jim.hull@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/module.c