Avi Kivity wrote: > 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.
I have run some tests and found that it's easy to cause a deadlock just untaring a file over an nbd device being served from localhost (using the standard nbd-server or my own, it doesn't matter). Another interesting finding is that when the deadlock happens, qemu-nbds is inside a read() call, waiting for new nbd requests to arrive over the socket, and so, not trying to allocate memory or writing to disk. BTW, I am using Debian unstable with kernel 2.6.18-1-686 Regards, - Salva _______________________________________________ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel