Skip to content

Commit

Permalink
ASoC: SOF: sof-priv.h: optimize snd_sof_ipc_msg
Browse files Browse the repository at this point in the history
Move waitq to make sure it's entirely in the same cache line, and move
ipc_complete to reduce padding.

struct snd_sof_ipc_msg {
	void *                     msg_data;             /*     0     8 */
	void *                     reply_data;           /*     8     8 */
	size_t                     msg_size;             /*    16     8 */
	size_t                     reply_size;           /*    24     8 */
	int                        reply_error;          /*    32     4 */
	bool                       ipc_complete;         /*    36     1 */

	/* XXX 3 bytes hole, try to pack */

	wait_queue_head_t          waitq;                /*    40    88 */
	/* --- cacheline 2 boundary (128 bytes) --- */
	void *                     rx_data;              /*   128     8 */

	/* size: 136, cachelines: 3, members: 8 */
	/* sum members: 133, holes: 1, sum holes: 3 */
	/* last cacheline: 8 bytes */
};

Signed-off-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Ranjani Sridharan <[email protected]>
Reviewed-by: Péter Ujfalusi <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
plbossart authored and broonie committed Aug 2, 2024
1 parent e9e7eea commit 5a4413d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sound/soc/sof/sof-priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,12 @@ struct snd_sof_ipc_msg {
size_t reply_size;
int reply_error;

/* notification, firmware initiated messages */
void *rx_data;
bool ipc_complete;

wait_queue_head_t waitq;
bool ipc_complete;

/* notification, firmware initiated messages */
void *rx_data;
};

/**
Expand Down

0 comments on commit 5a4413d

Please sign in to comment.