Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 28941
b: refs/heads/master
c: e0a4272
h: refs/heads/master
i:
  28939: 20b1fba
v: v3
  • Loading branch information
Ingo Molnar authored and Linus Torvalds committed Jun 23, 2006
1 parent 0ff789e commit 28719e1
Show file tree
Hide file tree
Showing 2 changed files with 11 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: 668e0d8f1a02fd75f1c1e8142a6b08455914242c
refs/heads/master: e0a42726794f71336ff4b26084d453dd597471ce
12 changes: 10 additions & 2 deletions trunk/mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,8 @@ static __always_inline int index_of(const size_t size)
return 0;
}

static int slab_early_init = 1;

#define INDEX_AC index_of(sizeof(struct arraycache_init))
#define INDEX_L3 index_of(sizeof(struct kmem_list3))

Expand Down Expand Up @@ -1376,6 +1378,8 @@ void __init kmem_cache_init(void)
NULL, NULL);
}

slab_early_init = 0;

while (sizes->cs_size != ULONG_MAX) {
/*
* For performance, all the general caches are L1 aligned.
Expand Down Expand Up @@ -2106,8 +2110,12 @@ kmem_cache_create (const char *name, size_t size, size_t align,
#endif
#endif

/* Determine if the slab management is 'on' or 'off' slab. */
if (size >= (PAGE_SIZE >> 3))
/*
* Determine if the slab management is 'on' or 'off' slab.
* (bootstrapping cannot cope with offslab caches so don't do
* it too early on.)
*/
if ((size >= (PAGE_SIZE >> 3)) && !slab_early_init)
/*
* Size is large, assume best to place the slab management obj
* off-slab (should allow better packing of objs).
Expand Down

0 comments on commit 28719e1

Please sign in to comment.