Skip to contentSkip to conversation

slub: change the formula which calculates min_objects based on number of processors

PATCH Pekka Enberg 2 participants 2 messages Apr 8, 2008 9 messages not in the archive Memory management

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 1207548437.12878.48.camel@ymzhang

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 1207635477.12878.74.camel@ymzhang

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 1207646286.12878.150.camel@ymzhang

Pekka Enberg

author Applied
#7 lore raw
Quoted 10 lines · Yanmin

Current formula to calculate min_objects based on number of processors is '4 * fls(nr_cpu_ids)', which is not the best optimization on 16-core tigerton. If I add 4 to its result, hackbench result is better.

On 16-core tigerton, by run
./hackbench 100 process 2000
results are:
1) 2.6.25-rc6slab: 23.5seconds
2) 2.6.25-rc7SLUB+slub_min_objects=20: 31seconds
3) 2.6.25-rc7SLUB+slub_min_objects=24: 23.5seconds

Quoted 2 lines

So adding 4 to the output of '4 * fls(nr_cpu_ids)' could get the similar result like CONFIG_SLAB=y.

Applied, thanks!

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#10 lore raw

Re: [patch 04/12] slub: Add kmem_cache_order_objects struct

Quoted 11 lines · Pekka Enberg

Hi Christoph,

Review static struct page *new_slab(struct kmem · line 1167

Quoted 5 lines · Christoph Lameter
(quoted diff) +1 -1
@@ -1143,7 +1165,7 @@ static struct page *new_slab(struct kmem
 	start = page_address(page);
  	if (unlikely(s->flags & SLAB_POISON))
-		memset(start, POISON_INUSE, PAGE_SIZE << s->order);
+		memset(start, POISON_INUSE, PAGE_SIZE << oo_order(oo));

This should be compound_order(page) as allocate_slab() can fall back to smaller page order.

Ack. I distinctly remember fixing this once before. Sigh.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>