Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3028609imj; Mon, 11 Feb 2019 12:34:14 -0800 (PST) X-Google-Smtp-Source: AHgI3IatenyaXVv3quZBRn9/bbrUn0S7+7yBs1Y7wCpb+ss+CSf1TYgzvxWlkqNwfIlCL8TfGesw X-Received: by 2002:a65:534b:: with SMTP id w11mr63103pgr.125.1549917254846; Mon, 11 Feb 2019 12:34:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549917254; cv=none; d=google.com; s=arc-20160816; b=hcCsCGYAhitkGd5gnGPz76S1U5XK/vsvstVKcOsPgptNoOFKssvn+78g/L19B+HB65 zFHxsR/NSPv+NrKy/yVnDRxMjKvvc+BvJW6hjcLu0QZ11+CVLZAfknLS6d2vb+kG+F53 iFhDwMwpTOyGn5GxqRp26R4gL9cRIJDKd6f1Qz7lKoofJMTXE/SVFHpCz2m12fbWQIQ+ j3iuCZuCVAeHnlI088bbSGQHYyc2/EtwiRN3XYkkOj0hLjMRMxZeKH9IoNMhJbjLI3TF Ar4QQ46e4CMv3jbzjyQWZIOJQKc5xsdiEbDlYD3kmZvvTMjKnI15sSEmJlHvK5k8pjaa UhKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=xsVA54csTuR8kUgnep2f50/Cfe6srgvDXnj+9MFvwNQ=; b=YyuHJQzP8E0pcxR05KoKEuIHxeYyuAkk01AGqXOaI6AiyRXlrTHZRlIXc9SQoawIpM SijLNyIWPvEVEPH/vwY4Pnf+Il6rVZdiqhW+FEqE6CG8QryZmXe6qUNz6thSB/Y2AXhC rue+2e54ZNw28i83yLMbt1iwrUPvJZWOkalpidyGYHSn0KDFT4A7wvEQNqLMhgjKfkgn b6afMfNdGKsoLwGVwzbeNyhBb3g0n8O55/MHnJ6NBkDZm5W2SaU1OJNXx7Er8DTR5iKg 6bJma/AIXvrAcg/scmHYbmnSCdXxrXKfyKRWSltL3ZPRnyZdjb0TPExEN6sDlEz47Z3+ iBIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o3si10339757pgq.139.2019.02.11.12.33.58; Mon, 11 Feb 2019 12:34:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731900AbfBKRg6 (ORCPT + 99 others); Mon, 11 Feb 2019 12:36:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39634 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726243AbfBKRg6 (ORCPT ); Mon, 11 Feb 2019 12:36:58 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2159DB650; Mon, 11 Feb 2019 17:36:58 +0000 (UTC) Received: from redhat.com (ovpn-120-40.rdu2.redhat.com [10.10.120.40]) by smtp.corp.redhat.com (Postfix) with SMTP id 163AE1850E; Mon, 11 Feb 2019 17:36:55 +0000 (UTC) Date: Mon, 11 Feb 2019 12:36:55 -0500 From: "Michael S. Tsirkin" To: Alexander Duyck Cc: Alexander Duyck , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, rkrcmar@redhat.com, x86@kernel.org, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, pbonzini@redhat.com, tglx@linutronix.de, akpm@linux-foundation.org Subject: Re: [RFC PATCH 2/4] kvm: Add host side support for free memory hints Message-ID: <20190211123638-mutt-send-email-mst@kernel.org> References: <20190204181118.12095.38300.stgit@localhost.localdomain> <20190204181546.12095.81356.stgit@localhost.localdomain> <20190209194108-mutt-send-email-mst@kernel.org> <96285ed154dbb92686ca0068e21f5e0500bb1ce7.camel@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <96285ed154dbb92686ca0068e21f5e0500bb1ce7.camel@linux.intel.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 11 Feb 2019 17:36:58 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 11, 2019 at 09:34:25AM -0800, Alexander Duyck wrote: > On Sat, 2019-02-09 at 19:44 -0500, Michael S. Tsirkin wrote: > > On Mon, Feb 04, 2019 at 10:15:46AM -0800, Alexander Duyck wrote: > > > From: Alexander Duyck > > > > > > Add the host side of the KVM memory hinting support. With this we expose a > > > feature bit indicating that the host will pass the messages along to the > > > new madvise function. > > > > > > This functionality is mutually exclusive with device assignment. If a > > > device is assigned we will disable the functionality as it could lead to a > > > potential memory corruption if a device writes to a page after KVM has > > > flagged it as not being used. > > > > I really dislike this kind of tie-in. > > > > Yes right now assignment is not smart enough but generally > > you can protect the unused page in the IOMMU and that's it, > > it's safe. > > > > So the policy should not leak into host/guest interface. > > Instead it is better to just keep the pages pinned and > > ignore the hint for now. > > Okay, I can do that. It also gives me a means of benchmarking just the > hypercall cost versus the extra page faults and zeroing. Good point. Same goes for poisoning :)