Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23419
b: refs/heads/master
c: 101a500
h: refs/heads/master
i:
  23417: 541cf4d
  23415: 4e729c6
v: v3
  • Loading branch information
Paul Jackson authored and Linus Torvalds committed Mar 24, 2006
1 parent dab471f commit 63341eb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fffb60f93ce5880aade88e01d7133b52a4879710
refs/heads/master: 101a50019ae5e370d73984ee05d56dd3b08f330a
1 change: 1 addition & 0 deletions trunk/include/linux/slab.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ typedef struct kmem_cache kmem_cache_t;
what is reclaimable later*/
#define SLAB_PANIC 0x00040000UL /* panic if kmem_cache_create() fails */
#define SLAB_DESTROY_BY_RCU 0x00080000UL /* defer freeing pages to RCU */
#define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */

/* flags passed to a constructor func */
#define SLAB_CTOR_CONSTRUCTOR 0x001UL /* if not set, then deconstructor */
Expand Down
13 changes: 11 additions & 2 deletions trunk/mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/compiler.h>
#include <linux/cpuset.h>
#include <linux/seq_file.h>
#include <linux/notifier.h>
#include <linux/kallsyms.h>
Expand Down Expand Up @@ -173,12 +174,12 @@
SLAB_CACHE_DMA | \
SLAB_MUST_HWCACHE_ALIGN | SLAB_STORE_USER | \
SLAB_RECLAIM_ACCOUNT | SLAB_PANIC | \
SLAB_DESTROY_BY_RCU)
SLAB_DESTROY_BY_RCU | SLAB_MEM_SPREAD)
#else
# define CREATE_MASK (SLAB_HWCACHE_ALIGN | \
SLAB_CACHE_DMA | SLAB_MUST_HWCACHE_ALIGN | \
SLAB_RECLAIM_ACCOUNT | SLAB_PANIC | \
SLAB_DESTROY_BY_RCU)
SLAB_DESTROY_BY_RCU | SLAB_MEM_SPREAD)
#endif

/*
Expand Down Expand Up @@ -2810,6 +2811,14 @@ static inline void *____cache_alloc(struct kmem_cache *cachep, gfp_t flags)
if (unlikely(current->mempolicy && !in_interrupt())) {
int nid = slab_node(current->mempolicy);

if (nid != numa_node_id())
return __cache_alloc_node(cachep, flags, nid);
}
if (unlikely(cpuset_do_slab_mem_spread() &&
(cachep->flags & SLAB_MEM_SPREAD) &&
!in_interrupt())) {
int nid = cpuset_mem_spread_node();

if (nid != numa_node_id())
return __cache_alloc_node(cachep, flags, nid);
}
Expand Down

0 comments on commit 63341eb

Please sign in to comment.