Skip to content

cleanup: Introduce ACQUIRE(), a guard() for conditional locks

Dan Williams linux-cxl lkml 2 versions – Applied

Status from this message: Applied to cxl/next

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest8 patches 23 repliesApplied
  2. v28 patches 26 repliesSuperseded

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/8cleanup: Introduce ACQUIRE() and ACQUIRE_ERR() for conditional locksinclude/linux/cleanup.h include/linux/mutex.h include/linux/rwsem.h+83 -161 reply
2/8cxl/mbox: Convert poison list mutex to ACQUIRE()drivers/cxl/core/mbox.c drivers/cxl/cxlmem.h+5 -60 replies
3/8cxl/decoder: Move decoder register programming to a helperdrivers/cxl/core/hdm.c+42 -350 replies
4/8cxl/decoder: Drop pointless lockingdrivers/cxl/core/hdm.c+0 -20 replies
5/8cxl/region: Split commit_store() into __commit() and queue_reset() helpersdrivers/cxl/core/region.c+70 -291 reply
6/8cxl/region: Move ready-to-probe state check to a helperdrivers/cxl/core/region.c+18 -63 replies
7/8cxl/region: Consolidate cxl_decoder_kill_region() and cxl_region_detach()drivers/cxl/core/core.h drivers/cxl/core/port.c drivers/cxl/core/region.c+75 -526 replies
8/8cxl: Convert to ACQUIRE() for conditional rwsem lockingdrivers/cxl/core/cdat.c drivers/cxl/core/core.h drivers/cxl/core/edac.c +7 more+212 -2797 replies

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by.

PatchPeter Zijlstra (Intel)Dave JiangJonathan CameronAlison SchofieldDavidlohr BuesoShiju JoseFabio M. De Francesco
1/8R-b
2/8A-b R-b R-b R-b
3/8A-b R-b R-b R-b
4/8A-b R-b R-b R-b R-b
5/8A-b R-b R-b R-b
6/8A-b R-b R-b R-b
7/8A-b R-b R-b R-b
8/8A-b R-b R-b T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 7 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/8] cleanup: Introduce ACQUIRE(), a guard() for conditional locks

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/[email protected]

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/[email protected]
[3]: http://lore.kernel.org/[email protected]

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

Signature · 1 line
2.50.0