diff options
author | Shaohua Li <shaohua.li@intel.com> | 2011-05-24 20:11:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-25 11:39:03 -0400 |
commit | 34679d7eac9ecc20face093db9aa610f1e9c893a (patch) | |
tree | b959da55ed4ff4f4bbd536320cb8205377a46301 /mm | |
parent | 7bf02ea22c6cdd09e2d3f1d3c3fe366b834ae9af (diff) |
mmap: add alignment for some variables
Make some variables have correct alignment/section to avoid cache issue.
In a workload which heavily does mmap/munmap, the variables will be used
frequently.
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/mmap.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -84,10 +84,14 @@ pgprot_t vm_get_page_prot(unsigned long vm_flags) | |||
84 | } | 84 | } |
85 | EXPORT_SYMBOL(vm_get_page_prot); | 85 | EXPORT_SYMBOL(vm_get_page_prot); |
86 | 86 | ||
87 | int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */ | 87 | int sysctl_overcommit_memory __read_mostly = OVERCOMMIT_GUESS; /* heuristic overcommit */ |
88 | int sysctl_overcommit_ratio = 50; /* default is 50% */ | 88 | int sysctl_overcommit_ratio __read_mostly = 50; /* default is 50% */ |
89 | int sysctl_max_map_count __read_mostly = DEFAULT_MAX_MAP_COUNT; | 89 | int sysctl_max_map_count __read_mostly = DEFAULT_MAX_MAP_COUNT; |
90 | struct percpu_counter vm_committed_as; | 90 | /* |
91 | * Make sure vm_committed_as in one cacheline and not cacheline shared with | ||
92 | * other variables. It can be updated by several CPUs frequently. | ||
93 | */ | ||
94 | struct percpu_counter vm_committed_as ____cacheline_aligned_in_smp; | ||
91 | 95 | ||
92 | /* | 96 | /* |
93 | * Check that a process has enough memory to allocate a new virtual | 97 | * Check that a process has enough memory to allocate a new virtual |