Martin Guy wrote:
- write tons of data to nbd device, data ends up in pagecache
- memory gets low, kswapd wakes up, calls nbd device to actually write
the data
- nbd issues a request, which ends up on the nbd server on the same machine
- the nbd server allocates memory
- memory allocation hangs waiting for kswapd

In other words, it can deadlock only if you are swapping to an nbd
device that is served by nbd-server running on the same machine and
kernel.

No.  It is possible if you issue non-O_SYNC writes.

In the case of a qemu system swapping over nbd to a server on
the host machine, it is the guest kernel that waits on the host kernel
paging the nbd server in from the host's separate swap space, so no
deadlock is possible.

Practice bears this out; if you wanna stress-test it, here's a program
that creates a low memory condition by saturating the VM.

It isn't enough to thrash the guest, you need to exhaust host memory as well. You also need to do it faster than kswapd can write it out.


Of course, this has nothing to do with the original patch, which just
lets nbd-server interpret qemu image files ;)


Agreed.  But mounting nbd from localhost is dangerous.

--
error compiling committee.c: too many arguments to function



_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Reply via email to