mm, swap_state.c: declare a few variables as __read_mostly
Subsystems (2)
PATCH 1/1 mm, swap_state.c: declare a few variables as __read_mostly
From: Changbin Du <[email protected]>
These global variables are only set during initialization or rarely change, so declare them as __read_mostly.
Signed-off-by Changbin Du <[email protected]>
--- mm/swap_state.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
mm/swap_state.c +4 -4
@@ -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)
Signature · 1 line
2.7.4