Re: [PATCH v10 6/6] x86/split_lock: Enable split lock detection by kernel parameter

From: Ingo Molnar
Date: Thu Nov 21 2019 - 01:04:56 EST



* Fenghua Yu <fenghua.yu@xxxxxxxxx> wrote:

> Split lock detection is disabled by default. Enable the feature by
> kernel parameter "split_lock_detect".
>
> Usually it is enabled in real time when expensive split lock issues
> cannot be tolerated so should be fatal errors, or for debugging and
> fixing the split lock issues to improve performance.
>
> Please note: enabling this feature will cause kernel panic or SIGBUS
> to user application when a split lock issue is detected.
>
> Signed-off-by: Fenghua Yu <fenghua.yu@xxxxxxxxx>
> Reviewed-by: Tony Luck <tony.luck@xxxxxxxxx>
> ---
> .../admin-guide/kernel-parameters.txt | 10 ++++++
> arch/x86/kernel/cpu/intel.c | 34 +++++++++++++++++++
> 2 files changed, 44 insertions(+)
>
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 8dee8f68fe15..1ed313891f44 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -3166,6 +3166,16 @@
>
> nosoftlockup [KNL] Disable the soft-lockup detector.
>
> + split_lock_detect
> + [X86] Enable split lock detection
> + This is a real time or debugging feature. When enabled
> + (and if hardware support is present), atomic
> + instructions that access data across cache line
> + boundaries will result in an alignment check exception.
> + When triggered in applications the kernel will send
> + SIGBUS. The kernel will panic for a split lock in
> + OS code.

It would be really nice to be able to enable/disable this runtime as
well, has this been raised before, and what was the conclusion?

Thanks,

Ingo