Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3846950pxb; Tue, 26 Jan 2021 06:22:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJydKd3+o0EK3pBD6IRKYcPLvCNVabREHSOzeojuJNMD0/R+eNeteboncH6P8H2IR+0Z5vGY X-Received: by 2002:a17:906:7b84:: with SMTP id s4mr3581428ejo.520.1611670953092; Tue, 26 Jan 2021 06:22:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611670953; cv=none; d=google.com; s=arc-20160816; b=ahb+S9QIiN5NWZK99q+EKx7jJjHYFo+zaOs2EKv9hSDhmWtzfdqFt3UEMzbpyxBEyj ZCU6LwgII4rNq5YebMZlK8/jJlUwZEjk0RBJfW27FC7Q8T6TaKramV8MV3j+NZktKlBB CnRQZS4+G1gBeenr6d9UQ4Mo0JJepmDujoKxFuH/z+bsnieMEIE99RRdY+YDTvxCy9FH kL80zG9WG8+899vJo82OXVlN915vh+JTcEswutnCzJG9eSuu8Zyn34nyaQKUGAnA4A77 xDQZ5dPDMf/S0/Al8A1A0lWCY6hLfSmz352hPGTEEuJm7+hhDLX+9qDnUpEsWybySzUw PrJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version; bh=sNDUxw0Jwo0JHdc3qVEd2K/HH0XVVb19Up5OEwsfseA=; b=GOcBlG4iPxkJF16cK7ivgx0yHJCovZenGxZ+HQpvhlBS7bKO+EbbV4FactRoXBsqZF cyrKrbbssfkT+bRiwtybr/m1FOmhvoJadNzU0vh1Oqtw1zchdtFXqPz2RkVHbPW+m9ly ewNi9BN8mydbtwM7mGUh+bR8Tn0i3d2+WA4WzyRwlO+BKq4cmaDVplM6Hcyxgl39+N1Z FCWj2iDVLAgyJphvPZDipDjCGgqJLRP3UoInXRkFQhYYXyIy+c4yd6tkrCcJdQNWVFyi Yrtf4Sus4IYUlhZHKloSxpKqd7TfixCR6sUAdegJ+KgR1khDejMNS+rcSHHdcKdSW0VR HX4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f25si4770112ejc.384.2021.01.26.06.22.07; Tue, 26 Jan 2021 06:22:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405884AbhAZOUK (ORCPT + 99 others); Tue, 26 Jan 2021 09:20:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:53624 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405820AbhAZOTF (ORCPT ); Tue, 26 Jan 2021 09:19:05 -0500 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EBD0822D58; Tue, 26 Jan 2021 14:18:23 +0000 (UTC) Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1l4PAj-00A97b-WE; Tue, 26 Jan 2021 14:18:22 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 26 Jan 2021 14:18:21 +0000 From: Marc Zyngier To: Yanan Wang Cc: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Will Deacon , Catalin Marinas Subject: Re: [RFC PATCH v1 0/5] Enable CPU TTRem feature for stage-2 In-Reply-To: <20210126134202.381996-1-wangyanan55@huawei.com> References: <20210126134202.381996-1-wangyanan55@huawei.com> User-Agent: Roundcube Webmail/1.4.10 Message-ID: X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: wangyanan55@huawei.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, will@kernel.org, catalin.marinas@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Yanan, On 2021-01-26 13:41, Yanan Wang wrote: > Hi all, > This series enable CPU TTRem feature for stage-2 page table and a RFC > is sent > for some comments, thanks. > > The ARMv8.4 TTRem feature offers 3 levels of support when changing > block > size without changing any other parameters that are listed as requiring > use > of break-before-make. And I found that maybe we can use this feature to > make > some improvement for stage-2 page table and the following explains what > TTRem exactly does for the improvement. > > If migration of a VM with hugepages is canceled midway, KVM will adjust > the > stage-2 table mappings back to block mappings. We currently use BBM to > replace > the table entry with a block entry. Take adjustment of 1G block mapping > as an > example, with BBM procedures, we have to invalidate the old table entry > first, > flush TLB and unmap the old table mappings, right before installing the > new > block entry. In all honesty, I think the amount of work that is getting added to support this "migration cancelled mid-way" use case is getting out of control. This is adding a complexity and corner cases for a use case that really shouldn't happen that often. And it is adding it at the worse possible place, where we really should keep things as straightforward as possible. I would expect userspace to have a good enough knowledge of whether the migration is likely to succeed, and not to attempt it if it is likely to fail. And yes, it will fail sometimes. But it should be so rare that adding this various stages of BBM support shouldn't be that useful. Or is there something else that I am missing? Thanks, M. -- Jazz is not dead. It just smells funny...