| Subject: mm: swap: Initialize local locks early |
| From: Thomas Gleixner <tglx@linutronix.de> |
| Date: Thu, 10 Jan 2013 09:50:51 +0100 |
| |
| Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
| --- |
| mm/swap.c | 12 +++++++++--- |
| 1 file changed, 9 insertions(+), 3 deletions(-) |
| |
| Index: linux-stable/mm/swap.c |
| =================================================================== |
| --- linux-stable.orig/mm/swap.c |
| +++ linux-stable/mm/swap.c |
| @@ -846,6 +846,15 @@ unsigned pagevec_lookup_tag(struct pagev |
| } |
| EXPORT_SYMBOL(pagevec_lookup_tag); |
| |
| +/* Early setup for the local locks */ |
| +static int __init swap_init_locks(void) |
| +{ |
| + local_irq_lock_init(rotate_lock); |
| + local_irq_lock_init(swap_lock); |
| + return 1; |
| +} |
| +early_initcall(swap_init_locks); |
| + |
| /* |
| * Perform any setup for the swap system |
| */ |
| @@ -853,9 +862,6 @@ void __init swap_setup(void) |
| { |
| unsigned long megs = totalram_pages >> (20 - PAGE_SHIFT); |
| |
| - local_irq_lock_init(rotate_lock); |
| - local_irq_lock_init(swap_lock); |
| - |
| #ifdef CONFIG_SWAP |
| bdi_init(swapper_space.backing_dev_info); |
| #endif |