x86: Add Kconfig option to use a 32bit TLB clock on debug
PATCH 1/1 x86: Add Kconfig option to use a 32bit TLB clock on debug
Debug builds stress the wrapping logic of the TLB clock by narrowing it down to 10 bits. This is inconvenient to test real time workloads on such builds.
Add Kconfig option to be able to selectively use the non-stressed behaviour on debug.
--- xen/arch/x86/Kconfig.debug | 8 ++++++++ xen/arch/x86/flushtlb.c | 6 +----- 2 files changed, 9 insertions(+), 5 deletions(-)
xen/arch/x86/Kconfig.debug +8 -0
@@ -0,0 +1,8 @@ +config DEBUG_TLB_CLK + bool "TLB clock stressing" + default DEBUG + help + Stress the TLB clock wrapping logic by narrowing down the counter to + just a few bits. On wrap-around a global TLB shootdown takes place. + + Disable to run real-time workloads more reliably on debug builds.
xen/arch/x86/flushtlb.c +1 -5
@@ -20,11 +20,7 @@#include <asm/spec_ctrl.h> /* Debug builds: Wrap frequently to stress-test the wrap logic. */ -#ifdef NDEBUG -#define WRAP_MASK (0xFFFFFFFFU) -#else -#define WRAP_MASK (0x000003FFU) -#endif +#define WRAP_MASK (IS_ENABLED(CONFIG_DEBUG_TLB_CLK) ? 0x3FFU : UINT32_MAX)#ifndef CONFIG_PV # undef X86_CR4_PCIDE
base-commit: 6238c97ea430706cb4a959b1474ad40a57ed1033
Signature · 1 line
2.43.0
Quoted 8 lines · Alejandro Vallejo
Debug builds stress the wrapping logic of the TLB clock by narrowing it down to 10 bits. This is inconvenient to test real time workloads on such builds.
Add
Kconfigoption to be able to selectively use the non-stressed behaviour on debug.Signed-off-by Alejandro Vallejo <[email protected]>
Hmm, yes, why not. However, ...
xen/arch/x86/flushtlb.c line 23
Quoted 12 lines
xen/arch/x86/flushtlb.c +1
-5@@ -20,11 +20,7 @@#include <asm/spec_ctrl.h> /* Debug builds: Wrap frequently to stress-test the wrap logic. */ -#ifdef NDEBUG -#define WRAP_MASK (0xFFFFFFFFU) -#else -#define WRAP_MASK (0x000003FFU) -#endif +#define WRAP_MASK (IS_ENABLED(CONFIG_DEBUG_TLB_CLK) ? 0x3FFU : UINT32_MAX)
... the comment then will want updating as well, I'd say. It doesn't go terribly stale this way, but at least slightly. I'd suggest to minimally drop "builds".
Jan
Quoted 16 lines · Jan Beulich
Quoted 8 lines · Alejandro Vallejo
Debug builds stress the wrapping logic of the TLB clock by narrowing it down to 10 bits. This is inconvenient to test real time workloads on such builds.
Add
Kconfigoption to be able to selectively use the non-stressed behaviour on debug.Signed-off-by Alejandro Vallejo <[email protected]>Hmm, yes, why not. However, ...
Quoted 5 lines
xen/arch/x86/flushtlb.c +0
-0@@ -20,11 +20,7 @@#include <asm/spec_ctrl.h>
Quoted 10 lines
xen/arch/x86/flushtlb.c line 23
Quoted 7 lines
xen/arch/x86/flushtlb.c +1
-5/* Debug builds: Wrap frequently to stress-test the wrap logic. */ -#ifdef NDEBUG -#define WRAP_MASK (0xFFFFFFFFU) -#else -#define WRAP_MASK (0x000003FFU) -#endif +#define WRAP_MASK (IS_ENABLED(CONFIG_DEBUG_TLB_CLK) ? 0x3FFU : UINT32_MAX)... the comment then will want updating as well, I'd say. It doesn't go terribly stale this way, but at least slightly. I'd suggest to minimally drop "builds".
I'm suggest just dropping WRAP_MASK.
We've done this locally in the XenServer patchqueue since 2011 or so due to the overhead, and I don't think it's interesting enough to warrant a separate option.
~Andrew
Quoted 17 lines · Andrew Cooper
Quoted 16 lines · Jan Beulich
Quoted 8 lines · Alejandro Vallejo
Debug builds stress the wrapping logic of the TLB clock by narrowing it down to 10 bits. This is inconvenient to test real time workloads on such builds.
Add
Kconfigoption to be able to selectively use the non-stressed behaviour on debug.Signed-off-by Alejandro Vallejo <[email protected]>Hmm, yes, why not. However, ...
Quoted 5 lines
xen/arch/x86/flushtlb.c +0
-0@@ -20,11 +20,7 @@#include <asm/spec_ctrl.h>
Quoted 10 lines
Quoted 10 lines
xen/arch/x86/flushtlb.c line 23
Quoted 7 lines
xen/arch/x86/flushtlb.c +1
-5/* Debug builds: Wrap frequently to stress-test the wrap logic. */ -#ifdef NDEBUG -#define WRAP_MASK (0xFFFFFFFFU) -#else -#define WRAP_MASK (0x000003FFU) -#endif +#define WRAP_MASK (IS_ENABLED(CONFIG_DEBUG_TLB_CLK) ? 0x3FFU : UINT32_MAX)... the comment then will want updating as well, I'd say. It doesn't go terribly stale this way, but at least slightly. I'd suggest to minimally drop "builds".
I left the comment because the rationale still holds. Dropping "builds" sounds good to me.
Quoted 8 lines
I'm suggest just dropping
WRAP_MASK.We've done this locally in the XenServer patchqueue since 2011 or so due to the overhead, and I don't think it's interesting enough to warrant a separate option.
~Andrew
I don't mind much either way. I need it gone for my needs and I don't care much how it happens.
Jan + Roger, do you have strong opinions on the matter?
Cheers,
Alejandro
Quoted 39 lines · Alejandro Vallejo
Quoted 17 lines · Andrew Cooper
Quoted 16 lines · Jan Beulich
Quoted 8 lines · Alejandro Vallejo
Debug builds stress the wrapping logic of the TLB clock by narrowing it down to 10 bits. This is inconvenient to test real time workloads on such builds.
Add
Kconfigoption to be able to selectively use the non-stressed behaviour on debug.Signed-off-by Alejandro Vallejo <[email protected]>Hmm, yes, why not. However, ...
Quoted 5 lines
xen/arch/x86/flushtlb.c +0
-0@@ -20,11 +20,7 @@#include <asm/spec_ctrl.h> Quoted 10 lines
Quoted 10 lines
xen/arch/x86/flushtlb.c line 23
Quoted 7 lines
xen/arch/x86/flushtlb.c +1
-5/* Debug builds: Wrap frequently to stress-test the wrap logic. */ -#ifdef NDEBUG -#define WRAP_MASK (0xFFFFFFFFU) -#else -#define WRAP_MASK (0x000003FFU) -#endif +#define WRAP_MASK (IS_ENABLED(CONFIG_DEBUG_TLB_CLK) ? 0x3FFU : UINT32_MAX)... the comment then will want updating as well, I'd say. It doesn't go terribly stale this way, but at least slightly. I'd suggest to minimally drop "builds".
I left the comment because the rationale still holds. Dropping "builds" sounds good to me.
Quoted 7 lines
I'm suggest just dropping
WRAP_MASK.We've done this locally in the XenServer patchqueue since 2011 or so due to the overhead, and I don't think it's interesting enough to warrant a separate option.
Quoted 6 lines
Quoted 1 line
~Andrew
I don't mind much either way. I need it gone for my needs and I don't care much how it happens.
Jan + Roger, do you have strong opinions on the matter?
Dropping altogether is fine with me.
Jan