All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH v2 0/3] Add pause to empty spin loops
Date: Mon, 13 Apr 2026 09:45:28 -0700	[thread overview]
Message-ID: <20260413164652.33291-1-stephen@networkplumber.org> (raw)
In-Reply-To: <20260121180845.889190-1-stephen@networkplumber.org>

On SMT systems, empty spinloops can cause excessive latency due to
the spinning core consuming resources that could be used by other
hardware threads. This series addresses this by adding rte_pause()
calls to busy-wait loops in the cnxk drivers.

The first two patches fix existing empty spinloops in the net/cnxk
and event/cnxk drivers. These were identified using a new coccinelle
script that finds variations of the pattern:

    while (!atomic(&flag));

The third patch adds this coccinelle script to devtools/ so that
similar issues can be detected and fixed automatically.

v2 - rebase for 26.07

Stephen Hemminger (3):
  net/cnxk: add pause to spinloops
  event/cnxk: add pause to spinloops
  devtools/cocci: add script to find empty spinloops

 devtools/cocci/fix_empty_spinloops.cocci | 165 +++++++++++++++++++++++
 drivers/event/cnxk/cn10k_worker.c        |   2 +-
 drivers/event/cnxk/cn20k_worker.c        |   2 +-
 drivers/event/cnxk/cnxk_tim_worker.h     |   4 +-
 drivers/net/cnxk/cn10k_tx.h              |   4 +-
 drivers/net/cnxk/cn20k_tx.h              |   4 +-
 6 files changed, 173 insertions(+), 8 deletions(-)
 create mode 100644 devtools/cocci/fix_empty_spinloops.cocci

-- 
2.53.0


  parent reply	other threads:[~2026-04-13 16:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-21 18:05 [RFC 0/3] Add pause to empty spinloops Stephen Hemminger
2026-01-21 18:05 ` [RFC 1/3] net/cnxk: add pause to spinloops Stephen Hemminger
2026-01-21 18:05 ` [RFC 2/3] event/cnxk: " Stephen Hemminger
2026-01-21 21:01   ` Stephen Hemminger
2026-01-21 18:05 ` [RFC 3/3] devtools/cocci: add script to find empty spinloops Stephen Hemminger
2026-04-13 16:45 ` Stephen Hemminger [this message]
2026-04-13 16:45   ` [PATCH v2 1/3] net/cnxk: add pause to spinloops Stephen Hemminger
2026-04-13 16:45   ` [PATCH v2 2/3] event/cnxk: " Stephen Hemminger
2026-06-08 15:49     ` Jerin Jacob
2026-06-08 17:44       ` Stephen Hemminger
2026-06-09  4:50         ` Jerin Jacob
2026-04-13 16:45   ` [PATCH v2 3/3] devtools/cocci: add script to find empty spinloops Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260413164652.33291-1-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.