From owner-freebsd-arch Mon Jun 19 13:58:33 2000 Delivered-To: freebsd-arch@freebsd.org Received: from mass.osd.bsdi.com (adsl-63-206-88-224.dsl.snfc21.pacbell.net [63.206.88.224]) by hub.freebsd.org (Postfix) with ESMTP id 8B42537B748 for ; Mon, 19 Jun 2000 13:58:16 -0700 (PDT) (envelope-from msmith@mass.osd.bsdi.com) Received: from mass.osd.bsdi.com (localhost [127.0.0.1]) by mass.osd.bsdi.com (8.9.3/8.9.3) with ESMTP id OAA09596; Mon, 19 Jun 2000 14:03:07 -0700 (PDT) (envelope-from msmith@mass.osd.bsdi.com) Message-Id: <200006192103.OAA09596@mass.osd.bsdi.com> X-Mailer: exmh version 2.1.1 10/15/1999 To: "Kenneth D. Merry" Cc: arch@FreeBSD.ORG Subject: Re: kblob discussion. In-reply-to: Your message of "Mon, 19 Jun 2000 14:34:37 MDT." <20000619143437.A80133@panzer.kdm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 19 Jun 2000 14:03:07 -0700 From: Mike Smith Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I think this entire discussion has gone just a little bit too far. The basic kblob architecture is sound, and does what most people are looking for in this context. IMO, it should probably be called socketblob, or something else equally boring, but that's neither here nor there. Some comments: > On Mon, Jun 19, 2000 at 13:09:11 -0700, Alfred Perlstein wrote: > > * Kenneth D. Merry [000619 12:40] wrote: > > > I would like to see something more generic as well, especially something > > > that could work for both sending and receiving. > > > > As would I. Receiving into a kernel-side buffer is somewhat pointless, really. You want stuff to go into userspace. This is an output accelerator, not a new I/O method. > > > Another thing that I would like to see is the ability to get notification > > > of when the I/O is done, like async I/O. > > > > That can be easily put into kblob at the expense of some performance, > > however it would require a side allocation per send which negates > > the whole purpose of it as a low overhead extremely fast way to send > > data. > > This gets into the generic API versus specific API issue. It would be fairly trivial to add a mechanism for generating kevents when points in the socket transmit buffer are reached, which would then allow you to do this. I don't think that it should be added to the kblob code as a specific hack, however. > > > I'd almost like the ability to allocate the buffers in userland, and then > > > map them into the kernel and revoke the userland mapping, so the user > > > process can't get to it while you're doing a send. > > > > So use sendfile. :) > > That only works for files. :) Since the goal here is to copy the object once into the kernel, and then never move it across the userspace:kernel boundary again, the map/unmap proposal seems just a little bit silly, really. It's a complex optimisation entirely off the critical path, and fails to consider the problems that kblob is actually trying to address. > Anyway, what I'm getting at is you could use something like RDMA to DMA > data from the NIC directly into user-supplied buffers. This has little or nothing to do with kblob. > > > Anyway, those are just some ideas, I think there's some room for > > > discussion here. > > > > I'd rather not, I've already discussed it a lot and many people > > want this functionality. The people that want more flexibility > > don't realize that the interface is easily extendable (or don't > > want to extend it themselves), and the people that don't like it > > on principle don't see the need for changes to get real world > > performance increases. > > I'd be more in favor of doing it right the first time, rather than > continually revising and extending the interface. As it stands, kblob is "right". It's lean and to-the-point. I'd rather not see it undergo second-system syndrome before it's even made it to first base. If you plan to implement an efficient zero-copy network I/O interface, then it should be done from scratch, not as a wart on the side of what is really fairly specific feature. One point that Alfred may have overlooked is that apart from the resource limit issues, kblob could be implemented entirely as a loadable syscall. (Then you could just compile the limit in, for slightly reduced flexibility.) This would address the "don't commit to a restricted API" issues while still getting the code out and used where it's needed. -- \\ Give a man a fish, and you feed him for a day. \\ Mike Smith \\ Tell him he should learn how to fish himself, \\ msmith@freebsd.org \\ and he'll hate you for a lifetime. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message