Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp4294847ima; Mon, 4 Feb 2019 13:50:06 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib/qAvJHrJr/gQuXcG0md4Y/f3jLocaSH52eWdW+3uOlfCxTCOu0wuhST3dEs9oDy2FwRcS X-Received: by 2002:a63:5346:: with SMTP id t6mr1449879pgl.40.1549317006269; Mon, 04 Feb 2019 13:50:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549317006; cv=none; d=google.com; s=arc-20160816; b=KtpkaRia6p7qMopSfEkHvaZmFcnJQZthDm0ysNNgwiblA+UIo3kBW8S9uNFRTUg+pY xuRex9ZvgSdkVwmAVpm86VVuFDwRJSnJzKeA0dBRJJgb8EaRGNTBojMj46kFXmASVzx0 5RMdUIIvVC5j0Ge28+cAQes7llpUJ7TivayEvD+P9h+PUGnE+QDKh9USGDzYQ7KK9pMo bCIXFrw0CDg2mJvO3AibLQwUke8hHt+Z4hP/M1PYZQIvtSreCXYVHQ3dKdMtXRHwoHOE cofcBjBmdpyxz7eO31mxbITNMggWS6g9mdg8FP7cLJUvWS49KGr+Mkj0+zBC0pZJQsCC ayEA== 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=FzmzpXuu8/fCHSd4jyfgEbXlD9wvm1SVDNvI6+YSdb4=; b=zsCIPuFVQQGrzngg4d/0UDLxtDnYAZc0kLt6nbT1nWDlEYXGNYQ/IZ1smA3C6uKFVM AvTqkVDdpaNPwRnZjO+6I3FeI45ToUJwZgXJzWf76DJgFdSlZQ86i8+xCNYbVdgv+aFI 6BpWCsgRWiVSbCxT8SkoX7TfoWs8yGY9KoN7RkI7KypZ7awMW+RowgrYaTdHmY2rjwhs NEeTKvOzNaf+Lpc7jL9Ia4tFrRFWSZg8kfrLkHiGT/JnZhkdiso9XlPCL7HOi9KFVKZu n3WEWs14JJQBvVI32W/TRuCZeCaowban21i/RrlTbIIBNReJ/KxRnNxTyS4RXkIAExCP nRvg== 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 1si1137496plp.114.2019.02.04.13.49.49; Mon, 04 Feb 2019 13:50:06 -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 S1729871AbfBDUmX (ORCPT + 99 others); Mon, 4 Feb 2019 15:42:23 -0500 Received: from mga04.intel.com ([192.55.52.120]:41935 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729087AbfBDUmX (ORCPT ); Mon, 4 Feb 2019 15:42:23 -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 fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Feb 2019 12:42:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,560,1539673200"; d="scan'208";a="115242169" Received: from ahduyck-desk1.jf.intel.com ([10.7.198.76]) by orsmga008.jf.intel.com with ESMTP; 04 Feb 2019 12:42:22 -0800 Message-ID: Subject: Re: [RFC PATCH 3/4] kvm: Add guest side support for free memory hints From: Alexander Duyck To: Dave Hansen , Alexander Duyck , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: 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, 04 Feb 2019 12:42:22 -0800 In-Reply-To: <24277842-c920-4a12-57d1-2ebcdf3c1534@intel.com> References: <20190204181118.12095.38300.stgit@localhost.localdomain> <20190204181552.12095.46287.stgit@localhost.localdomain> <24277842-c920-4a12-57d1-2ebcdf3c1534@intel.com> 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 Mon, 2019-02-04 at 11:44 -0800, Dave Hansen wrote: > On 2/4/19 10:15 AM, Alexander Duyck wrote: > > +#ifdef CONFIG_KVM_GUEST > > +#include > > +extern struct static_key_false pv_free_page_hint_enabled; > > + > > +#define HAVE_ARCH_FREE_PAGE > > +void __arch_free_page(struct page *page, unsigned int order); > > +static inline void arch_free_page(struct page *page, unsigned int order) > > +{ > > + if (static_branch_unlikely(&pv_free_page_hint_enabled)) > > + __arch_free_page(page, order); > > +} > > +#endif > > So, this ends up with at least a call, a branch and a ret added to the > order-0 paths, including freeing pages to the per-cpu-pageset lists. > That seems worrisome. > > What performance testing has been performed to look into the overhead > added to those paths? So far I haven't done much in the way of actual performance testing. Most of my tests have been focused on "is this doing what I think it is supposed to be doing". I have been debating if I want to just move the order checks to include them in the inline functions. In that case we would end up essentially just jumping over the call code.