diff options
author | KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | 2011-05-24 20:12:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-25 11:39:21 -0400 |
commit | de03c72cfce5b263a674d04348b58475ec50163c (patch) | |
tree | e2b035234440bcd1aa88078c3f9c8457d461ef9c /include | |
parent | 692e0b35427a088bf75d9363788c61c7edbe93a5 (diff) |
mm: convert mm->cpu_vm_cpumask into cpumask_var_t
cpumask_t is very big struct and cpu_vm_mask is placed wrong position.
It might lead to reduce cache hit ratio.
This patch has two change.
1) Move the place of cpumask into last of mm_struct. Because usually cpumask
is accessed only front bits when the system has cpu-hotplug capability
2) Convert cpu_vm_mask into cpumask_var_t. It may help to reduce memory
footprint if cpumask_size() will use nr_cpumask_bits properly in future.
In addition, this patch change the name of cpu_vm_mask with cpu_vm_mask_var.
It may help to detect out of tree cpu_vm_mask users.
This patch has no functional change.
[akpm@linux-foundation.org: build fix]
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mm_types.h | 9 | ||||
-rw-r--r-- | include/linux/sched.h | 1 |
2 files changed, 7 insertions, 3 deletions
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 201998e5b530..c2f9ea7922f4 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -265,8 +265,6 @@ struct mm_struct { | |||
265 | 265 | ||
266 | struct linux_binfmt *binfmt; | 266 | struct linux_binfmt *binfmt; |
267 | 267 | ||
268 | cpumask_t cpu_vm_mask; | ||
269 | |||
270 | /* Architecture-specific MM context */ | 268 | /* Architecture-specific MM context */ |
271 | mm_context_t context; | 269 | mm_context_t context; |
272 | 270 | ||
@@ -316,9 +314,14 @@ struct mm_struct { | |||
316 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 314 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
317 | pgtable_t pmd_huge_pte; /* protected by page_table_lock */ | 315 | pgtable_t pmd_huge_pte; /* protected by page_table_lock */ |
318 | #endif | 316 | #endif |
317 | |||
318 | cpumask_var_t cpu_vm_mask_var; | ||
319 | }; | 319 | }; |
320 | 320 | ||
321 | /* Future-safe accessor for struct mm_struct's cpu_vm_mask. */ | 321 | /* Future-safe accessor for struct mm_struct's cpu_vm_mask. */ |
322 | #define mm_cpumask(mm) (&(mm)->cpu_vm_mask) | 322 | static inline cpumask_t *mm_cpumask(struct mm_struct *mm) |
323 | { | ||
324 | return mm->cpu_vm_mask_var; | ||
325 | } | ||
323 | 326 | ||
324 | #endif /* _LINUX_MM_TYPES_H */ | 327 | #endif /* _LINUX_MM_TYPES_H */ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 44b8faaac7c0..f18300eddfcb 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -2176,6 +2176,7 @@ static inline void mmdrop(struct mm_struct * mm) | |||
2176 | if (unlikely(atomic_dec_and_test(&mm->mm_count))) | 2176 | if (unlikely(atomic_dec_and_test(&mm->mm_count))) |
2177 | __mmdrop(mm); | 2177 | __mmdrop(mm); |
2178 | } | 2178 | } |
2179 | extern int mm_init_cpumask(struct mm_struct *mm, struct mm_struct *oldmm); | ||
2179 | 2180 | ||
2180 | /* mmput gets rid of the mappings and all user-space */ | 2181 | /* mmput gets rid of the mappings and all user-space */ |
2181 | extern void mmput(struct mm_struct *); | 2182 | extern void mmput(struct mm_struct *); |