Re: [PATCH 04/30] mm: slub: trivial cleanups

Previous thread: [PATCH 09/30] mm: emergency pool by Peter Zijlstra on Thursday, July 24, 2008 - 10:00 am. (1 message)

Next thread: [PATCH 19/30] netvm: hook skb allocation to reserves by Peter Zijlstra on Thursday, July 24, 2008 - 10:01 am. (1 message)
To: Linus Torvalds <torvalds@...>, Andrew Morton <akpm@...>, <linux-kernel@...>, <linux-mm@...>, <netdev@...>, <trond.myklebust@...>, Daniel Lezcano <dlezcano@...>, Pekka Enberg <penberg@...>, Peter Zijlstra <a.p.zijlstra@...>, Neil Brown <neilb@...>
Date: Thursday, July 24, 2008 - 10:00 am

Some cleanups....

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
include/linux/slub_def.h | 7 ++++++-
mm/slub.c | 40 ++++++++++++++++++----------------------
2 files changed, 24 insertions(+), 23 deletions(-)

Index: linux-2.6/mm/slub.c
===================================================================
--- linux-2.6.orig/mm/slub.c
+++ linux-2.6/mm/slub.c
@@ -27,7 +27,7 @@
/*
* Lock order:
* 1. slab_lock(page)
- * 2. slab->list_lock
+ * 2. node->list_lock
*
* The slab_lock protects operations on the object of a particular
* slab and its metadata in the page struct. If the slab lock
@@ -163,11 +163,11 @@ static struct notifier_block slab_notifi
#endif

static enum {
- DOWN, /* No slab functionality available */
+ DOWN = 0, /* No slab functionality available */
PARTIAL, /* kmem_cache_open() works but kmalloc does not */
UP, /* Everything works but does not show up in sysfs */
SYSFS /* Sysfs up */
-} slab_state = DOWN;
+} slab_state;

/* A list of all slab caches on the system */
static DECLARE_RWSEM(slub_lock);
@@ -288,21 +288,22 @@ static inline int slab_index(void *p, st
static inline struct kmem_cache_order_objects oo_make(int order,
unsigned long size)
{
- struct kmem_cache_order_objects x = {
- (order << 16) + (PAGE_SIZE << order) / size
- };
+ struct kmem_cache_order_objects x;
+
+ x.order = order;
+ x.objects = (PAGE_SIZE << order) / size;

return x;
}

static inline int oo_order(struct kmem_cache_order_objects x)
{
- return x.x >> 16;
+ return x.order;
}

static inline int oo_objects(struct kmem_cache_order_objects x)
{
- return x.x & ((1 << 16) - 1);
+ return x.objects;
}

#ifdef CONFIG_SLUB_DEBUG
@@ -1076,8 +1077,7 @@ static struct page *allocate_slab(struct

flags |= s->allocflags;

- page = alloc_slab_page(flags | __GFP_NOWARN | __GFP_NORETRY, node,
- oo);
+ page = alloc_slab_page(...

To: Peter Zijlstra <a.p.zijlstra@...>
Cc: Linus Torvalds <torvalds@...>, Andrew Morton <akpm@...>, <linux-kernel@...>, <linux-mm@...>, <netdev@...>, <trond.myklebust@...>, Daniel Lezcano <dlezcano@...>, Neil Brown <neilb@...>
Date: Tuesday, July 29, 2008 - 6:15 pm

Applied, thanks!
--

To: Peter Zijlstra <a.p.zijlstra@...>
Cc: Linus Torvalds <torvalds@...>, Andrew Morton <akpm@...>, <linux-kernel@...>, <linux-mm@...>, <netdev@...>, <trond.myklebust@...>, Daniel Lezcano <dlezcano@...>, Neil Brown <neilb@...>, <cl@...>
Date: Monday, July 28, 2008 - 5:43 am

Hi Peter,

Could you perhaps send this patch separately?

Reviewed-by: Pekka Enberg <penberg@cs.helsinki.fi>

--

To: Pekka Enberg <penberg@...>
Cc: Linus Torvalds <torvalds@...>, Andrew Morton <akpm@...>, <linux-kernel@...>, <linux-mm@...>, <netdev@...>, <trond.myklebust@...>, Daniel Lezcano <dlezcano@...>, Neil Brown <neilb@...>, <cl@...>
Date: Monday, July 28, 2008 - 6:19 am

I think this version applies to mainline without modifications, so you

--

To: Peter Zijlstra <a.p.zijlstra@...>
Cc: Pekka Enberg <penberg@...>, Linus Torvalds <torvalds@...>, Andrew Morton <akpm@...>, <linux-kernel@...>, <linux-mm@...>, <netdev@...>, <trond.myklebust@...>, Daniel Lezcano <dlezcano@...>, Neil Brown <neilb@...>
Date: Wednesday, July 30, 2008 - 9:59 am

Another width limitation that will limit the number of objects in a slab to 64k.

Ack.

--

To: Christoph Lameter <cl@...>
Cc: Pekka Enberg <penberg@...>, Linus Torvalds <torvalds@...>, Andrew Morton <akpm@...>, <linux-kernel@...>, <linux-mm@...>, <netdev@...>, <trond.myklebust@...>, Daniel Lezcano <dlezcano@...>, Neil Brown <neilb@...>
Date: Wednesday, July 30, 2008 - 10:13 am

I seem to recall differently, I thought we explicitly init global stuff

Well, it was already 16 by virtue of the old code.

GCC emmiting rubbish code due to the union would be sad - I can respin

OK, will send a new one without the bad bits..

--

Previous thread: [PATCH 09/30] mm: emergency pool by Peter Zijlstra on Thursday, July 24, 2008 - 10:00 am. (1 message)

Next thread: [PATCH 19/30] netvm: hook skb allocation to reserves by Peter Zijlstra on Thursday, July 24, 2008 - 10:01 am. (1 message)