From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Duyck Subject: Re: [RFC PATCH 3/4] kvm: Add guest side support for free memory hints Date: Mon, 04 Feb 2019 12:42:22 -0800 Message-ID: References: <20190204181118.12095.38300.stgit@localhost.localdomain> <20190204181552.12095.46287.stgit@localhost.localdomain> <24277842-c920-4a12-57d1-2ebcdf3c1534@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit 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 To: Dave Hansen , Alexander Duyck , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Return-path: In-Reply-To: <24277842-c920-4a12-57d1-2ebcdf3c1534@intel.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.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.