Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp44091rwb; Mon, 26 Sep 2022 14:28:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5PD7vjs/cHA1iL64/luwaTBopxdun2ugi7PXW0w0CX5d6OPEHcGNvcsG9deSwnVWeu8a9l X-Received: by 2002:a17:906:cc5a:b0:77c:2df2:b78 with SMTP id mm26-20020a170906cc5a00b0077c2df20b78mr19449242ejb.95.1664227705454; Mon, 26 Sep 2022 14:28:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664227705; cv=none; d=google.com; s=arc-20160816; b=nEyBx6ToHv+C/ryhcIWMSwAQDYsj1EMHuSQgBhS9DTTOTLAS19AWERblbCUFPkMjKB dlm4NkU0i1nqkBJ9TFp2Wbi2GTbkGqeR8DmSmQVcb5Ms2A2feo/tFw3Z9O0ys3L5aa61 pl8LfyeoyuQdKlGifCkXcF73L4ufcNnHYS2CiabQ1sb/JxPCavlHIb32JBf8trkLucZo 6MpWwIqWupxKX4vSIPblfYcpdIVm4QaYOKVZxxOoqQv0/6ixtpDzTMZBU7D7MMDmF47F bi65L9wypFsTb+Wg3CgtzNprkTaulz4jksDC/DSGyT7/TODdV5u2Rc356gs9isYrq6gK yCRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=XMnwPZnwThAE4Ka6hIcctD7xP5BaW3tuhFZmcRvzFlg=; b=lZjyzybgw5un/N6puKC8I20JSTG+Dj01pJxnCcNzDPa/B+Wgud+e3/1V3H99ftSR/4 IUB9G2/IvUKZwPvmbFc4GCb0ypg0FWWpvmRD90/1ytRYTtfC2Ivba89r33YTnjfcsXC2 nJVQ+eiShyn574o+tcz2hn+DuQGLmyKXLNzr/1SsBu9JYoyo8tmSUwCezIV07n0LiEXP YDsh6VNMi6tOG7T6D39RBwxYRfm5LAsdxFZ1IhF5lE0QdVnofXfT49gdvm0eWs8l2AME QASEHCwirXcdkWllCzT+84IwznkkjvRG6FUN2Nw845w4ago9tYHmiY/UU4GRlBxc2H90 q+ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SBIFR70z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id he35-20020a1709073da300b0076fd1d815bcsi1182046ejc.748.2022.09.26.14.28.00; Mon, 26 Sep 2022 14:28:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SBIFR70z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230378AbiIZUKQ (ORCPT + 99 others); Mon, 26 Sep 2022 16:10:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230075AbiIZUKG (ORCPT ); Mon, 26 Sep 2022 16:10:06 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB3B82A710; Mon, 26 Sep 2022 13:10:05 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id bk15so4155091wrb.13; Mon, 26 Sep 2022 13:10:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=XMnwPZnwThAE4Ka6hIcctD7xP5BaW3tuhFZmcRvzFlg=; b=SBIFR70zxURT+LWWLEfwvyZjuFngwXp2GYa6lKWsrtGexM9TlF58m6/Jbl3y/B+Qxc msi7ARatidnq/2cGdQuxJ2ZJhcjHeJyh+rRgx9hj+k6BtMigjYL82Cg/iO9tQhehtx9E CzTkB1+kI0PfnvL/jgvGf6Qlz6INcfxdn6Sm7jRM5mplxz1yF3GutcCzEPLS5jaKCrtu g1wMlSRlksSD3LK4Wl39GuVKUjBzONDieC7LdrdUjlOsK/BHZw/kqN5MvhUWlHZgzkbH YTMNpqlmN/15v197DAtYY45pkVqUjsXHDTSrV8LYK19VLSOc+GKkoqkb2MdwyStbkwui L7/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=XMnwPZnwThAE4Ka6hIcctD7xP5BaW3tuhFZmcRvzFlg=; b=ijrHnRWw7Ijkr2RjxRg07XMnJHByvdwwLeiLCTmNpxH52DApkmnK43J6MSlItUCxer 7IV8vA6cy+PVB2JHidYFYd0YkSaAaSTNQlx9xcz7p131ROj4TbtWR1YKM+ij+YKAGOtT mZebKhmZR5bKKrpoZiqpuBAoGj0nrOCazTSAoEo8PswTT4lg7VC/O1EY5yV8JX0bVJt8 GMupMOaFAzjxgioQgas+DBR9SmJWK8XXUGD3cLxuthbLQXCyXbZv5PbMWkIa1hq6ay0h 2ayhoZjPM8z94fjklq8S/OkIm23eEPEbaMXlXf/vdXf/R8AwGZYZ+qBnxB3RlGttH0/O IjYw== X-Gm-Message-State: ACrzQf3jp9pkcVHFkC6ICdjAXEyHNrJCBPtM2wbXw5BP+i559+gtQR4K aGrQT0HKa9qYeF5dXlUCjq0= X-Received: by 2002:a5d:59ae:0:b0:22a:ff17:db96 with SMTP id p14-20020a5d59ae000000b0022aff17db96mr15109396wrr.299.1664223004343; Mon, 26 Sep 2022 13:10:04 -0700 (PDT) Received: from [192.168.8.100] (94.196.228.157.threembb.co.uk. [94.196.228.157]) by smtp.gmail.com with ESMTPSA id r3-20020a5d4e43000000b00228dc1c7063sm15109742wrt.85.2022.09.26.13.10.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Sep 2022 13:10:03 -0700 (PDT) Message-ID: <24b050e0-433f-dc97-7aab-15c9175f49fa@gmail.com> Date: Mon, 26 Sep 2022 21:08:27 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH net-next v4 00/27] io_uring zerocopy send Content-Language: en-US To: David Ahern , io-uring@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "David S . Miller" , Jakub Kicinski , Jonathan Lemon , Willem de Bruijn , Jens Axboe , kernel-team@fb.com References: <2c49d634-bd8a-5a7f-0f66-65dba22bae0d@kernel.org> <0f54508f-e819-e367-84c2-7aa0d7767097@gmail.com> <812c3233-1b64-8a0d-f820-26b98ff6642d@kernel.org> <3b81b3e1-2810-5125-f4a0-d6ba45c1fbd3@kernel.org> From: Pavel Begunkov In-Reply-To: <3b81b3e1-2810-5125-f4a0-d6ba45c1fbd3@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/24/22 19:28, David Ahern wrote: > On 7/17/22 8:19 PM, David Ahern wrote: >>> >>> Haven't seen it back then. In general io_uring doesn't stop submitting >>> requests if one request fails, at least because we're trying to execute >>> requests asynchronously. And in general, requests can get executed >>> out of order, so most probably submitting a bunch of requests to a single >>> TCP sock without any ordering on io_uring side is likely a bug. >> >> TCP socket buffer fills resulting in a partial send (i.e, for a given >> sqe submission only part of the write/send succeeded). io_uring was not >> handling that case. >> >> I'll try to find some time to resurrect the iperf3 patch and try top of >> tree kernel. > > With your zc_v5 branch (plus the init fix on using msg->sg_from_iter), > iperf3 with io_uring support (non-ZC case) no longer shows completions > with incomplete sends. So that is good improvement over the last time I > tried it. > > However, adding in the ZC support and that problem resurfaces - a lot of > completions are for an incomplete size. > > liburing comes from your tree, zc_v4 branch. Upstream does not have > support for notifications yet, so I can not move to it. > > Changes to iperf3 are here: > https://github.com/dsahern/iperf mods-3.10-io_uring Tried it out, the branch below fixes a small problem, adds a couple of extra optimisations and now it actually uses registered buffers. https://github.com/isilence/iperf iou-sendzc Still, the submission loop looked a bit weird, i.e. it submits I/O to io_uring only when it exhausts sqes instead of sending right away with some notion of QD and/or sending in batches. The approach is good for batching (SQ size =16 here), but not so for latency. I also see some CPU cycles being burnt in select(2). io_uring wait would be more natural and perhaps more performant, but I didn't spend enough time with iperf to say for sure. -- Pavel Begunkov