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 B7B79C433EF for ; Thu, 9 Sep 2021 16:41:44 +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 6941E60F45 for ; Thu, 9 Sep 2021 16:41:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6941E60F45 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]:42680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mON7P-00016X-FY for qemu-devel@archiver.kernel.org; Thu, 09 Sep 2021 12:41:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58156) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mON6T-0008Bs-0u for qemu-devel@nongnu.org; Thu, 09 Sep 2021 12:40:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:39480) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mON6R-0002d5-Kv for qemu-devel@nongnu.org; Thu, 09 Sep 2021 12:40:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631205641; 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=wSXLPV80sck1IyyYzuRc7B7W7sIlvAeWZS15l6tJVIM=; b=U94cLW2oMmfClUXBWg8v7ZaCPMBc/xkwTm+ODxPN1KuZr4mJUPYSxsWrrURttR4UNxlEWo RqXNCx+9jJY4DxNQL8ndnCgn6vexm4EvE4HDveESJSSriIrGUH6/l8yU3Aj+mxz67STkpY wTK2O0vcFUOcCmQjYsGtbd4254R5yYA= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-320-kfq72SGtPqGeYmylxk3wxw-1; Thu, 09 Sep 2021 12:40:40 -0400 X-MC-Unique: kfq72SGtPqGeYmylxk3wxw-1 Received: by mail-qk1-f200.google.com with SMTP id d202-20020a3768d3000000b003d30722c98fso5204806qkc.10 for ; Thu, 09 Sep 2021 09:40:40 -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=wSXLPV80sck1IyyYzuRc7B7W7sIlvAeWZS15l6tJVIM=; b=YuyxeuBKXEKlD9MYej6I9SGshaUVh+HSp7ECNzOOzKQMJahFbBd+aXERjGd3GvaQ8p 0boOuLtldgH2asPeLNOKt+E8DVU+/Z6jw51r4PdTPEexLPEt+LowqgQUxTyQ5cJ3vFBH B/s0DazU20aIXbjCrYlRVCkP87C/Yj71UVNnZL+QW/CL7MdWosGvcyIzqXC7a9W98thO z6sr/yqbdIFNGZwouhFPUgiYKlB85rxoiQqJSP5VEng6QLaOUEY9FH02+Pel4XdC1csf LVG4BZHmwnrbZUAlkQURpzbasuvHYvFVyUyvbYq81JzpU26T8t5o9apnT85uHhxcr6XZ 2bWw== X-Gm-Message-State: AOAM532MxJxXX9Xb/h3jQMEdYAGSWAEJak9YAEKFxFv6zfdwR2++C1LZ hZKa1GrlE5rofK9H315WQyZd+vquthngaaJqvgrmfqQRMVkTtDOWttjtV17SLVcUHBURSBmvl6I cc1LWH6mfKAnXQkw= X-Received: by 2002:a37:84c3:: with SMTP id g186mr3681186qkd.276.1631205640231; Thu, 09 Sep 2021 09:40:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnreZemnBpUrzFRu8RkkCCl5iNuVsc2ziGp6KPJHALAjZwBITAXrZH2irBZih9jKnJmoheFg== X-Received: by 2002:a37:84c3:: with SMTP id g186mr3681161qkd.276.1631205639983; Thu, 09 Sep 2021 09:40:39 -0700 (PDT) Received: from t490s ([2607:fea8:56a3:500::ad7f]) by smtp.gmail.com with ESMTPSA id h70sm1660920qke.54.2021.09.09.09.40.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Sep 2021 09:40:39 -0700 (PDT) Date: Thu, 9 Sep 2021 12:40:37 -0400 From: Peter Xu To: Leonardo Bras Soares Passos 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=170.10.133.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=unavailable 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 , Jagannathan Raman , qemu-block@nongnu.org, Juan Quintela , qemu-devel , Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= , "Dr. David Alan Gilbert" , Paolo Bonzini , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Fam Zheng Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Thu, Sep 09, 2021 at 01:58:39AM -0300, Leonardo Bras Soares Passos wrote: > FWIW, what I had in mind for a (theoretical) migration setup with > io_async_writev() + io_async_flush(): One trivial concern is it's not strictly just "async" because "async" can happen on any nonblocking fd; here it's more "zerocopy" specific. But as long as Dan is okay with it I'm fine too to start with "async", as long as we do proper documentation on the requirement of lifecycle of the buffers. > - For guest RAM we can decide not to rw_lock memory on zerocopy, > because there is no need, > - For headers, we can decide to not use async (use io_writev() instead), > - flush() can happen each iteration of migration, or at each N > seconds, or at the end. I think we should only need the flush at the end of precopy, and that should also cover when switching to postcopy. We could merge this flush() into the existing per-iteration sync of multi-fd, but it's not strictly necessary, imho. We can see which is easier. The rest looks good to me. Thanks, -- Peter Xu