All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zachary Amsden <zamsden@redhat.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Peter Zijlstra <peterz@infradead.org>,
	linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
	axboe@kernel.dk, hch@infradead.org, akpm@linux-foundation.org,
	Paul.Clements@steeleye.com, tytso@mit.edu,
	Tejun Heo <tj@kernel.org>, miklos <miklos@szeredi.hu>
Subject: Re: [PATCH] Allow userspace block device implementation
Date: Mon, 27 Jul 2009 09:46:57 -1000	[thread overview]
Message-ID: <4A6E0431.30000@redhat.com> (raw)
In-Reply-To: <20090727142536.465799aa@lxorguk.ukuu.org.uk>

Alan Cox wrote:
>> Somehow this made me think of FUSE/CUSE... should this be named aBUSE?
>> Oh wait it is :-), what I'm after is I guess is, can we share some of
>> the FUSE/CUSE code?

Well, it is A Block device in User SpacE :)  I don't think there is a
lot of code sharing benefit in some 800 odd lines, but I could be wrong.

> It reminds me of the existing and perfectly functional network block
> device (nbd) we already have and which has also been present for years.

Yes, I agree, in fact I looked at nbd as I was writing this, but I
believe it is different enough to warrant further investigation.

The network block device requires access to a socket, which the code at
least seems to imply brings up the potential for deadlocks when
self-hosting.  This was designed to explicitly support self-hosting.

This device can be used without CONFIG_NET (not a big advantage, I
agree), and is completely connectionless, which I would argue is a big
advantage.

NBD is perfectly functional, but it seemed more complicated than
necessary for a purely local implementation.  A fully functional null
server (just returns zeros, full error checking and normal whitespace)
can be implemented in about 60 lines of C code, which I don't think is
the case for NBD.  Of course, I'm sure it is possible with PERL bindings
as a one-liner, but the fundamental argument isn't about lines, it's
about complexity.  NBD requires socket allocation, listening and
connection; this requires only opening of a device node.

Can you swap over NBD?  Assuming one had pinned the userspace program
and it pre-allocated all memory so no pagein / alloc was required, would
it be deadlock proof?  I believe there are structure allocations
required for the socket implementation that go beyond the basic BIO
allocations, therefore making it impossible.  In /theory/, one should be
able to swap over this device.  In practice, it's probably a really bad
idea.

It seems then that NBD is a strict subset of the functionality provided
by this type of module.

Zach

  reply	other threads:[~2009-07-27 20:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-27  9:57 [PATCH] Allow userspace block device implementation Zachary Amsden
2009-07-27 12:56 ` Peter Zijlstra
2009-07-27 13:25   ` Alan Cox
2009-07-27 19:46     ` Zachary Amsden [this message]
2009-07-27 20:24       ` Peter Zijlstra
2009-07-27 21:02       ` Alan Cox
2009-07-28  1:21     ` Tejun Heo
2009-07-28  3:53       ` Zachary Amsden
2009-07-28 10:27         ` Alan Cox
2009-07-28 16:00           ` Linus Torvalds
2009-07-28 18:36             ` Kyle Moffett
2009-07-28 18:51               ` Linus Torvalds
2009-07-28 19:07               ` Alan Cox
2009-07-28 19:49               ` Andi Kleen
2009-07-28 20:50                 ` Linus Torvalds
2009-07-28 21:09                   ` Andi Kleen
2009-07-28 22:56                   ` Theodore Tso
2009-08-07 18:08 ` Pavel Machek
2009-08-10 22:47   ` Zachary Amsden
  -- strict thread matches above, loose matches on Subject: below --
2009-07-28 20:37 devzero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A6E0431.30000@redhat.com \
    --to=zamsden@redhat.com \
    --cc=Paul.Clements@steeleye.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=axboe@kernel.dk \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=peterz@infradead.org \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.