All of lore.kernel.org
 help / color / mirror / Atom feed
* [2.6.37-rc5] Build error on parisc.
@ 2010-12-15  8:01 Tetsuo Handa
  2010-12-15 18:19 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Tetsuo Handa @ 2010-12-15  8:01 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev

[2.6.37-rc5] Build error on parisc.

Commit 5635c10d "net: make sure struct dst_entry refcount is aligned on 64 bytes"
uses manual padding. I triggered BUILD_BUG_ON() when using
http://kernel.org/pub/tools/crosstool/files/bin/i686/4.5.1/i686-gcc-4.5.1-nolibc_hppa64-linux.tar.bz2 .

  make -s CROSS_COMPILE=hppa64-linux- ARCH=parisc

  include/net/dst.h: In function 'dst_hold':
  include/net/dst.h:161:2: error: negative width in bit-field '<anonymous>'

I think below patch can fix the error but that commit says that we cannot use
__atribute((aligned)). Why?

diff --git a/include/net/dst.h b/include/net/dst.h
index ffe9cb7..02df303 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -62,8 +62,6 @@ struct dst_entry {
 	struct hh_cache		*hh;
 #ifdef CONFIG_XFRM
 	struct xfrm_state	*xfrm;
-#else
-	void			*__pad1;
 #endif
 	int			(*input)(struct sk_buff*);
 	int			(*output)(struct sk_buff*);
@@ -74,23 +72,15 @@ struct dst_entry {
 
 #ifdef CONFIG_NET_CLS_ROUTE
 	__u32			tclassid;
-#else
-	__u32			__pad2;
-#endif
-
-
-	/*
-	 * Align __refcnt to a 64 bytes alignment
-	 * (L1_CACHE_SIZE would be too much)
-	 */
-#ifdef CONFIG_64BIT
-	long			__pad_to_align_refcnt[1];
 #endif
 	/*
 	 * __refcnt wants to be on a different cache line from
 	 * input/output/ops or performance tanks badly
+	 *
+	 * Align __refcnt to a 64 bytes alignment
+	 * (L1_CACHE_SIZE would be too much)
 	 */
-	atomic_t		__refcnt;	/* client references	*/
+	atomic_t		__refcnt __aligned(64);	/* client references */
 	int			__use;
 	unsigned long		lastuse;
 	union {
@@ -154,11 +144,6 @@ dst_metric_locked(struct dst_entry *dst, int metric)
 
 static inline void dst_hold(struct dst_entry * dst)
 {
-	/*
-	 * If your kernel compilation stops here, please check
-	 * __pad_to_align_refcnt declaration in struct dst_entry
-	 */
-	BUILD_BUG_ON(offsetof(struct dst_entry, __refcnt) & 63);
 	atomic_inc(&dst->__refcnt);
 }
 

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

* Re: [2.6.37-rc5] Build error on parisc.
  2010-12-15  8:01 [2.6.37-rc5] Build error on parisc Tetsuo Handa
@ 2010-12-15 18:19 ` David Miller
  2010-12-15 18:22   ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2010-12-15 18:19 UTC (permalink / raw)
  To: penguin-kernel; +Cc: eric.dumazet, netdev

From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Date: Wed, 15 Dec 2010 17:01:14 +0900

> [2.6.37-rc5] Build error on parisc.
> 
> Commit 5635c10d "net: make sure struct dst_entry refcount is aligned on 64 bytes"
> uses manual padding. I triggered BUILD_BUG_ON() when using
> http://kernel.org/pub/tools/crosstool/files/bin/i686/4.5.1/i686-gcc-4.5.1-nolibc_hppa64-linux.tar.bz2 .
> 
>   make -s CROSS_COMPILE=hppa64-linux- ARCH=parisc
> 
>   include/net/dst.h: In function 'dst_hold':
>   include/net/dst.h:161:2: error: negative width in bit-field '<anonymous>'
> 
> I think below patch can fix the error but that commit says that we cannot use
> __atribute((aligned)). Why?

We don't want to create holes of unused space in the structure, we want
to know exactly how every byte of space is being used so nothing is
wasted when all features are enabed.

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

* Re: [2.6.37-rc5] Build error on parisc.
  2010-12-15 18:19 ` David Miller
@ 2010-12-15 18:22   ` Eric Dumazet
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2010-12-15 18:22 UTC (permalink / raw)
  To: David Miller; +Cc: penguin-kernel, netdev

Le mercredi 15 décembre 2010 à 10:19 -0800, David Miller a écrit :
> From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Date: Wed, 15 Dec 2010 17:01:14 +0900
> 
> > [2.6.37-rc5] Build error on parisc.
> > 
> > Commit 5635c10d "net: make sure struct dst_entry refcount is aligned on 64 bytes"
> > uses manual padding. I triggered BUILD_BUG_ON() when using
> > http://kernel.org/pub/tools/crosstool/files/bin/i686/4.5.1/i686-gcc-4.5.1-nolibc_hppa64-linux.tar.bz2 .
> > 
> >   make -s CROSS_COMPILE=hppa64-linux- ARCH=parisc
> > 
> >   include/net/dst.h: In function 'dst_hold':
> >   include/net/dst.h:161:2: error: negative width in bit-field '<anonymous>'
> > 
> > I think below patch can fix the error but that commit says that we cannot use
> > __atribute((aligned)). Why?
> 
> We don't want to create holes of unused space in the structure, we want
> to know exactly how every byte of space is being used so nothing is
> wasted when all features are enabed.

Yes, sorry for missing your mail Tetsuo.




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

end of thread, other threads:[~2010-12-15 18:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-15  8:01 [2.6.37-rc5] Build error on parisc Tetsuo Handa
2010-12-15 18:19 ` David Miller
2010-12-15 18:22   ` Eric Dumazet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.