linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vineet Gupta <vineet.gupta1@synopsys.com>
To: Peter Zijlstra <peterz@infradead.org>,
	"will.deacon@arm.com" <will.deacon@arm.com>,
	"aneesh.kumar@linux.vnet.ibm.com"
	<aneesh.kumar@linux.vnet.ibm.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"npiggin@gmail.com" <npiggin@gmail.com>
Cc: "linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux@armlinux.org.uk" <linux@armlinux.org.uk>,
	"heiko.carstens@de.ibm.com" <heiko.carstens@de.ibm.com>,
	"riel@surriel.com" <riel@surriel.com>,
	Richard Henderson <rth@twiddle.net>,
	Vineet Gupta <vineet.gupta1@synopsys.com>,
	Mark Salter <msalter@redhat.com>,
	Richard Kuo <rkuo@codeaurora.org>,
	Michal Simek <monstr@monstr.eu>,
	Paul Burton <paul.burton@mips.com>,
	Greentime Hu <green.hu@gmail.com>,
	Ley Foon Tan <lftan@altera.com>, Jonas Bonn <jonas@southpole.se>,
	Helge Deller <deller@gmx.de>,
	"David S. Miller" <davem@davemloft.net>,
	Guan Xuetao <gxt@pku.edu.cn>, Max Filippov <jcmvbkbc@gmail.com>
Subject: Re: [PATCH 12/18] arch/tlb: Clean up simple architectures
Date: Wed, 3 Oct 2018 17:03:50 +0000	[thread overview]
Message-ID: <C2D7FE5348E1B147BCA15975FBA23075012B09A59E@us01wembx1.internal.synopsys.com> (raw)
In-Reply-To: 20180926114801.146189550@infradead.org

On 09/26/2018 04:56 AM, Peter Zijlstra wrote:
> There are generally two cases:
>
>  1) either the platform has an efficient flush_tlb_range() and
>     asm-generic/tlb.h doesn't need any overrides at all.
>
>  2) or an architecture lacks an efficient flush_tlb_range() and
>     we override tlb_end_vma() and tlb_flush().
>
> Convert all 'simple' architectures to one of these two forms.
>
> alpha:	    has no range invalidate -> 2
> arc:	    already used flush_tlb_range() -> 1
> c6x:	    has no range invalidate -> 2
> h8300:	    has no mmu
> hexagon:    has an efficient flush_tlb_range() -> 1
>             (flush_tlb_mm() is in fact a full range invalidate,
> 	     so no need to shoot down everything)
> m68k:	    has inefficient flush_tlb_range() -> 2
> microblaze: has no flush_tlb_range() -> 2
> mips:	    has efficient flush_tlb_range() -> 1
> 	    (even though it currently seems to use flush_tlb_mm())
> nds32:	    already uses flush_tlb_range() -> 1
> nios2:	    has inefficient flush_tlb_range() -> 2
> 	    (no limit on range iteration)
> openrisc:   has inefficient flush_tlb_range() -> 2
> 	    (no limit on range iteration)
> parisc:	    already uses flush_tlb_range() -> 1
> sparc32:    already uses flush_tlb_range() -> 1
> unicore32:  has inefficient flush_tlb_range() -> 2
> 	    (no limit on range iteration)
> xtensa:	    has efficient flush_tlb_range() -> 1
>
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Vineet Gupta <vgupta@synopsys.com>
> Cc: Mark Salter <msalter@redhat.com>
> Cc: Richard Kuo <rkuo@codeaurora.org>
> Cc: Michal Simek <monstr@monstr.eu>
> Cc: Paul Burton <paul.burton@mips.com>
> Cc: Greentime Hu <green.hu@gmail.com>
> Cc: Ley Foon Tan <lftan@altera.com>
> Cc: Jonas Bonn <jonas@southpole.se>
> Cc: Helge Deller <deller@gmx.de>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Guan Xuetao <gxt@pku.edu.cn>
> Cc: Max Filippov <jcmvbkbc@gmail.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Nick Piggin <npiggin@gmail.com>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
>  arch/alpha/include/asm/tlb.h      |    2 --
>  arch/arc/include/asm/tlb.h        |   23 -----------------------
>  arch/c6x/include/asm/tlb.h        |    1 +
>  arch/h8300/include/asm/tlb.h      |    2 --
>  arch/hexagon/include/asm/tlb.h    |   12 ------------
>  arch/m68k/include/asm/tlb.h       |    1 -
>  arch/microblaze/include/asm/tlb.h |    4 +---
>  arch/mips/include/asm/tlb.h       |    8 --------
>  arch/nds32/include/asm/tlb.h      |   10 ----------
>  arch/nios2/include/asm/tlb.h      |    8 +++++---
>  arch/openrisc/include/asm/tlb.h   |    6 ++++--
>  arch/parisc/include/asm/tlb.h     |   13 -------------
>  arch/powerpc/include/asm/tlb.h    |    1 -
>  arch/sparc/include/asm/tlb_32.h   |   13 -------------
>  arch/unicore32/include/asm/tlb.h  |   10 ++++++----
>  arch/xtensa/include/asm/tlb.h     |   17 -----------------
>  16 files changed, 17 insertions(+), 114 deletions(-)
>
> --- a/arch/alpha/include/asm/tlb.h
> +++ b/arch/alpha/include/asm/tlb.h
> @@ -4,8 +4,6 @@
>  
>  #define tlb_start_vma(tlb, vma)			do { } while (0)
>  #define tlb_end_vma(tlb, vma)			do { } while (0)
> -#define __tlb_remove_tlb_entry(tlb, pte, addr)	do { } while (0)
> -
>  #define tlb_flush(tlb)				flush_tlb_mm((tlb)->mm)
>  
>  #include <asm-generic/tlb.h>
> --- a/arch/arc/include/asm/tlb.h
> +++ b/arch/arc/include/asm/tlb.h
> @@ -9,29 +9,6 @@
>  #ifndef _ASM_ARC_TLB_H
>  #define _ASM_ARC_TLB_H
>  
> -#define tlb_flush(tlb)				\
> -do {						\
> -	if (tlb->fullmm)			\
> -		flush_tlb_mm((tlb)->mm);	\
> -} while (0)
> -
> -/*
> - * This pair is called at time of munmap/exit to flush cache and TLB entries
> - * for mappings being torn down.
> - * 1) cache-flush part -implemented via tlb_start_vma( ) for VIPT aliasing D$
> - * 2) tlb-flush part - implemted via tlb_end_vma( ) flushes the TLB range
> - *
> - * Note, read https://urldefense.proofpoint.com/v2/url?u=http-3A__lkml.org_lkml_2004_1_15_6&d=DwIBaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=c14YS-cH-kdhTOW89KozFhBtBJgs1zXscZojEZQ0THs&m=5jiyvgRek4SKK5DUWDBGufVcuLez5G-jJCh3K-ndHsg&s=7uAzzw_jdAXMfb07B-vGPh3V1vggbTAsB7xL6Kie47A&e=
> - */
> -
> -#define tlb_end_vma(tlb, vma)						\
> -do {									\
> -	if (!tlb->fullmm)						\
> -		flush_tlb_range(vma, vma->vm_start, vma->vm_end);	\
> -} while (0)
> -
> -#define __tlb_remove_tlb_entry(tlb, ptep, address)
> -
>  #include <linux/pagemap.h>
>  #include <asm-generic/tlb.h>

LGTM per discussion in an earlier thread. However given that for "simpler" arches
the whole series doesn't apply can you please beef up the changelog so I don't go
scratching my head 2 years down the line. It currently describes the hows of
things but not exactly whys: shift_arg_pages missing tlb_start_vma,
move_page_tables look dodgy, yady yadda ?

Thx,
-Vineet


  parent reply	other threads:[~2018-10-03 17:03 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-26 11:36 [PATCH 00/18] my generic mmu_gather patches Peter Zijlstra
2018-09-26 11:36 ` Peter Zijlstra
2018-09-26 11:36 ` [PATCH 01/18] asm-generic/tlb: Provide a comment Peter Zijlstra
2018-09-26 11:36   ` Peter Zijlstra
2018-09-26 11:36 ` [PATCH 02/18] asm-generic/tlb: Provide HAVE_MMU_GATHER_PAGE_SIZE Peter Zijlstra
2018-09-26 11:36   ` Peter Zijlstra
2018-09-26 11:36 ` [PATCH 03/18] x86/mm: Page size aware flush_tlb_mm_range() Peter Zijlstra
2018-09-26 11:36   ` Peter Zijlstra
2018-09-26 11:36 ` [PATCH 04/18] asm-generic/tlb: Provide generic VIPT cache flush Peter Zijlstra
2018-09-26 11:36   ` Peter Zijlstra
2018-09-26 11:36 ` [PATCH 05/18] asm-generic/tlb: Provide generic tlb_flush Peter Zijlstra
2018-09-26 11:36   ` Peter Zijlstra
2018-09-26 12:53   ` Will Deacon
2018-09-26 12:53     ` Will Deacon
2018-09-26 13:11     ` Peter Zijlstra
2018-09-26 13:11       ` Peter Zijlstra
2018-09-26 18:07       ` Peter Zijlstra
2018-09-26 18:07         ` Peter Zijlstra
2018-09-27 12:14         ` Will Deacon
2018-09-27 12:14           ` Will Deacon
2018-09-26 11:36 ` [PATCH 06/18] asm-generic/tlb: Conditionally provide tlb_migrate_finish() Peter Zijlstra
2018-09-26 11:36   ` Peter Zijlstra
2018-09-26 12:53   ` Will Deacon
2018-09-26 12:53     ` Will Deacon
2018-09-26 11:36 ` [PATCH 07/18] asm-generic/tlb: Invert HAVE_RCU_TABLE_INVALIDATE Peter Zijlstra
2018-09-26 11:36   ` Peter Zijlstra
2018-09-26 11:36 ` [PATCH 08/18] arm/tlb: Convert to generic mmu_gather Peter Zijlstra
2018-09-26 11:36   ` Peter Zijlstra
2018-09-26 12:54   ` Will Deacon
2018-09-26 12:54     ` Will Deacon
2018-09-26 11:36 ` [PATCH 09/18] ia64/tlb: Conver " Peter Zijlstra
2018-09-26 11:36   ` Peter Zijlstra
2018-09-26 11:36 ` [PATCH 10/18] sh/tlb: Convert SH " Peter Zijlstra
2018-09-26 11:36   ` Peter Zijlstra
2018-09-26 11:36 ` [PATCH 11/18] um/tlb: Convert " Peter Zijlstra
2018-09-26 11:36   ` Peter Zijlstra
2018-09-26 11:36 ` [PATCH 12/18] arch/tlb: Clean up simple architectures Peter Zijlstra
2018-09-26 11:36   ` Peter Zijlstra
2018-10-03 17:03   ` Vineet Gupta [this message]
2018-10-03 17:03     ` Vineet Gupta
2018-10-11 15:04     ` Peter Zijlstra
2018-10-11 15:04       ` Peter Zijlstra
2018-10-12 19:40       ` Vineet Gupta
2018-10-12 19:40         ` Vineet Gupta
2018-10-15 14:14         ` Peter Zijlstra
2018-10-15 14:14           ` Peter Zijlstra
2018-09-26 11:36 ` [PATCH 13/18] asm-generic/tlb: Introduce HAVE_MMU_GATHER_NO_GATHER Peter Zijlstra
2018-09-26 11:36   ` Peter Zijlstra
2018-12-11  5:43   ` Aneesh Kumar K.V
2018-12-11  5:43     ` Aneesh Kumar K.V
2018-09-26 11:36 ` [PATCH 14/18] s390/tlb: convert to generic mmu_gather Peter Zijlstra
2018-09-26 11:36   ` Peter Zijlstra
2018-09-26 11:36 ` [PATCH 15/18] asm-generic/tlb: Remove arch_tlb*_mmu() Peter Zijlstra
2018-09-26 11:36   ` Peter Zijlstra
2018-09-26 11:36 ` [PATCH 16/18] asm-generic/tlb: Remove HAVE_GENERIC_MMU_GATHER Peter Zijlstra
2018-09-26 11:36   ` Peter Zijlstra
2018-09-26 11:36 ` [PATCH 17/18] asm-generic/tlb: Remove tlb_flush_mmu_free() Peter Zijlstra
2018-09-26 11:36   ` Peter Zijlstra
2018-09-26 11:36 ` [PATCH 18/18] asm-generic/tlb: Remove tlb_table_flush() Peter Zijlstra
2018-09-26 11:36   ` Peter Zijlstra
2018-09-26 12:47 ` [PATCH 00/18] my generic mmu_gather patches Will Deacon
2018-09-26 12:47   ` Will Deacon
2018-12-11  5:50 ` Aneesh Kumar K.V
2018-12-11  5:50   ` Aneesh Kumar K.V

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C2D7FE5348E1B147BCA15975FBA23075012B09A59E@us01wembx1.internal.synopsys.com \
    --to=vineet.gupta1@synopsys.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=davem@davemloft.net \
    --cc=deller@gmx.de \
    --cc=green.hu@gmail.com \
    --cc=gxt@pku.edu.cn \
    --cc=heiko.carstens@de.ibm.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=jonas@southpole.se \
    --cc=lftan@altera.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@armlinux.org.uk \
    --cc=monstr@monstr.eu \
    --cc=msalter@redhat.com \
    --cc=npiggin@gmail.com \
    --cc=paul.burton@mips.com \
    --cc=peterz@infradead.org \
    --cc=riel@surriel.com \
    --cc=rkuo@codeaurora.org \
    --cc=rth@twiddle.net \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).