Public bug reported:

The following program will cause a Linux VM running under Xen to
deadlock if a suspend/migrate is attempted:

-----
import pyxs.client
import time

c = pyxs.client.Client(xen_bus_path="/dev/xen/xenbus")
c.connect()
c.transaction()

while True:
    time.sleep(1000)
-----

When control/shutdown == "suspend", the kernel calls do_suspend() which
does a number of steps including freezing processes. It then calls
xs_suspend() to suspend xenstore, which takes some locks and waits for
all transactions to complete so that no new activity can start while the
VM is suspending:

-----
xs_suspend():
        mutex_lock(&xs_state.transaction_mutex);
        wait_event(xs_state.transaction_wq,
                   atomic_read(&xs_state.transaction_count) == 0); <-- the 
xenwatch thread is waiting here
        down_write(&xs_state.watch_mutex);
        mutex_lock(&xs_state.request_mutex);
        mutex_lock(&xs_state.response_mutex);
-----

The xenwatch thread is waiting for all outstanding transactions to
complete. However, by this point the processes have been frozen so any
outstanding transactions won't complete.

This affects all versions of Linux back to at least v3.2, but has been
fixed in v5.2-rc3 (see
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=867cefb4cb1012f42cada1c7d1f35ac8dd276071)

A backport to released Ubuntu kernels is requested.

** Affects: linux (Ubuntu)
     Importance: Undecided
         Status: Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1844421

Title:
  Linux VM deadlock during migration

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1844421/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to