Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3038646imj; Mon, 11 Feb 2019 12:44:56 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ11NoHifNVdgWeH0Zn7tPE6S2YbzQ17F2u3+Zr0GNhADBlPkYe9SYkOApQI7JBkP/gXvif X-Received: by 2002:a17:902:8c8b:: with SMTP id t11mr110747plo.163.1549917896412; Mon, 11 Feb 2019 12:44:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549917896; cv=none; d=google.com; s=arc-20160816; b=Rat9t4hEWNLPJYZS4oUHxrLiqcWKxW909NjlV3xcNC1C4S/LC0v40TT5v4gC2SfaRY NSWtRbF7/WZh9n/Mytf/J8pbZWWY1wmGZgbfgcqoaEggDhgy7XnYrtN/NP+NIeuoj892 VBV5vuD9hPyO9pQl3+EhwQnhLknoD/H3FPjdXZwxSIdBFEl872ZbCkBBR667maivUfsF JmDEdVwtO2v2QExGlcbZY6BtgaxF738mfJFrsoU3O8TqQuR31ZxjUk5J+N/GnkdYsVPG 2tcgQpqrlrAnYnLIVPgRUmUOYHtvre86dUbGS0qohmPlOBLwEcF0V/BVbJBYSHxJr8T2 d0yQ== 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=dxIH/eelx8NvcTuXb7rX+FMWAP5tUyEeW4raaT3XX7s=; b=fvD2qc4YiSI/ghGpWI7ZSIREZdbpCgieAg9RY92XHX5DYK4zaxPX5yDI5L/5TPLTic ojmKamNHLFqziXeDVgb1dcqJNf9uCJx4W05WI/LD5v5A4H7F9aCXAmSXpZIXciN9Bjhf oWY/GCSTD83TeskYUfvp7OtlMM1x0CQG0MxwW6/HE0DHEBxwhGfV8uUGQFjqTw8WMG8w kZK0rZ63YDZkxYjnNoUMyXKfou9/HCmyX7ucComCuEEVfRcPR2V3J6+uDYZASMklU8KS HuShCP/fSruEZ6UMh8Fu4rj9o/NRJoVqDeZSykESKXeswmPi5piSc9Cbd10Datc+N8mq zoTQ== 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 a9si148474pla.226.2019.02.11.12.44.40; Mon, 11 Feb 2019 12:44:56 -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 S2387845AbfBKT4n (ORCPT + 99 others); Mon, 11 Feb 2019 14:56:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57742 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728293AbfBKT4m (ORCPT ); Mon, 11 Feb 2019 14:56:42 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BBDB980F81; Mon, 11 Feb 2019 19:56:41 +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 04D2C6091C; Mon, 11 Feb 2019 19:56:39 +0000 (UTC) Date: Mon, 11 Feb 2019 14:56:39 -0500 From: "Michael S. Tsirkin" To: Dave Hansen Cc: Alexander Duyck , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, rkrcmar@redhat.com, alexander.h.duyck@linux.intel.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 3/4] kvm: Add guest side support for free memory hints Message-ID: <20190211145531-mutt-send-email-mst@kernel.org> References: <20190204181118.12095.38300.stgit@localhost.localdomain> <20190204181552.12095.46287.stgit@localhost.localdomain> <20190209194437-mutt-send-email-mst@kernel.org> <0d12ccec-d05f-80b8-9498-710d521c81d2@intel.com> <20190211124925-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 11 Feb 2019 19:56:42 +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 10:19:17AM -0800, Dave Hansen wrote: > On 2/11/19 9:58 AM, Michael S. Tsirkin wrote: > >>> Really it seems we want a virtio ring so we can pass a batch of these. > >>> E.g. 256 entries, 2M each - that's more like it. > >> That only makes sense for a system that's doing high-frequency, > >> discontiguous frees of 2M pages. Right now, a 2M free/realloc cycle > >> (THP or hugetlb) is *not* super-high frequency just because of the > >> latency for zeroing the page. > > Heh but with a ton of free memory, and a thread zeroing some of > > it out in the background, will this still be the case? > > It could be that we'll be able to find clean pages > > at all times. > > In a systems where we have some asynchrounous zeroing of memory where > freed, non-zeroed memory is sequestered out of the allocator, yeah, that > could make sense. > > But, that's not what we have today. Right. I wonder whether it's smart to build this assumption into a host/guest interface though. > >> A virtio ring seems like an overblown solution to a non-existent problem. > > It would be nice to see some traces to help us decide one way or the other. > > Yeah, agreed. Sounds like we need some more testing to see if these > approaches hit bottlenecks anywhere.