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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 14A35C4321E for ; Mon, 28 Nov 2022 20:37:42 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozksH-0000ch-Uu; Mon, 28 Nov 2022 15:37:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozksE-0000WD-DZ for qemu-devel@nongnu.org; Mon, 28 Nov 2022 15:37:07 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozks7-0003pi-Qh for qemu-devel@nongnu.org; Mon, 28 Nov 2022 15:37:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669667818; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=roHZtRoeAJ+wkYMKPWjdwDLQVX1nYkC/LiYFWWVsprs=; b=bbGLzsP4j6y7Vo6QebOxEBaMlVthc9ucFEz89nFW5VAR4W9hkW6dNe1YiCEhz343x4VqF1 Q37l1/FGfiluaiU4ED5lCxk6gQzFJ+w/Dx19aI3sLKo3kLTIpS1zMsM9t4Wd7LNf1mOBXR qeZkgN+Gw8dd0faINIwt02Q4XyNThsY= Received: from mail-il1-f200.google.com (mail-il1-f200.google.com [209.85.166.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-21-wPjtI5ApMpKVKot5dBEGCQ-1; Mon, 28 Nov 2022 15:36:56 -0500 X-MC-Unique: wPjtI5ApMpKVKot5dBEGCQ-1 Received: by mail-il1-f200.google.com with SMTP id i8-20020a056e0212c800b00302578e6d78so9861497ilm.0 for ; Mon, 28 Nov 2022 12:36:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=roHZtRoeAJ+wkYMKPWjdwDLQVX1nYkC/LiYFWWVsprs=; b=YQty82Cx6uGV3eLQZKV4ck3zQA7762iVprQ0yORs3UhEc+GzmB9RvP2Mxse3/zafiG PnKBCs3ol7/Xs5OGDVWSbBpEwxAfJ0g7fVofkR5JW+xjdZ6IAIJo7Gu1T8rmG4RsCgrJ k2de7voNgPt2IdQHKI/qT3YbtRHs2WNWj0yfuD3xz53gR31bFtPIP82VhF8ou5kLbTrI q90anm88FxVNG5bSHCFWwSddFamw3C60aFUzv+sIglpBD5k3tutPtx3jQRLUcwBy01sR Wv9qaR0i5+adNzCJsJYC2gvVD6unOeRJJHH+ITMToqRWQvxW0elitu6ZaS2CsmWkN4D7 3zUQ== X-Gm-Message-State: ANoB5pmlyBuBIFgcOOi9tHdsMe9s95Ejl2Mt8wmyCx8CbbG0fEzlq8SP UNq71L7gceW/9PUXonD8Sznx1bSHi/W8RoffN5RdI+nQQ0eRgJwp2sp/nPPnPq+vJnmBMlxGFij kCtwYGE6PonSboxI= X-Received: by 2002:a6b:6b07:0:b0:6dd:f70e:dda5 with SMTP id g7-20020a6b6b07000000b006ddf70edda5mr17655984ioc.100.1669667803423; Mon, 28 Nov 2022 12:36:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf4cIJCUIAHUv5wn+eOOvTXQtJ6b5XMqN3e4KjVp5Vm3952wALl2rDbCv4B7Apblk8wGfTa9Cw== X-Received: by 2002:a6b:6b07:0:b0:6dd:f70e:dda5 with SMTP id g7-20020a6b6b07000000b006ddf70edda5mr17655766ioc.100.1669667796414; Mon, 28 Nov 2022 12:36:36 -0800 (PST) Received: from redhat.com ([38.15.36.239]) by smtp.gmail.com with ESMTPSA id f30-20020a056602089e00b006df10f981a2sm4832429ioz.6.2022.11.28.12.36.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 12:36:35 -0800 (PST) Date: Mon, 28 Nov 2022 13:36:30 -0700 From: Alex Williamson To: Jason Gunthorpe Cc: Avihai Horon , qemu-devel@nongnu.org, Halil Pasic , Christian Borntraeger , Eric Farman , Richard Henderson , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Juan Quintela , "Dr. David Alan Gilbert" , "Michael S. Tsirkin" , Cornelia Huck , Paolo Bonzini , Stefan Hajnoczi , Fam Zheng , Eric Blake , Vladimir Sementsov-Ogievskiy , John Snow , qemu-s390x@nongnu.org, qemu-block@nongnu.org, Kunkun Jiang , "Zhang, Chen" , Yishai Hadas , Maor Gottlieb , Shay Drory , Kirti Wankhede , Tarun Gupta , Joao Martins Subject: Re: [PATCH v3 12/17] vfio/migration: Implement VFIO migration protocol v2 Message-ID: <20221128133630.07e1fa14.alex.williamson@redhat.com> In-Reply-To: References: <20221103161620.13120-1-avihaih@nvidia.com> <20221103161620.13120-13-avihaih@nvidia.com> <20221116112935.23118a30.alex.williamson@redhat.com> <099b99c2-8949-c101-45eb-9a8aaed2adb7@nvidia.com> <20221117103829.18feab7a.alex.williamson@redhat.com> <20221128115003.602d4ef7.alex.williamson@redhat.com> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=170.10.129.124; envelope-from=alex.williamson@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On Mon, 28 Nov 2022 15:40:23 -0400 Jason Gunthorpe wrote: > On Mon, Nov 28, 2022 at 11:50:03AM -0700, Alex Williamson wrote: > > > There's a claim here about added complexity that I'm not really seeing. > > It looks like we simply make an ioctl call here and scale our buffer > > based on the minimum of the returned device estimate or our upper > > bound. > > I'm not keen on this, for something like mlx5 that has a small precopy > size and large post-copy size it risks running with an under allocated > buffer, which is harmful to performance. I'm trying to weed out whether there are device assumptions in the implementation, seems like maybe we found one. MIG_DATA_SIZE specifies that it's an estimated data size for stop-copy, so shouldn't that provide the buffer size you're looking for? Thanks, Alex