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.6 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 12884C433EF for ; Tue, 7 Sep 2021 16:47:31 +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 AE1E261090 for ; Tue, 7 Sep 2021 16:47:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AE1E261090 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]:41250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNeFt-0006ey-E1 for qemu-devel@archiver.kernel.org; Tue, 07 Sep 2021 12:47:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNeDU-00057r-7T for qemu-devel@nongnu.org; Tue, 07 Sep 2021 12:45:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:42209) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNeDS-0005Wm-41 for qemu-devel@nongnu.org; Tue, 07 Sep 2021 12:44:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631033096; 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=Z6X1zXM+V3pfaHLneJgq0/QpNFsX88nqrIUCzsyp6qY=; b=DjOcsYY0uy8o1MS+0ymDTtsEHTn6VQCr4CD0aOI1xxz4sbJVD7CLKOYPLrXO0RslEUIv6r 6RaQFJCnpdrhsLAM3hjSl9ZDMuyFLW6MuhAxpITU0tSP6kyGNVS1l795mfRVhAYGBdvCL6 HeWObOlA9qWcMpDD9LC7EF9yFJv8hKE= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-242-BmFnhkHiOtWw338cJqnSjw-1; Tue, 07 Sep 2021 12:44:55 -0400 X-MC-Unique: BmFnhkHiOtWw338cJqnSjw-1 Received: by mail-qt1-f197.google.com with SMTP id c22-20020ac80096000000b0029f6809300eso15287287qtg.6 for ; Tue, 07 Sep 2021 09:44:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Z6X1zXM+V3pfaHLneJgq0/QpNFsX88nqrIUCzsyp6qY=; b=T35vj5xNSWuHbS26dKLRNrwUmL1/sUSyKjfGsJsKF96IwprWMW1Z5PCeZnfrelqpbO h2JO92e4UAyELi53DumF1ysb5DgH4HFo+AGuW/BCVxdPOgrsrUewP7D5b4XcySRqI46R aL4JFryuR0yXrPil3yoD6sykSMTP7oFpyn0J0r9YdFdyKK8UcrLO03ztZETi8ojKS330 yU8EsdQb+75GZtXkzmkCtNUQ0jOotbe33nlQlrxy+TP+nIb+mWO3Mhux5BqCE7UEOQSj LB2hiPdzz78tGD7xVdDvJriIqIlHKhh49dDiiigD3bBo7o5WjzXPECV1FsQZqvfAqpwX kNhw== X-Gm-Message-State: AOAM532WGSx9RNtkdFShqVokXFhs2LF7AI3UHPon2QaCShr4J8n4bnuj ZGEcw1XZ/oSp7Wdi/9Tgn3rog02Q70viOfMm97ZhWefz7qVD9K2moFV1GAob42qJ54sCRUGz39Y REKZNlZTb+bXrRaU= X-Received: by 2002:a05:620a:4411:: with SMTP id v17mr16374582qkp.367.1631033095339; Tue, 07 Sep 2021 09:44:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3nlyNVSl5Gfxx0zWNqEhZb6+rlnQIs3JKFOdqPA5lc+JgFcipw+ibtareEX2/kQ2TGpW0cQ== X-Received: by 2002:a05:620a:4411:: with SMTP id v17mr16374548qkp.367.1631033095055; Tue, 07 Sep 2021 09:44:55 -0700 (PDT) Received: from t490s ([2607:fea8:56a3:500::ad7f]) by smtp.gmail.com with ESMTPSA id j6sm7542648qtp.97.2021.09.07.09.44.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Sep 2021 09:44:54 -0700 (PDT) Date: Tue, 7 Sep 2021 12:44:52 -0400 From: Peter Xu To: Leonardo Bras Soares Passos Subject: Re: [PATCH v1 2/3] io: Add zerocopy and errqueue Message-ID: References: <20210831110238.299458-1-leobras@redhat.com> <20210831110238.299458-3-leobras@redhat.com> 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.391, 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 , 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 02, 2021 at 03:59:25AM -0300, Leonardo Bras Soares Passos wrote: > I also suggested something like that, but I thought it could be good if we could > fall back to io_writev() if we didn't have the zerocopy feature (or > the async feature). > > What do you think? That fallback looks safe and ok, I'm just not sure whether it'll be of great help. E.g. if we provide an QIO api that allows both sync write and zero-copy write (then we do the fallback when necessary), it means the buffer implication applies too to this api, so it's easier to me to just detect the zero copy capability and use one alternative. Thanks, -- Peter Xu