Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752280AbdHQH6a (ORCPT ); Thu, 17 Aug 2017 03:58:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42214 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751850AbdHQH62 (ORCPT ); Thu, 17 Aug 2017 03:58:28 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com F2B3463764 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=vkuznets@redhat.com From: Vitaly Kuznetsov To: Boris Ostrovsky Cc: Peter Zijlstra , Linus Torvalds , Jork Loeser , KY Srinivasan , Simon Xiao , Haiyang Zhang , Stephen Hemminger , "luto\@kernel.org" , "hpa\@zytor.com" , "linux-kernel\@vger.kernel.org" , "rostedt\@goodmis.org" , "andy.shevchenko\@gmail.com" , "tglx\@linutronix.de" , "mingo\@kernel.org" , "linux-tip-commits\@vger.kernel.org" , "Kirill A. Shutemov" , Juergen Gross Subject: Re: [tip:x86/platform] x86/hyper-v: Use hypercall for remote TLB flush References: <20170802160921.21791-8-vkuznets@redhat.com> <20170810185646.GI6524@worktop.programming.kicks-ass.net> <20170810192742.GJ6524@worktop.programming.kicks-ass.net> <20170811090336.lfznz6qzrbhiqwvi@hirez.programming.kicks-ass.net> <20170811162605.tr4tig4av3q4fll6@hirez.programming.kicks-ass.net> <87fucup9ou.fsf@vitty.brq.redhat.com> <87shgrmpko.fsf@vitty.brq.redhat.com> <817e2efa-6154-a1c6-8ec7-de04324d6df8@oracle.com> Date: Thu, 17 Aug 2017 09:58:23 +0200 In-Reply-To: <817e2efa-6154-a1c6-8ec7-de04324d6df8@oracle.com> (Boris Ostrovsky's message of "Wed, 16 Aug 2017 17:41:12 -0400") Message-ID: <874lt639sw.fsf@vitty.brq.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 17 Aug 2017 07:58:28 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2066 Lines: 67 Boris Ostrovsky writes: > On 08/16/2017 12:42 PM, Vitaly Kuznetsov wrote: >> Vitaly Kuznetsov writes: >> >>> In case we decide to go HAVE_RCU_TABLE_FREE for all PARAVIRT-enabled >>> kernels (as it seems to be the easiest/fastest way to fix Xen PV) - what >>> do you think about the required testing? Any suggestion for a >>> specifically crafted micro benchmark in addition to standard >>> ebizzy/kernbench/...? >> In the meantime I tested HAVE_RCU_TABLE_FREE with kernbench (enablement >> patch I used is attached; I know that it breaks other architectures) on >> bare metal with PARAVIRT enabled in config. The results are: >> >>... >> >> As you can see, there's no notable difference. I'll think of a >> microbenchmark though. > > FWIW, I was about to send a very similar patch (but with only Xen-PV > enabling RCU-based free by default) and saw similar results with > kernbench, both Xen PV and baremetal. > Thanks for the confirmation, I'd go with enabling it for PARAVIRT as we will need it for Hyper-V too. >> >> #if CONFIG_PGTABLE_LEVELS > 4 >> void ___p4d_free_tlb(struct mmu_gather *tlb, p4d_t *p4d) >> { >> paravirt_release_p4d(__pa(p4d) >> PAGE_SHIFT); >> +#ifdef CONFIG_HAVE_RCU_TABLE_FREE >> + tlb_remove_table(tlb, virt_to_page(p4d)); >> +#else >> tlb_remove_page(tlb, virt_to_page(p4d)); >> +#endif > > This can probably be factored out. > >> } >> #endif /* CONFIG_PGTABLE_LEVELS > 4 */ >> #endif /* CONFIG_PGTABLE_LEVELS > 3 */ >> diff --git a/mm/memory.c b/mm/memory.c >> index e158f7ac6730..18d6671b6ae2 100644 >> --- a/mm/memory.c >> +++ b/mm/memory.c >> @@ -329,6 +329,11 @@ bool __tlb_remove_page_size(struct mmu_gather *tlb, struct page *page, int page_ >> * See the comment near struct mmu_table_batch. >> */ >> >> +static void __tlb_remove_table(void *table) >> +{ >> + free_page_and_swap_cache(table); >> +} >> + > > This needs to be a per-arch routine (e.g. see arch/arm64/include/asm/tlb.h). > Yea, this was a quick-and-dirty x86-only patch. -- Vitaly