From owner-dev-commits-src-all@freebsd.org Wed Sep 15 15:47:25 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 A1AD6668CC7; Wed, 15 Sep 2021 15:47:25 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8l31417gz4vGh; Wed, 15 Sep 2021 15:47:25 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi1-f179.google.com with SMTP id v2so4729308oie.6; Wed, 15 Sep 2021 08:47:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eqSjJu5+J4GLd99U8MMNOTU4Qc/OtiFED+ir0R27a8o=; b=XEs5dg15VI6d19an30FbD+V2MUgr6xou5q90qSR6WYDLvqL9X0ewkdmbp68vecBH0P 126Ct63f09jF6oPMuYIYb/A5KRDf3vxx3ImUVDXvvYdVYHogZW60DvyZ0WPL4m1gqDZQ mbpXuMqYY1kpIxom4puw0Y+zgWySBJMv+sJ2WhsO6tbd112+Tml6RggSFoEh03TunQgG 3maIKI8LjXd+OI0aMEe3AsCrSe/TCJwy+E7FFcGEXrPFEs8sHv5Si+0CQy2HEBMEmYIg sMWdpn5b3SwG0QjWayHskc6A8MqMefq7wn3ZwnHB1mbYqULYmUEt6QSXvxcsZ53QVczL kpog== X-Gm-Message-State: AOAM5300AsyeRh+fNy8rN1Yx62sn/lJ9xeNrTWjhFmMANWw8A/RpwVjJ 6B/UDxhneLhl+lAx3zW0+r9NIu+mwklX6HzXs5bv+wGW X-Google-Smtp-Source: ABdhPJyVp8yiznXozERg69PZizR+01cYaw/7rQYozlH+c3sy8nLhL+2NR84uE7VBxeWxTm7jgAnAjMoWSZM9TyR3zOo= X-Received: by 2002:a54:4e94:: with SMTP id c20mr225040oiy.57.1631720839235; Wed, 15 Sep 2021 08:47:19 -0700 (PDT) MIME-Version: 1.0 References: <202109142046.18EKkfEN043871@gitrepo.freebsd.org> In-Reply-To: From: Alan Somers Date: Wed, 15 Sep 2021 09:47:08 -0600 Message-ID: Subject: Re: git: 1ecbc1d8e9d3 - main - cxgbe tom: Don't queue AIO requests on listen sockets. To: John Baldwin Cc: src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4H8l31417gz4vGh X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 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:47:25 -0000 On Wed, Sep 15, 2021 at 9:21 AM John Baldwin wrote: > 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 > Interesting. Do you know of any common applications that include this optimization? I've been working on the AIO ecosystem for Rust. It would be good to ensure that this use case works, especially if zero-copy ever works for non-TOE.