All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: <linux-cxl@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>,
	Alison Schofield <alison.schofield@intel.com>,
	Dave Jiang <dave.jiang@intel.com>,
	"David Lechner" <dlechner@baylibre.com>,
	Davidlohr Bueso <dave@stgolabs.net>,
	"Fabio M. De Francesco" <fabio.m.de.francesco@linux.intel.com>,
	Ingo Molnar <mingo@kernel.org>, Ira Weiny <ira.weiny@intel.com>,
	Jonathan Cameron <jonathan.cameron@huawei.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Shiju Jose <shiju.jose@huawei.com>,
	Vishal Verma <vishal.l.verma@intel.com>
Subject: [PATCH v3 0/8] cleanup: Introduce ACQUIRE(), a guard() for conditional locks
Date: Fri, 11 Jul 2025 16:49:24 -0700	[thread overview]
Message-ID: <20250711234932.671292-1-dan.j.williams@intel.com> (raw)

Changes since v2 [1]:
- Pick up Acks and Reviews
- Whitespace fixups for cleanup.h changes (Jonathan)
- Use consistent local variable style for ACQUIRE_ERR() (Jonathan)
  - Not addressed: switch to less compact style ACQUIRE_ERR()
- Not addressed: pickup checkpatch change for ACQUIRE_ERR() style in
  this series (Alison)
- Drop the cxl_decoder_detach() CLASS() and convert to a helper function (Jonathan)
- Refactor attach_target() to make it easier to read (Jonathan)

[1]: http://lore.kernel.org/20250619050416.782871-1-dan.j.williams@intel.com

For those new to this set, the motivation for this work is that the CXL
subsystem adopted scope-based-cleanup helpers and achieved some decent
cleanups. However, that work stalled with conditional locks. It stalled
due to the pain points of scoped_cond_guard(). See patch1.

In the interim, approaches like rwsem_read_intr_acquire() attempted to
workaround the pain points, but started a "parallel universe" of helpers
that is not sustainable.

    0c6e6f1357cb cxl/edac: Add CXL memory device patrol scrub control feature

Peter fixed all of this up in a manner consistent with existing guards.
Take that proposal and run with it to unblock further cleanups of "goto"
in unwind paths in the CXL subsystem.

Potential follow-on work identified by this effort:

- __GUARD_IS_ERR() asm helper [2]
- Checkpatch fixups for proposed ACQUIRE_ERR() style [3]

[2]: http://lore.kernel.org/20250514064624.GA24938@noisy.programming.kicks-ass.net
[3]: http://lore.kernel.org/aGXDMZB6omShJpoj@aschofie-mobl2.lan

Dan Williams (7):
  cxl/mbox: Convert poison list mutex to ACQUIRE()
  cxl/decoder: Move decoder register programming to a helper
  cxl/decoder: Drop pointless locking
  cxl/region: Split commit_store() into __commit() and queue_reset()
    helpers
  cxl/region: Move ready-to-probe state check to a helper
  cxl/region: Consolidate cxl_decoder_kill_region() and
    cxl_region_detach()
  cxl: Convert to ACQUIRE() for conditional rwsem locking

Peter Zijlstra (1):
  cleanup: Introduce ACQUIRE() and ACQUIRE_ERR() for conditional locks

 drivers/cxl/core/cdat.c   |   6 +-
 drivers/cxl/core/core.h   |  32 ++-
 drivers/cxl/core/edac.c   |  44 ++--
 drivers/cxl/core/hdm.c    | 118 +++++-----
 drivers/cxl/core/mbox.c   |  13 +-
 drivers/cxl/core/memdev.c |  50 ++--
 drivers/cxl/core/port.c   |  27 +--
 drivers/cxl/core/region.c | 473 ++++++++++++++++++++------------------
 drivers/cxl/cxl.h         |  13 +-
 drivers/cxl/cxlmem.h      |   4 +-
 include/linux/cleanup.h   |  95 ++++++--
 include/linux/mutex.h     |   2 +-
 include/linux/rwsem.h     |   3 +-
 13 files changed, 480 insertions(+), 400 deletions(-)


base-commit: e04c78d86a9699d136910cfc0bdcf01087e3267e
-- 
2.50.0


             reply	other threads:[~2025-07-11 23:50 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-11 23:49 Dan Williams [this message]
2025-07-11 23:49 ` [PATCH v3 1/8] cleanup: Introduce ACQUIRE() and ACQUIRE_ERR() for conditional locks Dan Williams
2025-07-15 15:34   ` Jonathan Cameron
2025-07-11 23:49 ` [PATCH v3 2/8] cxl/mbox: Convert poison list mutex to ACQUIRE() Dan Williams
2025-07-11 23:49 ` [PATCH v3 3/8] cxl/decoder: Move decoder register programming to a helper Dan Williams
2025-07-11 23:49 ` [PATCH v3 4/8] cxl/decoder: Drop pointless locking Dan Williams
2025-07-11 23:49 ` [PATCH v3 5/8] cxl/region: Split commit_store() into __commit() and queue_reset() helpers Dan Williams
2025-07-14 21:49   ` Fabio M. De Francesco
2025-07-11 23:49 ` [PATCH v3 6/8] cxl/region: Move ready-to-probe state check to a helper Dan Williams
2025-07-14 22:02   ` Fabio M. De Francesco
2025-07-15 15:33   ` Jonathan Cameron
2025-07-15 17:08     ` dan.j.williams
2025-07-11 23:49 ` [PATCH v3 7/8] cxl/region: Consolidate cxl_decoder_kill_region() and cxl_region_detach() Dan Williams
2025-07-14 18:17   ` Dave Jiang
2025-07-15 17:07     ` dan.j.williams
2025-07-14 22:09   ` Fabio M. De Francesco
2025-07-15 15:56   ` Jonathan Cameron
2025-07-15 16:44     ` dan.j.williams
2025-07-16 10:32       ` Jonathan Cameron
2025-07-11 23:49 ` [PATCH v3 8/8] cxl: Convert to ACQUIRE() for conditional rwsem locking Dan Williams
2025-07-14 16:28   ` Shiju Jose
2025-07-14 19:21     ` dan.j.williams
2025-07-14 18:39   ` Dave Jiang
2025-07-14 22:12   ` Fabio M. De Francesco
2025-07-15 16:20   ` Jonathan Cameron
2025-07-15 17:13     ` dan.j.williams
2025-07-15 17:38       ` Dave Jiang
2025-07-16 20:52 ` [PATCH v3 0/8] cleanup: Introduce ACQUIRE(), a guard() for conditional locks Dave Jiang
2025-07-30 15:10 ` Andy Shevchenko
2025-08-01 18:49   ` dan.j.williams
2025-08-01 19:02     ` Nathan Chancellor
2025-08-01 23:51       ` dan.j.williams

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=20250711234932.671292-1-dan.j.williams@intel.com \
    --to=dan.j.williams@intel.com \
    --cc=alison.schofield@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=dlechner@baylibre.com \
    --cc=fabio.m.de.francesco@linux.intel.com \
    --cc=ira.weiny@intel.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=shiju.jose@huawei.com \
    --cc=torvalds@linux-foundation.org \
    --cc=vishal.l.verma@intel.com \
    /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.