Date: Sat, 02 Dec 2000 13:06:54 -0500 (EST) From: Bosko Milekic <bmilekic@technokratis.com> To: Andrew Gallatin <gallatin@cs.duke.edu> Cc: "Kenneth D. Merry" <ken@kdm.org>, arch@FreeBSD.ORG Subject: Re: zero copy code review Message-ID: <Pine.BSF.4.21.0012021301450.91641-100000@jehovah.technokratis.com> In-Reply-To: <14888.9802.415926.434956@grasshopper.cs.duke.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 1 Dec 2000, Andrew Gallatin wrote: > I'm still not sure I understand your objection. There's some code in > socow_cowsetup() which uses sf bufs. Prior to allocating the sf_buf, it > does some of its own fiddling with the page and introduces some state > the sf_buf_free() wouldn't know how to clear. socow_iodone() undoes > that fiddling and then calls sf_buf_free() to free the sfbuf. Isn't > it better to call sf_buf_free() than to cut & paste the code? > > <...> Yeah, you're right. I overlooked things when I posted that. > I see your point. This was copied, (bug for bug ;-), from sendfile itself. > Look at line 1700 or so of kern/uipc_syscalls.c.. This bug should > probaby be fixed there too.. Yep. You're right. This is a bug that is the result of some of my code, actually (a while back, before I got the commit bit). When the wait code was first introduced, I had to go around the code looking for places previously expecting that M_WAIT will never return NULL and make them deal with the possibility. As we see now, I overlooked the fact that the sf_buf has to be freed in the case of failure, in the sendfile(2) case. Good thing we caught this now, and David Greenman was extremely quick to roll a diff. > The nfs sf_buf_alloc() calls will be made from either a process > context (when doing a zero-copy send over a socket) or from the > context of an nfsiod for the NFS code, so I think this should > be safe. Excellent. > Thanks! > > Drew Cheers, Bosko Milekic bmilekic@technokratis.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0012021301450.91641-100000>