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=-0.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,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 E48DCC4707F for ; Thu, 27 May 2021 19:05:59 +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 741FC613F6 for ; Thu, 27 May 2021 19:05:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 741FC613F6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:41416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmLKQ-0006sq-Gp for qemu-devel@archiver.kernel.org; Thu, 27 May 2021 15:05:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49538) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmLJ2-0005xY-Qi for qemu-devel@nongnu.org; Thu, 27 May 2021 15:04:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:57777) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmLIy-0004tw-98 for qemu-devel@nongnu.org; Thu, 27 May 2021 15:04:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622142266; 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=IT5WRcHfo5E/QejFpEbQusohyXMYAV2bMr/eXbUM4Bs=; b=D5TuTNHu4d+xbrHCZJLsny0z5f5d7Ip6HsVx+S4TCBKHoM3qyasSmfDymnjCPTCuEdlS5t wSd55WEcw8IVaJ9tEaPoYwC+a4Zttec90bS7oPJObN1UWFbuLQE4Zu7SI9YzOMJrmdHUP0 7e4Q4NYnVSoB+IvkVS3D3YkqJNsV5DU= Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-48-Q15PBf31MZG8exSd7QtUew-1; Thu, 27 May 2021 15:04:24 -0400 X-MC-Unique: Q15PBf31MZG8exSd7QtUew-1 Received: by mail-pg1-f197.google.com with SMTP id q64-20020a6343430000b02902164088f2f0so486250pga.5 for ; Thu, 27 May 2021 12:04:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IT5WRcHfo5E/QejFpEbQusohyXMYAV2bMr/eXbUM4Bs=; b=POisXNT2u3EJf4/KvE8i5bxg3Bod4ZBRko3EQWcUfA6xFgqgEcQCwp+v3UwGVQb4zb /GdWrcV4e6eXifbJzE8tsnpndrf4RZv9/jD+zbWjoL5zgtVZGhFxk58UmkJDYHFpj9lw lbRgctFxFREhcuJSHjx7RueWeXNklprY9s1+AvkvtLHwnKt+IkOhUAqjK5MJiyMc0AXM g6EgRtHvW9qFjGQZK4kd4MNz660honOD5ImvOq5t6+krAntgzpeUX/HoA24wxhAYe/2g F7FafanV1/EhI2K7n0zds/NHMjPAQBN7QYO7CYu6CZJpVzysAZpEoL+zyuopd8wLA36D x3ag== X-Gm-Message-State: AOAM530nZnR19KhZ+tKlkyeNj0oPGqJrkcRoXq+Y+MG4oD2Y9SSDH8Qt DHPiCiI31Dur20RceXv9zyrdeOGC5VgMHcDEM0Et2bY07yG+BBYbDr1Q7zmNeUTRbZGOodq24xj P5qnb6wCzRdHVhrJRUNV8tg7nR/6eKhA= X-Received: by 2002:a17:90b:2212:: with SMTP id kw18mr5308886pjb.150.1622142262931; Thu, 27 May 2021 12:04:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxivjP2Zz0s0WObkIqaafHTvSKeFU2KI41zqByjZGN02unTG6Q8fBdbeD3V4uQX6wZtmj7KzlDYnHqS+RsvmE8= X-Received: by 2002:a17:90b:2212:: with SMTP id kw18mr5308861pjb.150.1622142262664; Thu, 27 May 2021 12:04:22 -0700 (PDT) MIME-Version: 1.0 References: <20210518100757.31243-1-eesposit@redhat.com> <20210518100757.31243-2-eesposit@redhat.com> In-Reply-To: From: Paolo Bonzini Date: Thu, 27 May 2021 21:04:10 +0200 Message-ID: Subject: Re: [PATCH v2 1/7] block-copy: streamline choice of copy_range vs. read/write To: Stefan Hajnoczi Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="00000000000057771d05c3546d9f" Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@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.374, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=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: Emanuele Giuseppe Esposito , Kevin Wolf , Vladimir Sementsov-Ogievskiy , "open list:Block layer core" , qemu-devel , Max Reitz , John Snow Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --00000000000057771d05c3546d9f Content-Type: text/plain; charset="UTF-8" Il gio 27 mag 2021, 14:07 Stefan Hajnoczi ha scritto: > On Tue, May 18, 2021 at 12:07:51PM +0200, Emanuele Giuseppe Esposito wrote: > > } else { > > /* > > * We enable copy-range, but keep small copy_size, until first > > * successful copy_range (look at block_copy_do_copy). > > */ > > Is this comment still correct? It appears that this branch of the if > statement does not always enable copy-range (the !use_copy_range case). > It is correct, but it applies only if use_copy_range is true (the patch doesn't change this). Paolo > - s->use_copy_range = use_copy_range; > > - s->copy_size = MAX(s->cluster_size, BLOCK_COPY_MAX_BUFFER); > > + s->method = use_copy_range ? COPY_RANGE_SMALL : COPY_READ_WRITE; > --00000000000057771d05c3546d9f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Il gio 27 mag 2021, 14:07 Stefan Hajnoczi <stefanha@redhat.com> ha scritto:
=
On Tue, May 18, 2021 at 12:07:51PM +02= 00, Emanuele Giuseppe Esposito wrote:
>=C2=A0 =C2=A0 =C2=A0 } else {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /*
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* We enable copy-range, but ke= ep small copy_size, until first
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* successful copy_range (look = at block_copy_do_copy).
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/

Is this comment still correct? It appears that this branch of the if
statement does not always enable copy-range (the !use_copy_range case).
=

It i= s correct, but it applies only if use_copy_range is true (the patch doesn&#= 39;t change this).

Paolo=

> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 s->use_copy_range =3D use_copy_range;<= br> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 s->copy_size =3D MAX(s->cluster_siz= e, BLOCK_COPY_MAX_BUFFER);
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 s->method =3D use_copy_range ? COPY_RA= NGE_SMALL : COPY_READ_WRITE;
--00000000000057771d05c3546d9f--