netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH,RFC] [NET] ALIGN
@ 2004-02-09  4:45 YOSHIFUJI Hideaki / 吉藤英明
  2004-02-09 19:20 ` David S. Miller
  0 siblings, 1 reply; 4+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2004-02-09  4:45 UTC (permalink / raw)
  To: davem; +Cc: netdev, yoshfuji

D: Use ALIGN() where appricable.

BTW, 
 1. do we really need this ALIGN?
 2. should 16 be BYTES_PER_WORD (in mm/slab.c)?

===== 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	Mon Feb  9 13:13:37 2004
@@ -1164,8 +1164,7 @@
 
 	if (!tbl->kmem_cachep)
 		tbl->kmem_cachep = kmem_cache_create(tbl->id,
-						     (tbl->entry_size +
-						      15) & ~15,
+						     ALIGN(tbl->entry_size, 16),
 						     0, SLAB_HWCACHE_ALIGN,
 						     NULL, NULL);
 	tbl->lock	       = RW_LOCK_UNLOCKED;

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH,RFC] [NET] ALIGN
  2004-02-09  4:45 [PATCH,RFC] [NET] ALIGN YOSHIFUJI Hideaki / 吉藤英明
@ 2004-02-09 19:20 ` David S. Miller
  2004-02-10  4:05   ` YOSHIFUJI Hideaki / 吉藤英明
  0 siblings, 1 reply; 4+ messages in thread
From: David S. Miller @ 2004-02-09 19:20 UTC (permalink / raw)
  To: yoshfuji; +Cc: netdev

On Mon, 09 Feb 2004 13:45:28 +0900 (JST)
YOSHIFUJI Hideaki / ^[$B5HF#1QL@^[(B <yoshfuji@linux-ipv6.org> wrote:

> D: Use ALIGN() where appricable.
> 
> BTW, 
>  1. do we really need this ALIGN?
>  2. should 16 be BYTES_PER_WORD (in mm/slab.c)?

Let's hold on this patch.

Why does it want to align the table entry size to 16 bytes
anyways?

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.

Can anybody come up with some theory ? :-)

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH,RFC] [NET] ALIGN
  2004-02-09 19:20 ` David S. Miller
@ 2004-02-10  4:05   ` YOSHIFUJI Hideaki / 吉藤英明
  2004-02-11 18:42     ` David S. Miller
  0 siblings, 1 reply; 4+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2004-02-10  4:05 UTC (permalink / raw)
  To: davem; +Cc: netdev

In article <20040209112007.08023ba6.davem@redhat.com> (at Mon, 9 Feb 2004 11:20:07 -0800), "David S. Miller" <davem@redhat.com> 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@linux-ipv6.org>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH,RFC] [NET] ALIGN
  2004-02-10  4:05   ` YOSHIFUJI Hideaki / 吉藤英明
@ 2004-02-11 18:42     ` David S. Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David S. Miller @ 2004-02-11 18:42 UTC (permalink / raw)
  To: yoshfuji; +Cc: netdev

On Tue, 10 Feb 2004 13:05:43 +0900 (JST)
YOSHIFUJI Hideaki / ^[$B5HF#1QL@^[(B <yoshfuji@linux-ipv6.org> wrote:

> In article <20040209112007.08023ba6.davem@redhat.com> (at Mon, 9 Feb 2004 11:20:07 -0800), "David S. Miller" <davem@redhat.com> says:
> 
> > 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.

Patch applied, arigato Yoshfuji-san.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-02-11 18:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-09  4:45 [PATCH,RFC] [NET] ALIGN YOSHIFUJI Hideaki / 吉藤英明
2004-02-09 19:20 ` David S. Miller
2004-02-10  4:05   ` YOSHIFUJI Hideaki / 吉藤英明
2004-02-11 18:42     ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).