diff options
Diffstat (limited to 'mm/slab.c')
-rw-r--r-- | mm/slab.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -103,6 +103,7 @@ | |||
103 | #include <linux/rcupdate.h> | 103 | #include <linux/rcupdate.h> |
104 | #include <linux/string.h> | 104 | #include <linux/string.h> |
105 | #include <linux/nodemask.h> | 105 | #include <linux/nodemask.h> |
106 | #include <linux/mempolicy.h> | ||
106 | #include <linux/mutex.h> | 107 | #include <linux/mutex.h> |
107 | 108 | ||
108 | #include <asm/uaccess.h> | 109 | #include <asm/uaccess.h> |
@@ -773,6 +774,8 @@ static struct array_cache *alloc_arraycache(int node, int entries, | |||
773 | } | 774 | } |
774 | 775 | ||
775 | #ifdef CONFIG_NUMA | 776 | #ifdef CONFIG_NUMA |
777 | static void *__cache_alloc_node(kmem_cache_t *, gfp_t, int); | ||
778 | |||
776 | static inline struct array_cache **alloc_alien_cache(int node, int limit) | 779 | static inline struct array_cache **alloc_alien_cache(int node, int limit) |
777 | { | 780 | { |
778 | struct array_cache **ac_ptr; | 781 | struct array_cache **ac_ptr; |
@@ -2570,6 +2573,15 @@ static inline void *____cache_alloc(kmem_cache_t *cachep, gfp_t flags) | |||
2570 | void *objp; | 2573 | void *objp; |
2571 | struct array_cache *ac; | 2574 | struct array_cache *ac; |
2572 | 2575 | ||
2576 | #ifdef CONFIG_NUMA | ||
2577 | if (current->mempolicy) { | ||
2578 | int nid = slab_node(current->mempolicy); | ||
2579 | |||
2580 | if (nid != numa_node_id()) | ||
2581 | return __cache_alloc_node(cachep, flags, nid); | ||
2582 | } | ||
2583 | #endif | ||
2584 | |||
2573 | check_irq_off(); | 2585 | check_irq_off(); |
2574 | ac = ac_data(cachep); | 2586 | ac = ac_data(cachep); |
2575 | if (likely(ac->avail)) { | 2587 | if (likely(ac->avail)) { |