mbox series

[net-next,v3,0/4] net: dqs: optimize if stall threshold is not set

Message ID 20240411192241.2498631-1-leitao@debian.org (mailing list archive)
Headers show
Series net: dqs: optimize if stall threshold is not set | expand

Message

Breno Leitao April 11, 2024, 7:22 p.m. UTC
Here are four patches aimed at enhancing the Dynamic Queue Limit (DQL)
subsystem within the networking stack.

The first two commits involve code refactoring, while the third patch
introduces the actual change. The fourth patch just improves the cache
locality.

Typically, when DQL is enabled, stall information is always populated
through dql_queue_stall(). However, this information is only necessary
if a stall threshold is set, which is stored in struct dql->stall_thrs.

Although dql_queue_stall() is relatively inexpensive, it is not entirely
free due to memory barriers and similar overheads.

To optimize performance, refrain from calling dql_queue_stall() when no
stall threshold is set, thus avoiding the processing of unnecessary
information.

Changelog:

v3:
	* Read stall_thrs earlier, at dql_completed(), to avoid any
	  performance penalty, as suggested by Jakub.
v2:
	* Moved the stall_thrs to the very first cache line, as a new
	  patch. Suggested by Eric Dumazet.
v1:
	* https://lore.kernel.org/all/20240404145939.3601097-1-leitao@debian.org/


Breno Leitao (4):
  net: dql: Avoid calling BUG() when WARN() is enough
  net: dql: Separate queue function responsibilities
  net: dql: Optimize stall information population
  net: dqs: make struct dql more cache efficient

 include/linux/dynamic_queue_limits.h | 50 +++++++++++++++++-----------
 lib/dynamic_queue_limits.c           | 13 +++++---
 2 files changed, 39 insertions(+), 24 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org April 15, 2024, 6:40 p.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 11 Apr 2024 12:22:28 -0700 you wrote:
> Here are four patches aimed at enhancing the Dynamic Queue Limit (DQL)
> subsystem within the networking stack.
> 
> The first two commits involve code refactoring, while the third patch
> introduces the actual change. The fourth patch just improves the cache
> locality.
> 
> [...]

Here is the summary with links:
  - [net-next,v3,1/4] net: dql: Avoid calling BUG() when WARN() is enough
    https://git.kernel.org/netdev/net-next/c/4854b463c4b2
  - [net-next,v3,2/4] net: dql: Separate queue function responsibilities
    https://git.kernel.org/netdev/net-next/c/cbe481a1b741
  - [net-next,v3,3/4] net: dql: Optimize stall information population
    https://git.kernel.org/netdev/net-next/c/721f076b62cb
  - [net-next,v3,4/4] net: dqs: make struct dql more cache efficient
    https://git.kernel.org/netdev/net-next/c/4ba67ef3a1fb

You are awesome, thank you!