From owner-dev-commits-src-all@freebsd.org Wed Sep 15 15:20:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 69BBA66835C; Wed, 15 Sep 2021 15:20:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8kSW24ZGz4m71; Wed, 15 Sep 2021 15:20:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id A640B258BF; Wed, 15 Sep 2021 15:20:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: 1ecbc1d8e9d3 - main - cxgbe tom: Don't queue AIO requests on listen sockets. To: Alan Somers Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202109142046.18EKkfEN043871@gitrepo.freebsd.org> From: John Baldwin Message-ID: Date: Wed, 15 Sep 2021 08:20:56 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 15:20:59 -0000 On 9/14/21 1:53 PM, Alan Somers wrote: > On Tue, Sep 14, 2021 at 2:46 PM John Baldwin wrote: > >> The branch main has been updated by jhb: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=1ecbc1d8e9d3fbcd8e68fc68f0a32944a12ddb1e >> >> commit 1ecbc1d8e9d3fbcd8e68fc68f0a32944a12ddb1e >> Author: John Baldwin >> AuthorDate: 2021-09-14 20:46:14 +0000 >> Commit: John Baldwin >> CommitDate: 2021-09-14 20:46:14 +0000 >> >> cxgbe tom: Don't queue AIO requests on listen sockets. >> >> This is similar to the fixes in 141fe2dceeae. One difference is that >> TOE sockets do not change states (listen vs non-listen) once created, >> so no lock is needed for SOLISTENING(). >> >> Sponsored by: Chelsio Communications >> > > I've always wondered: what's the point to using AIO with sockets? Can't > everything socket-related be done better with non-blocking read/write and > kqueue? Zero-copy operation with TOE is why TOE uses AIO. Zero-copy of user buffers can't really work with the non-AIO APIs because the user buffer is free to be reused immediately after write(2) (and on the read side you don't know the buffer in advance to allow the NIC to write directly into the use buffer). In theory we could support zero-copy using mb_ext_pgs for aio_write() for the non-TOE case similar to what sendfile() does. -- John Baldwin