From owner-freebsd-net@freebsd.org Sun Jan 3 17:46:38 2016 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4BA4A60B4D for ; Sun, 3 Jan 2016 17:46:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id B78D710BE for ; Sun, 3 Jan 2016 17:46:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [198.74.231.63]) by cyrus.watson.org (Postfix) with ESMTPS id 841BD46B59; Sun, 3 Jan 2016 12:46:37 -0500 (EST) Date: Sun, 3 Jan 2016 17:46:37 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Rui Paulo cc: HuanHuan , freebsd-net@freebsd.org Subject: Re: Does FreeBSD have sendmmsg or recvmmsg system calls? In-Reply-To: <1451841004.10139.34.camel@me.com> Message-ID: References: <1451841004.10139.34.camel@me.com> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 17:46:38 -0000 On Sun, 3 Jan 2016, Rui Paulo wrote: >> NetBSD 7.0 has just introduced these two syscalls. And Linux also has them. >> >> Does FreeBSD have them? Or plan to support them in the future? > > FreeBSD does not have them.  It doesn't seem especially hard to implement, > though.  Do you know any major application already using them? I see no harm in having the system calls. When I chatted with the authors of nsd a couple of years ago (they had originally promoted the approach), they told me they felt it only offered incremental benefit and didn't particularly recommend that FreeBSD adopt it. However, it would undoubtably see use and does offer some opportunities for future batching-related performance operations, so if someone wants to pursue introducing it, do go ahead. Or just introduce a libc implementation that can be converted to a kernel implementation later if that is determined to be beneficial. But the nsd observations don't (currently) lead me to believe that it is critical to do so. Robert From owner-freebsd-net@freebsd.org Sun Jan 3 18:02:38 2016 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6B66A60342 for ; Sun, 3 Jan 2016 18:02:38 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CDD213B5; Sun, 3 Jan 2016 18:02:38 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x22d.google.com with SMTP id 1so91832257ion.1; Sun, 03 Jan 2016 10:02:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=loCPEqvGbDPBPwjC1sMJUfIFn9ap9SL2erM9ZwmsKWY=; b=AVQnAudXRUccKRTDcTIK9gcDWn89FMeyaCZGtcz6uGosy7K6Jx2a/UXn6OCEbMDcbD IGflhxufui7Q+BVNiNAZ0uXjScZr8QNpxPu0HnAPxKWJ0BrBVCPUCadT81AUIPplJ7V5 Z4VW603y+GJUCj8+DOTN0lyjztNlaT/6mslENE/wl82USTtGvIxLD8tVGGLvziX5WF0+ TtWjG/FPyWUsOhgrEWTZbjUeIRIaAwgiGbcp+OOu/1ZPLnsaPSH0dY9G/UgTo2/vHWZ2 /XBZZQEQglkkl5TH+G0Zyhn6j+JAZJ+3t4v6+kd7A54hwjaQVn8QKn5xoT63lPeDk3MB R+hA== MIME-Version: 1.0 X-Received: by 10.107.162.146 with SMTP id l140mr21286164ioe.123.1451844157937; Sun, 03 Jan 2016 10:02:37 -0800 (PST) Received: by 10.36.121.202 with HTTP; Sun, 3 Jan 2016 10:02:37 -0800 (PST) In-Reply-To: References: <1451841004.10139.34.camel@me.com> Date: Sun, 3 Jan 2016 10:02:37 -0800 Message-ID: Subject: Re: Does FreeBSD have sendmmsg or recvmmsg system calls? From: Adrian Chadd To: Robert Watson Cc: Rui Paulo , HuanHuan , FreeBSD Net Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 18:02:38 -0000 On 3 January 2016 at 09:46, Robert Watson wrote: > On Sun, 3 Jan 2016, Rui Paulo wrote: > >>> NetBSD 7.0 has just introduced these two syscalls. And Linux also has >>> them. >>> >>> Does FreeBSD have them? Or plan to support them in the future? >> >> >> FreeBSD does not have them. It doesn't seem especially hard to implement, >> though. Do you know any major application already using them? > > > I see no harm in having the system calls. When I chatted with the authors > of nsd a couple of years ago (they had originally promoted the approach), > they told me they felt it only offered incremental benefit and didn't > particularly recommend that FreeBSD adopt it. However, it would undoubtably > see use and does offer some opportunities for future batching-related > performance operations, so if someone wants to pursue introducing it, do go > ahead. Or just introduce a libc implementation that can be converted to a > kernel implementation later if that is determined to be beneficial. But the > nsd observations don't (currently) lead me to believe that it is critical to > do so. There's a paper from Yahoo! from a while ago where they did, among other things, add this functionality (to linux.) It doesn't help at low connection rates. It helps at high connection / concurrency rates as the time going in/out of the kernel and getting back to steady state execution changes. I can't find the paper off-hand, but it is out there. I can benchmark it on my UDP RSS stuff and see if it helps at the highest connection rates. :) -adrian