diff options
| author | Breno Leitao <[email protected]> | 2024-04-11 19:22:32 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2024-04-15 18:19:53 +0000 |
| commit | 4ba67ef3a1fbb7d8dc5f00de9b93a583d05b38cc (patch) | |
| tree | c35d85cdf08a651df1049f026d4e6c4eb2dcd178 /drivers/net/netdevsim/netdev.c | |
| parent | net: dql: Optimize stall information population (diff) | |
| download | kernel-4ba67ef3a1fbb7d8dc5f00de9b93a583d05b38cc.tar.gz kernel-4ba67ef3a1fbb7d8dc5f00de9b93a583d05b38cc.zip | |
net: dqs: make struct dql more cache efficient
With the previous change, struct dqs->stall_thrs will be in the hot path
(at queue side), even if DQS is disabled.
The other fields accessed in this function (last_obj_cnt and num_queued)
are in the first cache line, let's move this field (stall_thrs) to the
very first cache line, since there is a hole there.
This does not change the structure size, since it moves an short (2
bytes) to 4-bytes whole in the first cache line.
This is the new structure format now:
struct dql {
unsigned int num_queued;
unsigned int last_obj_cnt;
...
short unsigned int stall_thrs;
/* XXX 2 bytes hole, try to pack */
...
/* --- cacheline 1 boundary (64 bytes) --- */
...
/* Longest stall detected, reported to user */
short unsigned int stall_max;
/* XXX 2 bytes hole, try to pack */
};
Also, read the stall_thrs (now in the very first cache line) earlier,
together with dql->num_queued (also in the first cache line).
Suggested-by: Jakub Kicinski <[email protected]>
Suggested-by: Eric Dumazet <[email protected]>
Signed-off-by: Breno Leitao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'drivers/net/netdevsim/netdev.c')
0 files changed, 0 insertions, 0 deletions
