mirror of
https://github.com/torvalds/linux.git
synced 2024-11-15 08:31:55 +00:00
nvmet: reorder fields in 'struct nvmf_ctrl_options'
Group some variables based on their sizes to reduce holes. On x86_64, this shrinks the size of 'struct nvmf_ctrl_options' from 136 to 128 bytes. When such a structure is allocated in nvmf_create_ctrl(), because of the way memory allocation works, when 136 bytes were requested, 192 bytes were allocated. So this saves 64 bytes per allocation, 1 cache line to hold the whole structure and a few cycles when zeroing the memory in nvmf_create_ctrl(). Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <kbusch@kernel.org>
This commit is contained in:
parent
9d217fb0e7
commit
e64b0c807c
@ -77,6 +77,9 @@ enum {
|
|||||||
* with the parsing opts enum.
|
* with the parsing opts enum.
|
||||||
* @mask: Used by the fabrics library to parse through sysfs options
|
* @mask: Used by the fabrics library to parse through sysfs options
|
||||||
* on adding a NVMe controller.
|
* on adding a NVMe controller.
|
||||||
|
* @max_reconnects: maximum number of allowed reconnect attempts before removing
|
||||||
|
* the controller, (-1) means reconnect forever, zero means remove
|
||||||
|
* immediately;
|
||||||
* @transport: Holds the fabric transport "technology name" (for a lack of
|
* @transport: Holds the fabric transport "technology name" (for a lack of
|
||||||
* better description) that will be used by an NVMe controller
|
* better description) that will be used by an NVMe controller
|
||||||
* being added.
|
* being added.
|
||||||
@ -96,9 +99,6 @@ enum {
|
|||||||
* @discovery_nqn: indicates if the subsysnqn is the well-known discovery NQN.
|
* @discovery_nqn: indicates if the subsysnqn is the well-known discovery NQN.
|
||||||
* @kato: Keep-alive timeout.
|
* @kato: Keep-alive timeout.
|
||||||
* @host: Virtual NVMe host, contains the NQN and Host ID.
|
* @host: Virtual NVMe host, contains the NQN and Host ID.
|
||||||
* @max_reconnects: maximum number of allowed reconnect attempts before removing
|
|
||||||
* the controller, (-1) means reconnect forever, zero means remove
|
|
||||||
* immediately;
|
|
||||||
* @dhchap_secret: DH-HMAC-CHAP secret
|
* @dhchap_secret: DH-HMAC-CHAP secret
|
||||||
* @dhchap_ctrl_secret: DH-HMAC-CHAP controller secret for bi-directional
|
* @dhchap_ctrl_secret: DH-HMAC-CHAP controller secret for bi-directional
|
||||||
* authentication
|
* authentication
|
||||||
@ -112,6 +112,7 @@ enum {
|
|||||||
*/
|
*/
|
||||||
struct nvmf_ctrl_options {
|
struct nvmf_ctrl_options {
|
||||||
unsigned mask;
|
unsigned mask;
|
||||||
|
int max_reconnects;
|
||||||
char *transport;
|
char *transport;
|
||||||
char *subsysnqn;
|
char *subsysnqn;
|
||||||
char *traddr;
|
char *traddr;
|
||||||
@ -125,7 +126,6 @@ struct nvmf_ctrl_options {
|
|||||||
bool duplicate_connect;
|
bool duplicate_connect;
|
||||||
unsigned int kato;
|
unsigned int kato;
|
||||||
struct nvmf_host *host;
|
struct nvmf_host *host;
|
||||||
int max_reconnects;
|
|
||||||
char *dhchap_secret;
|
char *dhchap_secret;
|
||||||
char *dhchap_ctrl_secret;
|
char *dhchap_ctrl_secret;
|
||||||
bool disable_sqflow;
|
bool disable_sqflow;
|
||||||
|
Loading…
Reference in New Issue
Block a user