[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: NBD server for QEMU images

From: Avi Kivity
Subject: Re: [Qemu-devel] Re: NBD server for QEMU images
Date: Wed, 13 Dec 2006 15:29:10 +0200
User-agent: Thunderbird (X11/20061107)

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

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]