Your message dated Tue, 23 Jan 2007 17:21:58 +0100
with message-id <[EMAIL PROTECTED]>
and subject line Bug#408057: Is it true that nbd-client and server should not 
be on the same machine ?
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: nbd-client
Version: 1:2.8.7-3
Severity: normal

Hi,

I am writing my nbd-server replacement using python(mainly for the purpose of
plugin non-file things as a block device). But it seems that running both the
server and client on the same machine have the possbility of stalling the
whole system.

I have done some stress test without involving the kernel block driver and
both my client and server can run smoothly. However, once I use the real
nbd-client which plugs the socket to the kernel driver then doing a "mke2fs -j
/dev/nbd0", there is a good chance that the whole system would stall.

The network though continue to work as the routing function is not affected.

Is this a known issue ?

-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17-co-0.8
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages nbd-client depends on:
ii  debconf [debconf-2.0]        1.5.8       Debian configuration management sy
ii  libc6                        2.3.6.ds1-8 GNU C Library: Shared libraries

nbd-client recommends no packages.

-- debconf information:
  nbd-client/device:
  nbd-client/host:
  nbd-client/port:
  nbd-client/type: raw
  nbd-client/number: 0
  nbd-client/no-auto-config:


--- End Message ---
--- Begin Message ---
(Closing, as this isn't a bug report, and also a documented issue)

On Tue, Jan 23, 2007 at 04:35:53PM +0800, gary ng wrote:
> I am writing my nbd-server replacement using python(mainly for the purpose of
> plugin non-file things as a block device). But it seems that running both the
> server and client on the same machine have the possbility of stalling the
> whole system.
> 
> I have done some stress test without involving the kernel block driver and
> both my client and server can run smoothly. However, once I use the real
> nbd-client which plugs the socket to the kernel driver then doing a "mke2fs -j
> /dev/nbd0", there is a good chance that the whole system would stall.

Correct.

> The network though continue to work as the routing function is not
> affected.
> 
> Is this a known issue ?

Yes. The reason is that there seems to be a Giant Kernel
Lock in the block device layer somewhere; if you write to the NBD
device, then these writes will queue up in a cache until the kernel
decides it needs to write them out. At this point, it will lock *all*
writes to other block devices until the cache it's trying to write to is
flushed.

You could probably work around the issue by queueing up writes to a
local cache somewhere if select() or poll() tell you that you can't
write to your local data storage. That might end up being problematic
regarding RAM usage, though.

Occasionally, this is why I wrote nbd-tester-client; I could then test
stuff while on my laptop, without risking a total system lockup.

Also see the README file in the nbd source (which I should probably add
to the binary package some time, but that'll be post-etch material).

-- 
<Lo-lan-do> Home is where you have to wash the dishes.
  -- #debian-devel, Freenode, 2004-09-22

--- End Message ---

Reply via email to