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=-5.0 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 242F4C433F5 for ; Thu, 9 Sep 2021 08:51:08 +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 8DB296113E for ; Thu, 9 Sep 2021 08:51:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8DB296113E 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]:56232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mOFly-0003Mc-N1 for qemu-devel@archiver.kernel.org; Thu, 09 Sep 2021 04:51:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38538) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mOFki-0002TF-Fu for qemu-devel@nongnu.org; Thu, 09 Sep 2021 04:49:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:20439) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mOFkg-0005wu-Ue for qemu-devel@nongnu.org; Thu, 09 Sep 2021 04:49:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631177385; 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=NhbByGCNvRZ0OorOBmTJuLXHa0paZLfAhCLdYPZCq/g=; b=gLcLQOwNcH1ve2zSiv/iqLF5zpWz+4cmETkYB4xqfw87ySaAV3zkgXMN1unlWOdLT6hRqK ft2RkH4lI2SyRjZBNbPKdqWHof/dEAoEfniCoojuGAOCPxYGy5Ai6i1cDSTPaCRNMUHXaJ s9yhTZaW05v5Cj5uTvR6Cvmb60bXtoc= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-68-FvNBnDOEMFCn-TDk15Uqvg-1; Thu, 09 Sep 2021 04:49:44 -0400 X-MC-Unique: FvNBnDOEMFCn-TDk15Uqvg-1 Received: by mail-wm1-f71.google.com with SMTP id x10-20020a7bc76a000000b002f8cba3fd65so577450wmk.2 for ; Thu, 09 Sep 2021 01:49:43 -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:user-agent; bh=NhbByGCNvRZ0OorOBmTJuLXHa0paZLfAhCLdYPZCq/g=; b=aaRX8vd3nJiL9KRGSV0LNz/q+oLBk2du6Sz8hCPIPskjg/04DDvpvx16FBeB0uYBWC DMsMwcXtdSG+7KOeTPpu+JUwyS6Vq1alCAeLRFTMvDrdzydhvAPs0eHPpwNf6Tsb59dv C9crW0S6ZhFu7SOYqeclPtytAWkDFiXjjTurBcc9zmHXZZQ0x9bcPyUywSzcVhBuF9XO EonLoADtaUtjIl2odLMCsyaKNt2kqakKMR0qk/rBs1logsh+4oI76NTdnQWwMyQM3CcF 8ADqoCsJuZpMRj89ojiSPD9j9IBPfV8GrvWWP342StLWWVMGoYPh2ao65xO/o7gDH1NC WhtQ== X-Gm-Message-State: AOAM533bLsrZ3lmdle4P54DqgV/HArRvwUk3Z6xHPkRZbQ3c7NArPHi3 YCMZYcuZYfcdwpvKv0nlnBPuo7st92lv5MbowYsgP3+XJVPFzvQn9p1gj/Dn+sVcev0tgRor3TR PgAttLxxMmi7xULI= X-Received: by 2002:a1c:1cc:: with SMTP id 195mr1789632wmb.188.1631177382828; Thu, 09 Sep 2021 01:49:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgGX+LWH/mVJENgcy5qH6Kvvjrcs1lXBXkd/6XvDW03A3Pa7qYXjFv/yFbOHck7mxb0H2URQ== X-Received: by 2002:a1c:1cc:: with SMTP id 195mr1789612wmb.188.1631177382665; Thu, 09 Sep 2021 01:49:42 -0700 (PDT) Received: from work-vm (cpc109021-salf6-2-0-cust453.10-2.cable.virginm.net. [82.29.237.198]) by smtp.gmail.com with ESMTPSA id t17sm1087248wra.95.2021.09.09.01.49.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Sep 2021 01:49:41 -0700 (PDT) Date: Thu, 9 Sep 2021 09:49:39 +0100 From: "Dr. David Alan Gilbert" To: Peter Xu Subject: Re: [PATCH v1 2/3] io: Add zerocopy and errqueue Message-ID: References: MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/2.0.7 (2021-05-04) Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Received-SPF: pass client-ip=170.10.133.124; envelope-from=dgilbert@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 =?iso-8859-1?Q?P=2E_Berrang=E9?= , qemu-block@nongnu.org, Juan Quintela , qemu-devel , Leonardo Bras Soares Passos , Paolo Bonzini , =?iso-8859-1?Q?Marc-Andr=E9?= Lureau , Fam Zheng , Jagannathan Raman Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" * Peter Xu (peterx@redhat.com) wrote: > 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 It might not be worth bothering with (2) - zerocopy fits a lot better with multifd's data organisation. Dave > 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 > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK