Skip to content

xen/spinlock: make recursive spinlocks a dedicated type

Juergen Gross xen-devel 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest8 patches 21 repliesIn review
  2. v513 patches 24 repliesSuperseded
  3. v412 patches 60 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v313 patches9 repliesSuperseded
v213 patches9 repliesSuperseded

Changes in v6 from the cover letter

- patches 1-5 of V5 have been committed already
- addressed comments

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8xen/spinlock: add explicit non-recursive locking functionsxen/arch/arm/mm.c xen/arch/x86/domain.c xen/arch/x86/mm.c +11 more+74 -572 replies
2/8xen/spinlock: add another function levelxen/common/spinlock.c xen/include/xen/spinlock.h+68 -360 replies
3/8xen/spinlock: add missing rspin_is_locked() and rspin_barrier()xen/arch/x86/mm/p2m-pod.c xen/common/domain.c xen/common/page_alloc.c +4 more+30 -121 reply
4/8xen/spinlock: split recursive spinlocks from normal onesxen/common/spinlock.c xen/include/xen/spinlock.h+105 -170 replies
5/8xen/spinlock: let all is_locked and trylock variants return boolxen/common/spinlock.c xen/include/xen/spinlock.h+4 -40 replies
6/8xen/spinlock: support higher number of cpusxen/common/spinlock.c xen/include/xen/spinlock.h+12 -102 replies
7/8xen/rwlock: raise the number of possible cpusxen/include/xen/rwlock.h+15 -83 replies
8/8xen: allow up to 16383 cpusxen/arch/Kconfig+1 -113 replies

Reviews trailers per patch

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

PatchJan BeulichMichal Orzel
1/8A-b A-b
2/8R-b
3/8R-b
4/8R-b
5/8R-b
6/8R-b
7/8R-b
8/8A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH v6 0/8] xen/spinlock: make recursive spinlocks a dedicated type

Instead of being able to use normal spinlocks as recursive ones, too, make recursive spinlocks a special lock type.

This will make the spinlock structure smaller in production builds and add type-safety.

This allows to increase the maximum number of physical cpus from 4095 to 65535 without increasing the size of the lock structure in production builds (the size of recursive spinlocks in debug builds will grow to 12 bytes due to that change).

Note that rwlock handling is still limiting the number of cpus to 4095, this is being taken care off in patch 12, which raises the rwlock limit to 16384 cpus.

Iommu code imposes a limit of 16383 cpus.

Changes in V2:
- addressed comments by Jan Beulich
- lots of additional cleanups
- reorganized complete series

Changes in V3:
- addressed comments by Jan Beulich

Changes in V4:
- former patch 1 has already been applied
- fixed a coding style issue in patch 1

Changes in V5:
- new patches 1 + 10 + 12 + 13
- due to the recent Ghost-race patches the macro layer for calling spinlock functions is kept
- addressed comments

Changes in V6:
- patches 1-5 of V5 have been committed already
- addressed comments

Juergen Gross (8):
xen/spinlock: add explicit non-recursive locking functions xen/spinlock: add another function level xen/spinlock: add missing rspin_is_locked() and rspin_barrier() xen/spinlock: split recursive spinlocks from normal ones xen/spinlock: let all is_locked and trylock variants return bool xen/spinlock: support higher number of cpus xen/rwlock: raise the number of possible cpus
xen: allow up to 16383 cpus

 xen/arch/Kconfig              |   2 +-
 xen/arch/arm/mm.c             |   4 +-
 xen/arch/x86/domain.c         |  12 +--
 xen/arch/x86/mm.c             |  12 +--
 xen/arch/x86/mm/mem_sharing.c |   8 +-
 xen/arch/x86/mm/p2m-pod.c     |   6 +-
 xen/arch/x86/mm/p2m.c         |   4 +-
 xen/arch/x86/tboot.c          |   4 +-
 xen/common/domain.c           |   2 +-
 xen/common/domctl.c           |   4 +-
 xen/common/grant_table.c      |  10 +-
 xen/common/memory.c           |   4 +-
 xen/common/numa.c             |   4 +-
 xen/common/page_alloc.c       |  18 ++--
 xen/common/spinlock.c         | 181 ++++++++++++++++++++++++++--------
 xen/drivers/char/console.c    |  20 ++--
 xen/drivers/passthrough/pci.c |   2 +-
 xen/include/xen/rwlock.h      |  23 +++--
 xen/include/xen/spinlock.h    | 110 ++++++++++++++++-----
 19 files changed, 297 insertions(+), 133 deletions(-)
Signature · 1 line
2.35.3