Skip to content

Commit 783cb68

Browse files
Changbin Dutorvalds
authored andcommitted
mm/swap_state.c: declare a few variables as __read_mostly
These global variables are only set during initialization or rarely change, so declare them as __read_mostly. Link: http://lkml.kernel.org/r/1507802349-5554-1-git-send-email-changbin.du@intel.com Signed-off-by: Changbin Du <changbin.du@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 4675ff0 commit 783cb68

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mm/swap_state.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ static const struct address_space_operations swap_aops = {
3636
#endif
3737
};
3838

39-
struct address_space *swapper_spaces[MAX_SWAPFILES];
40-
static unsigned int nr_swapper_spaces[MAX_SWAPFILES];
41-
bool swap_vma_readahead = true;
39+
struct address_space *swapper_spaces[MAX_SWAPFILES] __read_mostly;
40+
static unsigned int nr_swapper_spaces[MAX_SWAPFILES] __read_mostly;
41+
bool swap_vma_readahead __read_mostly = true;
4242

4343
#define SWAP_RA_WIN_SHIFT (PAGE_SHIFT / 2)
4444
#define SWAP_RA_HITS_MASK ((1UL << SWAP_RA_WIN_SHIFT) - 1)

0 commit comments

Comments
 (0)