* [PATCH net-next] net: sctp: reorder sctp_globals to reduce cacheline usage
@ 2013-08-26 14:34 Daniel Borkmann
2013-08-26 15:29 ` Neil Horman
2013-08-29 18:56 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Daniel Borkmann @ 2013-08-26 14:34 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-sctp
Reduce cacheline usage from 2 to 1 cacheline for sctp_globals structure. By
reordering elements, we can close gaps and simply achieve the following:
Current situation:
/* size: 80, cachelines: 2, members: 10 */
/* sum members: 57, holes: 4, sum holes: 16 */
/* padding: 7 */
/* last cacheline: 16 bytes */
Afterwards:
/* size: 64, cachelines: 1, members: 10 */
/* padding: 7 */
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
---
include/net/sctp/structs.h | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 422db6c..2174d8d 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -113,29 +113,27 @@ struct sctp_hashbucket {
/* The SCTP globals structure. */
extern struct sctp_globals {
- /* The following variables are implementation specific. */
-
- /* Default initialization values to be applied to new associations. */
- __u16 max_instreams;
- __u16 max_outstreams;
-
/* This is a list of groups of functions for each address
* family that we support.
*/
struct list_head address_families;
/* This is the hash of all endpoints. */
- int ep_hashsize;
struct sctp_hashbucket *ep_hashtable;
-
/* This is the hash of all associations. */
- int assoc_hashsize;
struct sctp_hashbucket *assoc_hashtable;
-
/* This is the sctp port control hash. */
- int port_hashsize;
struct sctp_bind_hashbucket *port_hashtable;
+ /* Sizes of above hashtables. */
+ int ep_hashsize;
+ int assoc_hashsize;
+ int port_hashsize;
+
+ /* Default initialization values to be applied to new associations. */
+ __u16 max_instreams;
+ __u16 max_outstreams;
+
/* Flag to indicate whether computing and verifying checksum
* is disabled. */
bool checksum_disable;
--
1.7.11.7
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: sctp: reorder sctp_globals to reduce cacheline usage
2013-08-26 14:34 [PATCH net-next] net: sctp: reorder sctp_globals to reduce cacheline usage Daniel Borkmann
@ 2013-08-26 15:29 ` Neil Horman
2013-08-29 18:56 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Neil Horman @ 2013-08-26 15:29 UTC (permalink / raw)
To: Daniel Borkmann; +Cc: davem, netdev, linux-sctp
On Mon, Aug 26, 2013 at 04:34:00PM +0200, Daniel Borkmann wrote:
> Reduce cacheline usage from 2 to 1 cacheline for sctp_globals structure. By
> reordering elements, we can close gaps and simply achieve the following:
>
> Current situation:
> /* size: 80, cachelines: 2, members: 10 */
> /* sum members: 57, holes: 4, sum holes: 16 */
> /* padding: 7 */
> /* last cacheline: 16 bytes */
>
> Afterwards:
> /* size: 64, cachelines: 1, members: 10 */
> /* padding: 7 */
>
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: sctp: reorder sctp_globals to reduce cacheline usage
2013-08-26 14:34 [PATCH net-next] net: sctp: reorder sctp_globals to reduce cacheline usage Daniel Borkmann
2013-08-26 15:29 ` Neil Horman
@ 2013-08-29 18:56 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2013-08-29 18:56 UTC (permalink / raw)
To: dborkman; +Cc: netdev, linux-sctp
From: Daniel Borkmann <dborkman@redhat.com>
Date: Mon, 26 Aug 2013 16:34:00 +0200
> Reduce cacheline usage from 2 to 1 cacheline for sctp_globals structure. By
> reordering elements, we can close gaps and simply achieve the following:
>
> Current situation:
> /* size: 80, cachelines: 2, members: 10 */
> /* sum members: 57, holes: 4, sum holes: 16 */
> /* padding: 7 */
> /* last cacheline: 16 bytes */
>
> Afterwards:
> /* size: 64, cachelines: 1, members: 10 */
> /* padding: 7 */
>
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-08-29 18:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-26 14:34 [PATCH net-next] net: sctp: reorder sctp_globals to reduce cacheline usage Daniel Borkmann
2013-08-26 15:29 ` Neil Horman
2013-08-29 18:56 ` David 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).