diff mbox series

[1/3] x86: Update DEBUG_TLBFLUSH options description.

Message ID 20190410224449.10877-2-atish.patra@wdc.com (mailing list archive)
State New, archived
Headers show
Series TLB flush counters | expand

Commit Message

Atish Patra April 10, 2019, 10:44 p.m. UTC
CONFIG_DEBUG_TLBFLUSH was added in 'commit 3df3212f9722 ("x86/tlb: add
tlb_flushall_shift knob into debugfs")' to support tlb_flushall_shift
knob. The knob was removed in 'commit e9f4e0a9fe27 ("x86/mm: Rip out
complicated, out-of-date, buggy TLB flushing")'.  However, the debug
option was never removed from Kconfig. It was reused in commit
'9824cf9753ec ("mm: vmstats: tlb flush counters")' but the commit text was
never updated accordingly.

Update the Kconfig option description as per its current usage.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
---
 arch/x86/Kconfig.debug | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

Comments

Christoph Hellwig April 11, 2019, 6:56 a.m. UTC | #1
Given that this option enables generic code (which you reuse for RISC-V
later in this series) please also move the config option to
mm/Kconfig, proabbly keyed off another ARCH_HAVE_DEBUG_TLBFLUSH
symbol that the architecture can select.
Atish Patra April 12, 2019, 8:14 p.m. UTC | #2
On 4/10/19 11:56 PM, Christoph Hellwig wrote:
> Given that this option enables generic code (which you reuse for RISC-V
> later in this series) please also move the config option to
> mm/Kconfig, proabbly keyed off another ARCH_HAVE_DEBUG_TLBFLUSH
> symbol that the architecture can select.
> 

Sure.

Regards,
Atish
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
>
Borislav Petkov April 14, 2019, 2:27 p.m. UTC | #3
On Fri, Apr 12, 2019 at 01:14:54PM -0700, Atish Patra wrote:
> On 4/10/19 11:56 PM, Christoph Hellwig wrote:
> > Given that this option enables generic code (which you reuse for RISC-V
> > later in this series) please also move the config option to
> > mm/Kconfig, proabbly keyed off another ARCH_HAVE_DEBUG_TLBFLUSH
> > symbol that the architecture can select.
> > 
> 
> Sure.

And when you do that, instead of deleting the help text, make it
generic. Otherwise, there's no explanation anymore, how that option is
supposed to be used through tlb_flushall_shift.
Palmer Dabbelt April 25, 2019, 8:17 p.m. UTC | #4
On Wed, 10 Apr 2019 15:44:47 PDT (-0700), atish.patra@wdc.com wrote:
> CONFIG_DEBUG_TLBFLUSH was added in 'commit 3df3212f9722 ("x86/tlb: add
> tlb_flushall_shift knob into debugfs")' to support tlb_flushall_shift
> knob. The knob was removed in 'commit e9f4e0a9fe27 ("x86/mm: Rip out
> complicated, out-of-date, buggy TLB flushing")'.  However, the debug
> option was never removed from Kconfig. It was reused in commit
> '9824cf9753ec ("mm: vmstats: tlb flush counters")' but the commit text was
> never updated accordingly.
>
> Update the Kconfig option description as per its current usage.
>
> Signed-off-by: Atish Patra <atish.patra@wdc.com>
> ---
>  arch/x86/Kconfig.debug | 15 +++------------
>  1 file changed, 3 insertions(+), 12 deletions(-)
>
> diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
> index 15d0fbe27872..c1a48d4ffebb 100644
> --- a/arch/x86/Kconfig.debug
> +++ b/arch/x86/Kconfig.debug
> @@ -125,21 +125,12 @@ config DOUBLEFAULT
>  	  hair.
>
>  config DEBUG_TLBFLUSH
> -	bool "Set upper limit of TLB entries to flush one-by-one"
> +	bool "Save tlb flush statstics to vmstat"
>  	depends on DEBUG_KERNEL
>  	---help---
>
> -	X86-only for now.
> -
> -	This option allows the user to tune the amount of TLB entries the
> -	kernel flushes one-by-one instead of doing a full TLB flush. In
> -	certain situations, the former is cheaper. This is controlled by the
> -	tlb_flushall_shift knob under /sys/kernel/debug/x86. If you set it
> -	to -1, the code flushes the whole TLB unconditionally. Otherwise,
> -	for positive values of it, the kernel will use single TLB entry
> -	invalidating instructions according to the following formula:
> -
> -	flush_entries <= active_tlb_entries / 2^tlb_flushall_shift
> +	Add tlbflush statstics to vmstat. It is really helpful understand tlbflush
> +	performance and behavior. It should be enabled only for debugging purpose.
>
>  	If in doubt, say "N".

Reviewed-by: Palmer Dabbelt <palmer@sifivee.com>

I'm not going to take this via my tree, but I'll look into the next two.
Atish Patra April 29, 2019, 7:52 p.m. UTC | #5
On 4/14/19 7:29 AM, Borislav Petkov wrote:
> On Fri, Apr 12, 2019 at 01:14:54PM -0700, Atish Patra wrote:
>> On 4/10/19 11:56 PM, Christoph Hellwig wrote:
>>> Given that this option enables generic code (which you reuse for RISC-V
>>> later in this series) please also move the config option to
>>> mm/Kconfig, proabbly keyed off another ARCH_HAVE_DEBUG_TLBFLUSH
>>> symbol that the architecture can select.
>>>
>>
>> Sure.
> 
> And when you do that, instead of deleting the help text, make it
> generic. Otherwise, there's no explanation anymore, how that option is
> supposed to be used through tlb_flushall_shift.
> 
Not sure I am following you.
tlb_flushall_shift knob was removed by
commit e9f4e0a9fe27 ("x86/mm: Rip out complicated, out-of-date, buggy 
TLB flushing")


Regards,
Atish
diff mbox series

Patch

diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
index 15d0fbe27872..c1a48d4ffebb 100644
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
@@ -125,21 +125,12 @@  config DOUBLEFAULT
 	  hair.
 
 config DEBUG_TLBFLUSH
-	bool "Set upper limit of TLB entries to flush one-by-one"
+	bool "Save tlb flush statstics to vmstat"
 	depends on DEBUG_KERNEL
 	---help---
 
-	X86-only for now.
-
-	This option allows the user to tune the amount of TLB entries the
-	kernel flushes one-by-one instead of doing a full TLB flush. In
-	certain situations, the former is cheaper. This is controlled by the
-	tlb_flushall_shift knob under /sys/kernel/debug/x86. If you set it
-	to -1, the code flushes the whole TLB unconditionally. Otherwise,
-	for positive values of it, the kernel will use single TLB entry
-	invalidating instructions according to the following formula:
-
-	flush_entries <= active_tlb_entries / 2^tlb_flushall_shift
+	Add tlbflush statstics to vmstat. It is really helpful understand tlbflush
+	performance and behavior. It should be enabled only for debugging purpose.
 
 	If in doubt, say "N".