<div dir="ltr"><div>Hi my name is Akira Hayakawa. I am maintaining an out-of-tree DM target named dm-writeboost.</div><div><br></div><div>Sorry to step in. But this is a very interesting topic at least to me.</div><div><br></div><div>I have been looking for something like dm-user because I believe we should be able to implement virtual block devices in Rust language.</div><div><br></div><div>I
 know proxying IO requests to userland always causes some overhead but 
for some type of device that performance doesn't matter or some 
research prototyping or pseudo device for testing, this way should be 
developed. Of course, implementation in Rust will give us opportunities 
to develop more complicated software in high quality.<br></div><div><br></div><div>I noticed this thread few days ago then I started to prototype this library <a href="https://github.com/akiradeveloper/userland-io" target="_blank">https://github.com/akiradeveloper/userland-io</a><br></div><div><br></div><div>It is what I want but the transport is still NBD which I don't like so much. If dm-user is available, I will implement a transport using dm-use<font color="#888888"><font color="#000000">r.<br></font></font></div><div><font color="#888888"><font color="#000000"><br></font></font></div><div><font color="#888888"><font color="#000000">- Akira</font><br></font></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 15, 2020 at 7:00 PM Palmer Dabbelt <<a href="mailto:palmer@dabbelt.com">palmer@dabbelt.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, 10 Dec 2020 09:03:21 PST (-0800), <a href="mailto:josef@toxicpanda.com" target="_blank">josef@toxicpanda.com</a> wrote:<br>
> On 12/9/20 10:38 PM, Bart Van Assche wrote:<br>
>> On 12/7/20 10:55 AM, Palmer Dabbelt wrote:<br>
>>> All in all, I've found it a bit hard to figure out what sort of interest<br>
>>> people<br>
>>> have in dm-user: when I bring this up I seem to run into people who've done<br>
>>> similar things before and are vaguely interested, but certainly nobody is<br>
>>> chomping at the bit.  I'm sending it out in this early state to try and<br>
>>> figure<br>
>>> out if it's interesting enough to keep going.<br>
>><br>
>> Cc-ing Josef and Mike since their nbd contributions make me wonder<br>
>> whether this new driver could be useful to their use cases?<br>
>><br>
><br>
> Sorry gmail+imap sucks and I can't get my email client to get at the original<br>
> thread.  However here is my take.<br>
<br>
and I guess I then have to apoligize for missing your email ;).  Hopefully that<br>
was the problem, but who knows.<br>
<br>
> 1) The advantages of using dm-user of NBD that you listed aren't actually<br>
> problems for NBD.  We have NBD working in production where you can hand off the<br>
> sockets for the server without ending in timeouts, it was actually the main<br>
> reason we wrote our own server so we could use the FD transfer stuff to restart<br>
> the server without impacting any clients that had the device in use.<br>
<br>
OK.  So you just send the FD around using one of the standard mechanisms to<br>
orchestrate the handoff?  I guess that might work for our use case, assuming<br>
whatever the security side of things was doing was OK with the old FD.  TBH I'm<br>
not sure how all that works and while we thought about doing that sort of<br>
transfer scheme we decided to just open it again -- not sure how far we were<br>
down the dm-user rabbit hole at that point, though, as this sort of arose out<br>
of some other ideas.<br>
<br>
> 2) The extra copy is a big deal, in fact we already have too many copies in our<br>
> existing NBD setup and are actively looking for ways to avoid those.<br>
><br>
> Don't take this as I don't think dm-user is a good idea, but I think at the very<br>
> least it should start with the very best we have to offer, starting with as few<br>
> copies as possible.<br>
<br>
I was really experting someone to say that.  It does seem kind of silly to build<br>
out the new interface, but not go all the way to a ring buffer.  We just didn't<br>
really have any way to justify the extra complexity as our use cases aren't<br>
that high performance.   I kind of like to have benchmarks for this sort of<br>
thing, though, and I didn't have anyone who had bothered avoiding the last copy<br>
to compare against.<br>
<br>
> If you are using it currently in production then cool, there's clearly a usecase<br>
> for it.  Personally as I get older and grouchier I want less things in the<br>
> kernel, so if this enables us to eventually do everything NBD related in<br>
> userspace with no performance drop then I'd be down.  I don't think you need to<br>
> make that your primary goal, but at least polishing this up so it could<br>
> potentially be abused in the future would make it more compelling for merging.<br>
> Thanks,<br>
<br>
Ya, it's in Android already and we'll be shipping it as part of the new OTA<br>
flow for the next release.  The rules on deprecation are a bit different over<br>
there, though, so it's not like we're wed to it.  The whole point of bringing<br>
this up here was to try and get something usable by everyone, and while I'd<br>
eventually like to get whatever's in Android into the kernel proper we'd really<br>
planned on supporting an extra Android-only ABI for a cycle at least.  <br>
<br>
I'm kind of inclined to take a crack at the extra copy, to at least see if<br>
building something that eliminates it is viable.  I'm not really sure if it is<br>
(or at least, if it'll net us a meaningful amount of performance), but it'd at<br>
least be interesting to try.<br>
<br>
It'd be nice to have some benchmark target, though, as otherwise this stuff<br>
hangs on forever.  My workloads are in selftests later on in the patch set, but<br>
I'm essentially using tmpfs as a baseline to compare against ext4+dm-user with<br>
some FIO examples as workloads.  Our early benchmark numbers indicated this was<br>
way faster than we needed, so I didn't even bother putting together a proper<br>
system to run on so I don't really have any meaningful numbers there.  Is there<br>
an NBD server that's fast that I should be comparing against?<br>
<br>
I haven't gotten a whole lot of feedback, so I'm inclined to at least have some<br>
reasonable performance numbers before bothering with a v2.<br>
<br>
--<br>
dm-devel mailing list<br>
<a href="mailto:dm-devel@redhat.com" target="_blank">dm-devel@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/dm-devel" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/dm-devel</a></blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">Akira Hayakawa</div>