mm/swap_state.c: declare a few variables as __read_mostly
authorChangbin Du <[email protected]>
Thu, 16 Nov 2017 01:36:06 +0000 (17:36 -0800)
committerLinus Torvalds <[email protected]>
Thu, 16 Nov 2017 02:21:05 +0000 (18:21 -0800)
These global variables are only set during initialization or rarely
change, so declare them as __read_mostly.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Changbin Du <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/swap_state.c

index f2face8b889ed27cd5cab5fa8a581500d6fe93ff..374d446f7a0aeb4c1a1423dcb31723a02e44a93a 100644 (file)
@@ -36,9 +36,9 @@ static const struct address_space_operations swap_aops = {
 #endif
 };
 
-struct address_space *swapper_spaces[MAX_SWAPFILES];
-static unsigned int nr_swapper_spaces[MAX_SWAPFILES];
-bool swap_vma_readahead = true;
+struct address_space *swapper_spaces[MAX_SWAPFILES] __read_mostly;
+static unsigned int nr_swapper_spaces[MAX_SWAPFILES] __read_mostly;
+bool swap_vma_readahead __read_mostly = true;
 
 #define SWAP_RA_WIN_SHIFT      (PAGE_SHIFT / 2)
 #define SWAP_RA_HITS_MASK      ((1UL << SWAP_RA_WIN_SHIFT) - 1)