Thread (3 messages) 3 messages, 2 authors, 2012-09-28

Re: CK1 [07/13] slab: Use common kmalloc_index/kmalloc_size functions

From: Glauber Costa <hidden>
Date: 2012-09-28 08:40:02

On 09/27/2012 12:18 AM, Christoph Lameter wrote:
Make slab use the common functions. We can get rid of a lot
of old ugly stuff as a results. Among them the sizes
array and the weird include/linux/kmalloc_sizes file and
some pretty bad #include statements in slab_def.h.

The one thing that is different in slab is that the 32 byte
cache will also be created for arches that have page sizes
larger than 4K. There are numerous smaller allocations that
SLOB and SLUB can handle better because of their support for
smaller allocation sizes so lets keep the 32 byte slab also
for arches with > 4K pages.

Signed-off-by: Christoph Lameter <redacted>
I believe this makes sense, and the code looks better now.

Reviewed-by: Glauber Costa <redacted>

One nitpick:
quoted hunk ↗ jump to hunk
 
@@ -185,26 +169,19 @@ static __always_inline void *kmalloc_nod
 	struct kmem_cache *cachep;
 
 	if (__builtin_constant_p(size)) {
-		int i = 0;
+		int i;
 
Although this is technically correct, the former is correct as well, and
this end up only adding churn to the patch.

Should you decide to remove it, there is another instance of this a bit
more down.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help