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

Re: [Nbd] [PATCH] Allow NBD to be used locally

> > > It creates a kthread to avoid the deadlock described in NBD
> > > tools documentation.  So, if nbd-client hangs waiting pages, the
> > > kblockd thread can continue its work and free pages.
> > 
> > Hmm, and if there are no other pages that can be freed? Unlikely,
> > but can happen AFAICT.
> Correct. The patch improves the NBD behavior even if it is not
> perfect.  And I think if no other page can be freed your system is
> in very bad move ;-)

Not necessarily.  Problems start when the system wants to free memory
by writing out pages through NBD, and the userspace process servicing
it tries to allocate some memory in order to accomplish this.

Recent kernels have gotten much better at coping with this, so it
might not be easy to make local NBD deadlock under normal
circumstances.  But if you try hard enough, it's not impossible:
throttle_vm_writeout() can stall an allocation until pending writes
have completed, all with plenty of memory available in the system.

BTW, you can basically substitute local NBD with fuse-over-loop, and
get a similar kind of service, with similar problems.


Reply to: