From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 552ECC433EF for ; Wed, 8 Sep 2021 15:24:54 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 039006109E for ; Wed, 8 Sep 2021 15:24:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 039006109E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:58770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNzRV-0006pS-4h for qemu-devel@archiver.kernel.org; Wed, 08 Sep 2021 11:24:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60164) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNzQr-00069J-6I for qemu-devel@nongnu.org; Wed, 08 Sep 2021 11:24:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26550) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNzQp-0002gx-Ik for qemu-devel@nongnu.org; Wed, 08 Sep 2021 11:24:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631114650; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GRIlG81pEb5Fc4MYCQN17EDkjqcizs1vN8BroMqa1vk=; b=SoJ/KPffinuKmPbBUQUm4AB4r9N9apimIAM/OF9mfA55ffbRYApL8S1S2k2opekZB9O7ZL mcS3JG9i97P2uyLyKkwQT8F3tVGTs5D6I4Fvmanh815Xq12F90sjAEJrDWhxozG2KVvl4u D/nD8kypZ5fZ5N/O4SMRNRG5ydKWe/k= Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-231-DZ4HUqkhN4SSwR_mqK7bxg-1; Wed, 08 Sep 2021 11:24:09 -0400 X-MC-Unique: DZ4HUqkhN4SSwR_mqK7bxg-1 Received: by mail-io1-f70.google.com with SMTP id k6-20020a6b3c060000b0290568c2302268so1954621iob.16 for ; Wed, 08 Sep 2021 08:24:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=GRIlG81pEb5Fc4MYCQN17EDkjqcizs1vN8BroMqa1vk=; b=7fBQYhtTUS4Thnk2SgbIXb/sFkKCCkfWrjnAiDV4MVjYhTYDJ3RXDHPpC5idDupQw0 8P8rA7FF60A2W+0DExYyAYUACmP6DYFC5FmSUz1AJlCRk9py6vIvdWILfuQCPDHLfCx3 5zotA8YZ0WICwRGjU3jZp2nQFaa7T3yCL6MmiTG/mC+PDZTf7tZ0DihVXjix/ZsIvbOO D60lhLUTayxRvPvTIqnq05wNRkmY9Abktg4YkVGGbhHgioNlj/qBrXXPz3LNV80eMOSi /FBcpwA698xyOLvU0AkzQfxNLQTK/MvpbPJiJW0AbMY9Acn+lG6A1i0uNR6vLRrUx105 xQXQ== X-Gm-Message-State: AOAM531vFzaRa03nRwMXzbhZQw1RDmqgPG4TJe6zgXkOt5CEvs28+cpO YXbg2p/ypwiUfUDRHwd6t1/QznizDzZAsy7GMDGANAC1EH+BazjwqDP6jHNef0j1tuIwcpwxh5z YcJPWAO7cA5A54kc= X-Received: by 2002:a02:ac11:: with SMTP id a17mr4237825jao.100.1631114649159; Wed, 08 Sep 2021 08:24:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgDk6FtwwiFAwjpntFsfA5QzXrpKOW7Q6YnmWX3RNi8mvZ3o6D+LFVFEOE52hclaBwSTXF6w== X-Received: by 2002:a02:ac11:: with SMTP id a17mr4237726jao.100.1631114647670; Wed, 08 Sep 2021 08:24:07 -0700 (PDT) Received: from t490s ([2607:fea8:56a3:500::ad7f]) by smtp.gmail.com with ESMTPSA id p15sm1318950iop.15.2021.09.08.08.24.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Sep 2021 08:24:07 -0700 (PDT) Date: Wed, 8 Sep 2021 11:24:05 -0400 From: Peter Xu To: "Dr. David Alan Gilbert" Subject: Re: [PATCH v1 2/3] io: Add zerocopy and errqueue Message-ID: References: MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Received-SPF: pass client-ip=216.205.24.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.393, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Elena Ufimtseva , John G Johnson , Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= , qemu-block@nongnu.org, Juan Quintela , qemu-devel , Leonardo Bras Soares Passos , Paolo Bonzini , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Fam Zheng , Jagannathan Raman Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Wed, Sep 08, 2021 at 09:30:58AM +0100, Dr. David Alan Gilbert wrote: > * Peter Xu (peterx@redhat.com) wrote: > > On Tue, Sep 07, 2021 at 12:06:15PM +0100, Dr. David Alan Gilbert wrote: > > > > > What if we do the 'flush()' before we start post-copy, instead of after each > > > > > iteration? would that be enough? > > > > > > > > Possibly, yes. This really need David G's input since he understands > > > > the code in way more detail than me. > > > > > > Hmm I'm not entirely sure why we have the sync after each iteration; > > > > We don't have that yet, do we? > > I think multifd does; I think it calls multifd_send_sync_main sometimes, > which I *think* corresponds to iterations. Oh.. Then we may need to: (1) Make that sync work for zero-copy too; say, semaphores may not be enough with it - we need to make sure all async buffers are consumed by checking the error queue of the sockets, (2) When we make zero-copy work without multi-fd, we may want some similar sync on the main stream too Thanks, > > Dave > > > > the case I can think of is if we're doing async sending, we could have > > > two versions of the same page in flight (one from each iteration) - > > > you'd want those to get there in the right order. > > > > From MSG_ZEROCOPY document: > > > > For protocols that acknowledge data in-order, like TCP, each > > notification can be squashed into the previous one, so that no more > > than one notification is outstanding at any one point. > > > > Ordered delivery is the common case, but not guaranteed. Notifications > > may arrive out of order on retransmission and socket teardown. > > > > So no matter whether we have a flush() per iteration before, it seems we may > > want one when zero copy enabled? > > > > Thanks, > > > > -- > > Peter Xu > > > -- > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK > -- Peter Xu