Re: [PATCH V2] x86/split_lock: Add sysctl to control the misery mode

From: Bagas Sanjaya
Date: Sat Oct 15 2022 - 23:01:06 EST


On Fri, Oct 14, 2022 at 03:05:06PM -0300, Guilherme G. Piccoli wrote:
> diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
> index ee6572b1edad..508952e42914 100644
> --- a/Documentation/admin-guide/sysctl/kernel.rst
> +++ b/Documentation/admin-guide/sysctl/kernel.rst
> @@ -1298,6 +1298,24 @@ watchdog work to be queued by the watchdog timer function, otherwise the NMI
> watchdog — if enabled — can detect a hard lockup condition.
>
>
> +split_lock_mitigate (x86 only)
> +=============
> +

The heading underline above is too short (doesn't cover the whole text
length), so I have applied the fixup:

---- >8 ----

diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
index c733d424d4e830..4824cfed71ab31 100644
--- a/Documentation/admin-guide/sysctl/kernel.rst
+++ b/Documentation/admin-guide/sysctl/kernel.rst
@@ -1315,7 +1315,7 @@ watchdog — if enabled — can detect a hard lockup condition.


split_lock_mitigate (x86 only)
-=============
+==============================

For x86 CPUs supporting the split lock detection mechanism, this parameter
allows the users to turn off what is called "the misery mode", which

> +For x86 CPUs supporting the split lock detection mechanism, this parameter
> +allows the users to turn off what is called "the misery mode", which
> +introduces intentional delay in userspace applications that split locks.
> +The goal of the misery mode is to prevent using such unaligned access to
> +DoS the system dropping the performance overall, but some of these split
> +locking programs are legacy and/or proprietary software that cannot be fixed,
> +so using this sysctl is a way to allow them to run with a decent performance.
> +
> += ===================================================================
> +0 Disables the misery mode - just warns the split lock on kernel log.
> +1 Enables the misery mode (this is the default) - penalizes the split
> + lockers with intentional performance degradation.
> += ===================================================================
> +
> +
> stack_erasing
> =============
>

The wording can be improved:

---- >8 ----

diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
index 4824cfed71ab31..961c19f4beae51 100644
--- a/Documentation/admin-guide/sysctl/kernel.rst
+++ b/Documentation/admin-guide/sysctl/kernel.rst
@@ -1320,15 +1320,15 @@ split_lock_mitigate (x86 only)
For x86 CPUs supporting the split lock detection mechanism, this parameter
allows the users to turn off what is called "the misery mode", which
introduces intentional delay in userspace applications that split locks.
-The goal of the misery mode is to prevent using such unaligned access to
-DoS the system dropping the performance overall, but some of these split
-locking programs are legacy and/or proprietary software that cannot be fixed,
-so using this sysctl is a way to allow them to run with a decent performance.
+The goal of this mode is to prevent using such unaligned access to
+drop the overall performance (and DoS the system). However, some of programs
+which uses split locking are legacy and/or proprietary software that cannot
+be fixed, so disabling this sysctl can allow them to run with a decent
+performance.

= ===================================================================
0 Disables the misery mode - just warns the split lock on kernel log.
-1 Enables the misery mode (this is the default) - penalizes the split
- lockers with intentional performance degradation.
+1 Enables the misery mode (default)
= ===================================================================


Thanks.

--
An old man doll... just what I always wanted! - Clara

Attachment: signature.asc
Description: PGP signature