All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH 5/5] NET : Reorder fields of struct dst_entry
Date: Thu, 08 Feb 2007 22:41:11 +0100	[thread overview]
Message-ID: <45CB98F7.1000902@cosmosbay.com> (raw)
In-Reply-To: <45C9093D.1030605@cosmosbay.com>

[-- Attachment #1: Type: text/plain, Size: 327 bytes --]

This last patch (but not least :) ) finally moves the next pointer at the end 
of struct dst_entry. This permits to perform route cache lookups with a 
minimal cost of one cache line per entry, instead of two.

Both 32bits and 64bits platforms benefit from this new layout.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>



[-- Attachment #2: reorder_struct_dst.patch --]
[-- Type: text/plain, Size: 1104 bytes --]

--- linux-2.6.20/include/net/dst.h.inter	2007-02-08 21:43:21.000000000 +0100
+++ linux-2.6.20-ed/include/net/dst.h	2007-02-08 21:43:21.000000000 +0100
@@ -37,14 +37,7 @@ struct sk_buff;
 
 struct dst_entry
 {
-	union {
-		struct dst_entry *next;
-		struct rtable    *rt_next;
-		struct rt6_info   *rt6_next;
-		struct dn_route  *dn_next;
-	};
-	atomic_t		__refcnt;	/* client references	*/
-	int			__use;
+	struct rcu_head		rcu_head;
 	struct dst_entry	*child;
 	struct net_device       *dev;
 	short			error;
@@ -55,7 +48,6 @@ struct dst_entry
 #define DST_NOPOLICY		4
 #define DST_NOHASH		8
 #define DST_BALANCED            0x10
-	unsigned long		lastuse;
 	unsigned long		expires;
 
 	unsigned short		header_len;	/* more space at head required */
@@ -80,8 +72,16 @@ struct dst_entry
 #endif
 
 	struct  dst_ops	        *ops;
-	struct rcu_head		rcu_head;
 		
+	unsigned long		lastuse;
+	atomic_t		__refcnt;	/* client references	*/
+	int			__use;
+	union {
+		struct dst_entry *next;
+		struct rtable    *rt_next;
+		struct rt6_info   *rt6_next;
+		struct dn_route  *dn_next;
+	};
 	char			info[0];
 };
 

  parent reply	other threads:[~2007-02-08 21:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-02 12:05 [PATCH 0/7] [S390]: Introduction of AF_IUCV sockets support Frank Pavlic
2007-02-06 22:41 ` David Miller
2007-02-06 23:03   ` [PATCH] NET : cleanup sock_from_file() Eric Dumazet
2007-02-08 21:35     ` [PATCH 2/5] NET : Convert ipv4 route to use the new dst_entry 'next' pointer Eric Dumazet
2007-02-08 21:36     ` [PATCH 3/5] NET : Convert ipv6 " Eric Dumazet
2007-02-08 21:39     ` [PATCH 4/5] NET : Convert decnet " Eric Dumazet
2007-02-08 21:44       ` [PATCH 4/5 resend] " Eric Dumazet
2007-02-08 21:41     ` Eric Dumazet [this message]
2007-02-08 23:00     ` [PATCH] NET : cleanup sock_from_file() David Miller
2007-02-07 10:31   ` [PATCH 0/7] [S390]: Introduction of AF_IUCV sockets support Frank Pavlic
2007-02-07 11:36   ` Frank Pavlic
2007-02-08 22:00 ` David Miller
2007-02-09 19:15   ` Frank Pavlic

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=45CB98F7.1000902@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=davem@davemloft.net \
    --cc=netdev@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 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.