mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "YOSHIFUJI Hideaki / 吉藤英明" <yoshfuji@linux-ipv6.org>
To: davem@redhat.com
Cc: James.Bottomley@SteelEye.com, acme@conectiva.com.br,
	linux-kernel@vger.kernel.org
Subject: Re: New struct sock_common breaks parisc 64 bit compiles with a misalignment
Date: Mon, 16 Jun 2003 02:09:20 +0900 (JST)	[thread overview]
Message-ID: <20030616.020920.110657425.yoshfuji@linux-ipv6.org> (raw)
In-Reply-To: <20030610.091217.112601441.davem@redhat.com>

In article <20030610.091217.112601441.davem@redhat.com> (at Tue, 10 Jun 2003 09:12:17 -0700 (PDT)), "David S. Miller" <davem@redhat.com> says:

>    From: James Bottomley <James.Bottomley@SteelEye.com>
>    Date: 09 Jun 2003 23:57:46 -0500
>    
>    A fix that seems to work for me on parisc64 is to move the atomic_t out
>    of the end of struct sock_common and back into the two other structures
>    (so struct sock_common now ends on 0 mod 8).
>    
> I would suggest instead to add the proper alignment attribute
> to the appropriate members of the tw bucket.

Like this?

Index: linux-2.5/include/net/tcp.h
===================================================================
RCS file: /home/cvs/linux-2.5/include/net/tcp.h,v
retrieving revision 1.38
diff -u -r1.38 tcp.h
--- linux-2.5/include/net/tcp.h	7 Jun 2003 00:22:34 -0000	1.38
+++ linux-2.5/include/net/tcp.h	15 Jun 2003 15:50:22 -0000
@@ -164,6 +164,14 @@
  * problems of sockets in such a state on heavily loaded servers, but
  * without violating the protocol specification.
  */
+
+/* Address pair should be aligned to 64-bits boundary to avoid penalties. */
+#if (BITS_PER_LONG == 64)
+# define	__tw_aligned	__attribute__ ((aligned(8)))
+#else
+# define	__tw_aligned
+#endif
+
 struct tcp_tw_bucket {
 	/*
 	 * Now struct sock also uses sock_common, so please just
@@ -184,7 +192,7 @@
 	__u16			tw_sport;
 	/* Socket demultiplex comparisons on incoming packets. */
 	/* these five are in inet_opt */
-	__u32			tw_daddr;
+	__u32	__tw_aligned	tw_daddr;
 	__u32			tw_rcv_saddr;
 	__u16			tw_dport;
 	__u16			tw_num;

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

  reply	other threads:[~2003-06-15 16:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-10  4:57 James Bottomley
2003-06-10 16:12 ` David S. Miller
2003-06-15 17:09   ` YOSHIFUJI Hideaki / 吉藤英明 [this message]
2003-06-15 17:06     ` David S. Miller
2003-06-15  6:19 ` David S. Miller
2003-06-15 14:35   ` James Bottomley
2003-06-15 14:35     ` David S. Miller
2003-06-15 15:17       ` James Bottomley
2003-06-15 15:23         ` David S. Miller
     [not found] <1055687753.10803.28.camel@mulgrave.suse.lists.linux.kernel>
     [not found] ` <20030615.073503.112613460.davem@redhat.com.suse.lists.linux.kernel>
     [not found]   ` <1055690231.10803.54.camel@mulgrave.suse.lists.linux.kernel>
     [not found]     ` <20030615.082355.08334189.davem@redhat.com.suse.lists.linux.kernel>
2003-06-15 15:41       ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030616.020920.110657425.yoshfuji@linux-ipv6.org \
    --to=yoshfuji@linux-ipv6.org \
    --cc=James.Bottomley@SteelEye.com \
    --cc=acme@conectiva.com.br \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®