module: do percpu allocation after uniqueness check. No, really!
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 3 Jul 2013 00:36:28 +0000 (10:06 +0930)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Jul 2013 18:39:17 +0000 (11:39 -0700)
commitc569a3d754f675d41e453e7ca52573677e71290d
tree701e34ced9966a5fbf3b72f98833aa4ba2a60937
parent07a24e531be911e4ae6e43c472b353ba775f1e22
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