From owner-freebsd-fs@FreeBSD.ORG Wed Jan 11 19:21:58 2012 Return-Path: Delivered-To: fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B66731065672 for ; Wed, 11 Jan 2012 19:21:58 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8F3128FC19 for ; Wed, 11 Jan 2012 19:21:58 +0000 (UTC) Received: by pbcc3 with SMTP id c3so913679pbc.13 for ; Wed, 11 Jan 2012 11:21:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=GTeJzHUzSAWswDO7GfAXuscv+BdwTIHY9ti0lLEUWMo=; b=Wc451LhnHKRw+qdFbaWM34ElnwVYTqchRnj6JwVSZlcV8oftoFIlxlFm5CpVH7bVOm Nk34AhPLaWYEDl3XrfF0pNIwFSZnXIlmfCrePGL6iu+IImbETDZu3ciajLE5EugkNCvl Un1eyfe98MlYL4JeD8n5vj4jpzWYoPLSXRkWk= MIME-Version: 1.0 Received: by 10.68.213.33 with SMTP id np1mr279865pbc.107.1326308197150; Wed, 11 Jan 2012 10:56:37 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.68.208.167 with HTTP; Wed, 11 Jan 2012 10:56:37 -0800 (PST) In-Reply-To: <1235110182.47136.1326298038118.JavaMail.root@erie.cs.uoguelph.ca> References: <4F0D268B.9060908@aldan.algebra.com> <1235110182.47136.1326298038118.JavaMail.root@erie.cs.uoguelph.ca> Date: Wed, 11 Jan 2012 10:56:37 -0800 X-Google-Sender-Auth: jto9-7IGTklSN903YI2WFJOYLZ0 Message-ID: From: mdf@FreeBSD.org To: Rick Macklem Content-Type: text/plain; charset=ISO-8859-1 Cc: "Mikhail T." , fs@freebsd.org Subject: Re: How to best send files over network? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 19:21:58 -0000 On Wed, Jan 11, 2012 at 8:07 AM, Rick Macklem wrote: > Mikhail T. wrote: >> On 10.01.2012 18:49, Bob Friesenhahn wrote: >> > Don't use mmap on zfs since doing so wastes memory (zfs ARC is not >> > coherent with mmap page cache). Instead do normal file I/O (e.g. >> > write, fwrite) using the filesystem blocksize (e.g. 128K) or a small >> > multiple thereof. >> Well, that was the reason cited for not using sendfile over ZFS. But >> mmap/write, it was claimed, was efficient. >> >> What's the general opinion of using mmap/write, when the file is on >> UFS? >> Is it just as good as sendfile, or can sendfile be better under some >> circumstances? >> >> > It is useful to cache several blocks on the receiving end and use a >> > thread to receive data from the network in case zfs temporarily >> > stalls >> > during write (which it periodically does). >> No, thanks. I'm certainly not doing a read/write loop -- that's just >> too >> disgusting in the age of better interfaces (even if those aren't well >> implemented yet) :-) > > I think Bob was referring to the receive end and not the send end, which > might be why the answer didn't make sense to you? (For the receive end, > it sounds like a good suggestion to me.) Some day, when there's time, I'd like to roll up Isilon's recvfile(2) into a proper patch. It's the obvious analogue to sendfile(2). I think it also requires two new VOPs, for efficiency, VOP_READ_MBUF (for sendfile) and VOP_WRITE_MBUF, which use an mbuf chain rather than uio to do their work. Perhaps at BSDCan, if this is my priority at the time. Or, if someone else wants to work on it I can provide patches that will require work. Thanks, matthew