From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754586AbdHYHKz (ORCPT ); Fri, 25 Aug 2017 03:10:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49574 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754318AbdHYHKx (ORCPT ); Fri, 25 Aug 2017 03:10:53 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 54DEF5F798 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=vkuznets@redhat.com From: Vitaly Kuznetsov To: Peter Zijlstra Cc: x86@kernel.org, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "Kirill A. Shutemov" , Linus Torvalds , Jork Loeser , KY Srinivasan , Stephen Hemminger , Steven Rostedt , Juergen Gross , Boris Ostrovsky , Andrew Cooper , Andy Lutomirski Subject: Re: [PATCH v2] x86: enable RCU based table free References: <20170824092258.12375-1-vkuznets@redhat.com> <20170824143434.r7v3bjm3f32yvfg7@hirez.programming.kicks-ass.net> <878ti9rnom.fsf@vitty.brq.redhat.com> Date: Fri, 25 Aug 2017 09:10:46 +0200 In-Reply-To: <878ti9rnom.fsf@vitty.brq.redhat.com> (Vitaly Kuznetsov's message of "Thu, 24 Aug 2017 17:27:21 +0200") Message-ID: <87o9r4qg09.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; charset=utf-8 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 25 Aug 2017 07:10:53 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Vitaly Kuznetsov writes: > Peter Zijlstra writes: > >> On Thu, Aug 24, 2017 at 11:22:58AM +0200, Vitaly Kuznetsov wrote: >> >>> diff --git a/arch/x86/include/asm/tlb.h b/arch/x86/include/asm/tlb.h >>> index c7797307fc2b..d43a7fcafee9 100644 >>> --- a/arch/x86/include/asm/tlb.h >>> +++ b/arch/x86/include/asm/tlb.h >>> @@ -15,4 +15,9 @@ >>> >>> #include >>> >>> +static inline void __tlb_remove_table(void *table) >>> +{ >>> + free_page_and_swap_cache(table); >>> +} >> >> Most other archs have this in pgtable.h, only ARM* has it in tlb.h. >> > > Sure, I can move it in v3 if nobody objects. > Well, turns out it is going to be a bit tricky. free_page_and_swap_cache() is defined in linux/swap.h but we can't just include it from arch/x86/include/asm/pgtable.h as pgtable.h itself is included from swap.h: ... In file included from ./include/linux/mm.h:70:0, from ./include/linux/memcontrol.h:29, from ./include/linux/swap.h:8, from ./include/linux/suspend.h:4, from arch/x86/kernel/asm-offsets.c:12: ./arch/x86/include/asm/pgtable.h: In function ‘__tlb_remove_table’: ./arch/x86/include/asm/pgtable.h:1252:2: error: implicit declaration of function ‘free_page_and_swap_cache’; did you mean ‘file_write_and_wait_range’? [-Werror=implicit-function-declaration] free_page_and_swap_cache(table); ^~~~~~~~~~~~~~~~~~~~~~~~ ... An easy solution would be to make __tlb_remove_table() a define instead of inline but personally I'd rather prefer to follow ARM and leave it in tlb.h. -- Vitaly