netdev
[Top] [All Lists]

Re: [PATCH,RFC] [NET] ALIGN

To: davem@xxxxxxxxxx
Subject: Re: [PATCH,RFC] [NET] ALIGN
From: YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@xxxxxxxxxxxxxx>
Date: Tue, 10 Feb 2004 13:05:43 +0900 (JST)
Cc: netdev@xxxxxxxxxxx
In-reply-to: <20040209112007.08023ba6.davem@xxxxxxxxxx>
Organization: USAGI Project
References: <20040209.134528.28683257.yoshfuji@xxxxxxxxxxxxxx> <20040209112007.08023ba6.davem@xxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
In article <20040209112007.08023ba6.davem@xxxxxxxxxx> (at Mon, 9 Feb 2004 
11:20:07 -0800), "David S. Miller" <davem@xxxxxxxxxx> says:

> > BTW, 
> >  1. do we really need this ALIGN?
> >  2. should 16 be BYTES_PER_WORD (in mm/slab.c)?
:
> I think this is complete nonsense, and that the alignment is not
> necessary.  I can't even come up with a performance reason as SLAB
> is going to align things to hw cache line size anyways.

Agreed.

> Else let's just remove this bogus 16 byte alignment in the
> kmem_cache_create() call.

Let's kill it. It is very likely safe.

===== net/core/neighbour.c 1.24 vs edited =====
--- 1.24/net/core/neighbour.c   Tue Jan 20 14:31:23 2004
+++ edited/net/core/neighbour.c Tue Feb 10 13:01:15 2004
@@ -1164,8 +1164,7 @@
 
        if (!tbl->kmem_cachep)
                tbl->kmem_cachep = kmem_cache_create(tbl->id,
-                                                    (tbl->entry_size +
-                                                     15) & ~15,
+                                                    tbl->entry_size,
                                                     0, SLAB_HWCACHE_ALIGN,
                                                     NULL, NULL);
        tbl->lock              = RW_LOCK_UNLOCKED;

-- 
Hideaki YOSHIFUJI @ USAGI Project <yoshfuji@xxxxxxxxxxxxxx>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA

<Prev in Thread] Current Thread [Next in Thread>