Skip to content

xen: don't let keyhandlers block indefinitely on locks

Juergen Gross xen-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 17 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8xen: make rangeset_printk() staticxen/common/rangeset.c xen/include/xen/rangeset.h+1 -41 reply
2/8xen: add using domlist_read_lock in keyhandlersxen/arch/x86/mm/p2m-ept.c xen/arch/x86/time.c xen/common/grant_table.c +1 more+21 -03 replies
3/8xen/sched: don't use irqsave locks in dumping functionsxen/common/sched/credit.c xen/common/sched/credit2.c xen/common/sched/null.c +1 more+14 -214 replies
4/8xen: add locks with timeouts for keyhandlersdocs/misc/xen-command-line.pandoc xen/arch/x86/domain.c xen/common/keyhandler.c +2 more+75 -53 replies
5/8xen/sched: use keyhandler locks when dumping data to consolexen/common/sched/core.c xen/common/sched/cpupool.c xen/common/sched/credit.c +4 more+70 -332 replies
6/8xen/common: use keyhandler locks when dumping data to consolexen/common/event_channel.c xen/common/grant_table.c xen/common/livepatch.c +3 more+95 -210 replies
7/8xen/drivers: use keyhandler locks when dumping data to consolexen/drivers/passthrough/amd/iommu_intr.c xen/drivers/passthrough/pci.c xen/drivers/vpci/msi.c+25 -80 replies
8/8xen/x86: use keyhandler locks when dumping data to consolexen/arch/x86/io_apic.c xen/arch/x86/irq.c xen/arch/x86/msi.c +1 more+57 -210 replies

Reviews trailers per patch

3 of 8 patches have a Reviewed-by or Acked-by.

PatchJan BeulichGeorge DunlapKevin TianDario Faggioli
1/8A-b
2/8A-b A-b R-b
3/8R-b
4/8
5/8
6/8
7/8
8/8

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

Read the v1 thread

Cover letter [Xen-devel] [PATCH 0/8] xen: don't let keyhandlers block indefinitely on locks

Keyhandlers dumping hypervisor information to the console often need to take locks while accessing data. In order to not block in case of system inconsistencies it is convenient to use trylock variants when obtaining the locks. On the other hand a busy system might easily encounter held locks, so this patch series is adding special trylock variants with a timeout used by keyhandlers.

Only the keyhandlers dumping out data are modified to use those new lock variants. There might be still some potentially blocking locks involved (e.g. the console lock for printing), but most critical cases should be handled by this series.

The timeout per lock is 1 millisecond as default, the value can be changed by boot and runtime parameter setting.

Patch 1: cleanup (can go in independently of all other patches) Patch 2: fix in keyhandlers where domlist_read_lock was not taken when
using for_each_domain() (can go in independently)
Patch 3: cleanup of lock handling in scheduling code (prerequisite
patch for patch 5)
Patch 4: main infrastructure for trylocks with timeout plus adaption
of keyhandlers directly in keyhandler.c
Patches 5-8: adaptions of other keyhandlers (split roughly by path)

Juergen Gross (8):
xen: make rangeset_printk() static
xen: add using domlist_read_lock in keyhandlers xen/sched: don't use irqsave locks in dumping functions
xen: add locks with timeouts for keyhandlers xen/sched: use keyhandler locks when dumping data to console xen/common: use keyhandler locks when dumping data to console xen/drivers: use keyhandler locks when dumping data to console xen/x86: use keyhandler locks when dumping data to console

 docs/misc/xen-command-line.pandoc        |  9 ++++++
 xen/arch/x86/domain.c                    |  9 ++++--
 xen/arch/x86/io_apic.c                   | 53 ++++++++++++++++++++++++--------
 xen/arch/x86/irq.c                       |  5 ++-
 xen/arch/x86/mm/p2m-ept.c                |  4 +++
 xen/arch/x86/msi.c                       |  4 ++-
 xen/arch/x86/numa.c                      | 16 ++++++----
 xen/arch/x86/time.c                      |  5 +++
 xen/common/event_channel.c               |  3 +-
 xen/common/grant_table.c                 | 39 +++++++++++++++++++++--
 xen/common/keyhandler.c                  | 29 ++++++++++++++++-
 xen/common/livepatch.c                   | 11 ++-----
 xen/common/rangeset.c                    | 10 +++---
 xen/common/sched/core.c                  |  7 +++++
 xen/common/sched/cpupool.c               |  4 ++-
 xen/common/sched/credit.c                | 31 ++++++++++++-------
 xen/common/sched/credit2.c               | 20 +++++++-----
 xen/common/sched/null.c                  | 50 +++++++++++++++++-------------
 xen/common/sched/private.h               |  1 +
 xen/common/sched/rt.c                    | 13 ++++----
 xen/common/spinlock.c                    | 18 +++++++++--
 xen/common/timer.c                       | 15 +++++----
 xen/drivers/passthrough/amd/iommu_intr.c | 14 ++++++---
 xen/drivers/passthrough/iommu.c          |  5 +++
 xen/drivers/passthrough/pci.c            | 14 +++++++--
 xen/drivers/vpci/msi.c                   |  5 ++-
 xen/include/xen/keyhandler.h             | 26 ++++++++++++++++
 xen/include/xen/rangeset.h               |  2 --
 xen/include/xen/rwlock.h                 | 37 ++++++++++++++++++++++
 29 files changed, 352 insertions(+), 107 deletions(-)
Signature · 7 lines
2.16.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel