linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bill Speirs <bill.speirs@gmail.com>
To: Rob Landley <rob@landley.net>
Cc: Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Userspace Block Device
Date: Tue, 19 May 2015 10:42:58 -0400	[thread overview]
Message-ID: <CAB_f4-UNx68COuxO+TkTKY_A9+Vu+agnvOrnSWJpktWO5LdTdg@mail.gmail.com> (raw)
In-Reply-To: <CAOS_Y6SthxrRdGgXT5Pwk43xNBQgj+FmVC5MBZeWioh60-UZ0w@mail.gmail.com>

On Tue, May 19, 2015 at 1:34 AM, Rob Landley <rob@landley.net> wrote:
> On Mon, May 18, 2015 at 2:01 PM, Bill Speirs <bill.speirs@gmail.com> wrote:
>> My goal is to provide Amazon S3 or Google Cloud Storage as a block
>> device. I would like to leverage the libraries that exist for both
>> systems by servicing requests via a user space program.
>> ... ndb seems like a bit of a Rube Goldberg solution.
>
> I wrote the busybox and toybox nbd clients, and have a todo list item
> to write an nbd server for toybox. I believe there's also an nbd
> server in qemu. I haven't found any decent documentation on the
> protocol yet, but what specifically makes you describe it as rube
> goldberg?

My understanding of using nbd is:
- Write an ndb-server that is essentially a gateway between nbd and
S3/Google. For each nbd request, I translate it into the appropriate
S3/Google request and respond appropriately.
- I'd run the above server on the machine on some port.
- I'd run a client on the same server using 127.0.0.1 and the above
port, providing the nbd block device.
- Go drink a beer as I rack up a huge bill with Amazon or Google

Seems a bit much to run a client & server on the same machine with
socket overhead, etc. In looking at the code for your nbd-client
(https://github.com/landley/toybox/blob/master/toys/other/nbd_client.c)
I'm wondering if I couldn't just set a pipe instead of a socket in the
ioctl(nbd, NBD_SET_SOCK, sock) step, then have the same proc (or fork)
listening on the pipe so it's all in a single process/codebase.
Thoughts on this approach?

That said, clearly my bottleneck in all of this will be the
communication with S3/Google, and using something like dm-cache would
make it appear fast for most requests. So maybe my Rube Goldberg
comment was too over-the-top.

Thank you for the pointers and the feedback!

Bill-

  reply	other threads:[~2015-05-19 14:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-18 19:01 Userspace Block Device Bill Speirs
2015-05-19  5:34 ` Rob Landley
2015-05-19 14:42   ` Bill Speirs [this message]
2015-05-19 15:19     ` One Thousand Gnomes
2015-05-19 15:33       ` Bill Speirs

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=CAB_f4-UNx68COuxO+TkTKY_A9+Vu+agnvOrnSWJpktWO5LdTdg@mail.gmail.com \
    --to=bill.speirs@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob@landley.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).