* [PATCH] mm, swap_state.c: declare a few variables as __read_mostly
@ 2017-10-12 9:59 changbin.du
0 siblings, 0 replies; only message in thread
From: changbin.du @ 2017-10-12 9:59 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, linux-kernel, Changbin Du
From: Changbin Du <changbin.du@intel.com>
These global variables are only set during initialization or rarely
change, so declare them as __read_mostly.
Signed-off-by: Changbin Du <changbin.du@intel.com>
---
mm/swap_state.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/mm/swap_state.c b/mm/swap_state.c
index ed91091..71e667d 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -35,13 +35,13 @@ 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_MAX_ORDER_DEFAULT 3
-static int swap_ra_max_order = SWAP_RA_MAX_ORDER_DEFAULT;
+static int swap_ra_max_order __read_mostly = SWAP_RA_MAX_ORDER_DEFAULT;
#define SWAP_RA_WIN_SHIFT (PAGE_SHIFT / 2)
#define SWAP_RA_HITS_MASK ((1UL << SWAP_RA_WIN_SHIFT) - 1)
--
2.7.4
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-10-12 10:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-12 9:59 [PATCH] mm, swap_state.c: declare a few variables as __read_mostly changbin.du
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox