net: sctp: reorder sctp_globals to reduce cacheline usage
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> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
		
					parent
					
						
							
								03536cc3ad
							
						
					
				
			
			
				commit
				
					
						76bfd89844
					
				
			
		
					 1 changed files with 9 additions and 11 deletions
				
			
		|  | @ -113,29 +113,27 @@ struct sctp_hashbucket { | ||||||
| 
 | 
 | ||||||
| /* The SCTP globals structure. */ | /* The SCTP globals structure. */ | ||||||
| extern struct sctp_globals { | 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
 | 	/* This is a list of groups of functions for each address
 | ||||||
| 	 * family that we support. | 	 * family that we support. | ||||||
| 	 */ | 	 */ | ||||||
| 	struct list_head address_families; | 	struct list_head address_families; | ||||||
| 
 | 
 | ||||||
| 	/* This is the hash of all endpoints. */ | 	/* This is the hash of all endpoints. */ | ||||||
| 	int ep_hashsize; |  | ||||||
| 	struct sctp_hashbucket *ep_hashtable; | 	struct sctp_hashbucket *ep_hashtable; | ||||||
| 
 |  | ||||||
| 	/* This is the hash of all associations. */ | 	/* This is the hash of all associations. */ | ||||||
| 	int assoc_hashsize; |  | ||||||
| 	struct sctp_hashbucket *assoc_hashtable; | 	struct sctp_hashbucket *assoc_hashtable; | ||||||
| 
 |  | ||||||
| 	/* This is the sctp port control hash.	*/ | 	/* This is the sctp port control hash.	*/ | ||||||
| 	int port_hashsize; |  | ||||||
| 	struct sctp_bind_hashbucket *port_hashtable; | 	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
 | 	/* Flag to indicate whether computing and verifying checksum
 | ||||||
| 	 * is disabled. */ | 	 * is disabled. */ | ||||||
|         bool checksum_disable; |         bool checksum_disable; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Daniel Borkmann
				Daniel Borkmann