[Xen-devel] [PATCH 0/2] smp: convert cpu_add_remove_lock int a rw lock

Roger Pau Monne posted 2 patches 4 years, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/xen tags/patchew/20200213113237.58795-1-roger.pau@citrix.com
xen/arch/x86/smpboot.c |  3 +--
xen/common/cpu.c       | 29 ++++++++++++++++++-----------
xen/include/xen/cpu.h  | 13 +++----------
3 files changed, 22 insertions(+), 23 deletions(-)
[Xen-devel] [PATCH 0/2] smp: convert cpu_add_remove_lock int a rw lock
Posted by Roger Pau Monne 4 years, 2 months ago
Hello,

The main aim of this series is to reduce the pressure around
cpu_add_remove_lock by converting it into a rw lock. Most users of the
lock want to take it in read mode, as they only care about the maps not
changing.

Patch #2 makes the writers take the lock in blocking mode, this is
mainly done to reduce the failure of the CPU plug/unplug operations,
since the lock is more contended now and trylock can easily fail if
there are readers.

Thanks, Roger.

Roger Pau Monne (2):
  smp: convert the cpu maps lock into a rw lock
  smp: convert cpu_hotplug_begin into a blocking lock acquisition

 xen/arch/x86/smpboot.c |  3 +--
 xen/common/cpu.c       | 29 ++++++++++++++++++-----------
 xen/include/xen/cpu.h  | 13 +++----------
 3 files changed, 22 insertions(+), 23 deletions(-)

-- 
2.25.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH 0/2] smp: convert cpu_add_remove_lock int a rw lock
Posted by Andrew Cooper 4 years, 2 months ago
On 13/02/2020 11:32, Roger Pau Monne wrote:
> Hello,
>
> The main aim of this series is to reduce the pressure around
> cpu_add_remove_lock by converting it into a rw lock. Most users of the
> lock want to take it in read mode, as they only care about the maps not
> changing.
>
> Patch #2 makes the writers take the lock in blocking mode, this is
> mainly done to reduce the failure of the CPU plug/unplug operations,
> since the lock is more contended now and trylock can easily fail if
> there are readers.

Seems like a very sensible move.

Both patches Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel