Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3028873imj; Mon, 11 Feb 2019 12:34:30 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ9Zz+eDl8dJkuWCQYcCCz9cyPpHhW4RV16NsYds8SHioJeMm+02rsWlKUeWsXHlY6jPJ+3 X-Received: by 2002:a63:1544:: with SMTP id 4mr88388pgv.290.1549917270311; Mon, 11 Feb 2019 12:34:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549917270; cv=none; d=google.com; s=arc-20160816; b=z6N3KKp9FBzAjyHcxkD6awareGohbq80Mc6h2eEv+J4SouD8X+59WlI63EwtcoLyjz 4wKT6nee80cwQa+oqAORXMBdyb35YZuaH6Biq76EVIfjaCRjM8Sh2tOJI/eL3i3D7zVa ANA8Q1hrIR90VV59AMFPowC6Z5gEXZ0VTAJ/MP8Yju5ca3DCYwC9rY0UE/hOXkMh7ReV T4iFrkMp5vhbtw37jhDvCbQAlBJfFcQNNMvZF7K4Ga750VfBvn5O6RWd8nLLMr5Os927 U+C8Ewdmz8PptvI9P4pDzuX/Tu8HxCEvUh9ox+ah0IaVpKIzV9CWwJtVrfzEFDnjPwm7 zdYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=LPQ0NAtKDMPm6CxxOglL8HW9f3oqzQiHpreLseXG/0U=; b=CkccgTvSytJQRjmf4yAz5DsVR8T0B19SkTTau82tFUbSJIE+ESJqCff2975sLoIuD8 bGGIRaWYFW9V/lxDRD+oJo1iNPN9Wz2zL1/Ww6YSk/Ixy3f62079KVaoCxHjk9nXJuJk TZclTKa+Bc+WPKQHwEQXg236p1HAvG1hfTn5eN2jo1zEng9qcJEE8MioIjAq1f/5TNh+ /Zv2BFSehUwPcMB9ma0DyxEuNz7CFAewRcv+QVSL4fUOOJIAJMk0Y9HgX408YaC3bdY1 9c9I+3iWRGpfYqWBB4D3YkkNL1DCZA9+pXAl3Utw8lCxtKC8+DUDndpii/7fifGbSrMr ZrLw== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3si931480pfd.250.2019.02.11.12.34.14; Mon, 11 Feb 2019 12:34:30 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731693AbfBKRe0 (ORCPT + 99 others); Mon, 11 Feb 2019 12:34:26 -0500 Received: from mga01.intel.com ([192.55.52.88]:49856 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727393AbfBKRe0 (ORCPT ); Mon, 11 Feb 2019 12:34:26 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Feb 2019 09:34:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,359,1544515200"; d="scan'208";a="117035838" Received: from ahduyck-desk1.jf.intel.com ([10.7.198.76]) by orsmga008.jf.intel.com with ESMTP; 11 Feb 2019 09:34:25 -0800 Message-ID: <96285ed154dbb92686ca0068e21f5e0500bb1ce7.camel@linux.intel.com> Subject: Re: [RFC PATCH 2/4] kvm: Add host side support for free memory hints From: Alexander Duyck To: "Michael S. Tsirkin" , Alexander Duyck Cc: 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 Date: Mon, 11 Feb 2019 09:34:25 -0800 In-Reply-To: <20190209194108-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> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-2.fc28) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.