public inbox for [email protected]
 help / color / mirror / Atom feed
* [RFC PATCH v1 0/2] Documentation: Introducing `wq_cpu_set` mount option for btrfs
@ 2023-02-26 16:26 Ammar Faizi
  2023-02-26 16:26 ` [RFC PATCH v1 1/2] Documentation: btrfs: Document wq_cpu_set mount option Ammar Faizi
  2023-02-26 16:26 ` [RFC PATCH v1 2/2] Documentation: btrfs: Document the influence of wq_cpu_set to thread_pool option Ammar Faizi
  0 siblings, 2 replies; 8+ messages in thread
From: Ammar Faizi @ 2023-02-26 16:26 UTC (permalink / raw)
  To: Chris Mason, Josef Bacik, David Sterba
  Cc: Ammar Faizi, Filipe Manana, Linux Doc Mailing List,
	Linux Btrfs Mailing List, Linux Kernel Mailing List,
	Linux Fsdevel Mailing List, GNU/Weeb Mailing List

This is a follow up RFC of this series:
https://lore.kernel.org/linux-btrfs/[email protected]

It contains the documentation for the `wq_cpu_set` mount option.

Signed-off-by: Ammar Faizi <[email protected]>
---

Ammar Faizi (2):
  Documentation: btrfs: Document wq_cpu_set mount option
  Documentation: btrfs: Document the influence of wq_cpu_set to thread_pool option

 Documentation/ch-mount-options.rst | 32 ++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)


base-commit: 908b4b4450320e30fdef693f09b42f4eb93702c3
-- 
Ammar Faizi


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [RFC PATCH v1 1/2] Documentation: btrfs: Document wq_cpu_set mount option
  2023-02-26 16:26 [RFC PATCH v1 0/2] Documentation: Introducing `wq_cpu_set` mount option for btrfs Ammar Faizi
@ 2023-02-26 16:26 ` Ammar Faizi
  2023-02-27  2:24   ` Bagas Sanjaya
  2023-02-26 16:26 ` [RFC PATCH v1 2/2] Documentation: btrfs: Document the influence of wq_cpu_set to thread_pool option Ammar Faizi
  1 sibling, 1 reply; 8+ messages in thread
From: Ammar Faizi @ 2023-02-26 16:26 UTC (permalink / raw)
  To: Chris Mason, Josef Bacik, David Sterba
  Cc: Ammar Faizi, Filipe Manana, Linux Doc Mailing List,
	Linux Btrfs Mailing List, Linux Kernel Mailing List,
	Linux Fsdevel Mailing List, GNU/Weeb Mailing List

Document a new Btrfs mount option, wq_cpu_set.

Signed-off-by: Ammar Faizi <[email protected]>
---
 Documentation/ch-mount-options.rst | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/Documentation/ch-mount-options.rst b/Documentation/ch-mount-options.rst
index f0f205dc20fa15ff..48fe63ee5e95c297 100644
--- a/Documentation/ch-mount-options.rst
+++ b/Documentation/ch-mount-options.rst
@@ -451,6 +451,35 @@ user_subvol_rm_allowed
                 ordinary directory. Whether this is possible can be detected at runtime, see
                 *rmdir_subvol* feature in *FILESYSTEM FEATURES*.
 
+wq_cpu_set=<cpu_set>
+        (since: 6.5, default: all online CPUs)
+
+        Btrfs workqueues can slow sensitive user tasks down because they can use any
+        online CPU to perform heavy workloads on an SMP system. This option is used to
+        isolate the Btrfs workqueues to a set of CPUs. It is helpful to avoid
+        sensitive user tasks being preempted by Btrfs heavy workqueues.
+
+        The *cpu_set* is a dot-separated list of decimal numbers and ranges. The
+        numbers are CPU numbers, the ranges are inclusive. For example:
+
+                - *wq_cpu_set=0.3-7* will use CPUs 0, 3, 4, 5, 6 and 7.
+
+                - *wq_cpu_set=0.4.1.5* will use CPUs 0, 1, 4 and 5.
+
+        This option is similar to the taskset bitmask except that the comma separator
+        is replaced with a dot. The reason for this is that the mount option parser
+        uses commas to separate mount options.
+
+        If *wq_cpu_set* option is specificed and the *thread_pool* option is not, the
+        number of default max thread pool size will be set to the number of online
+        CPUs in the specified CPU set plus 2, if and only if the resulting number is
+        less than 8.
+
+        If *wq_cpu_set* option is specificed and the *thread_pool* option is also
+        specified, the thread pool size will be set to the value of *thread_pool*
+        option.
+
+
 DEPRECATED MOUNT OPTIONS
 ^^^^^^^^^^^^^^^^^^^^^^^^
 
-- 
Ammar Faizi


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [RFC PATCH v1 2/2] Documentation: btrfs: Document the influence of wq_cpu_set to thread_pool option
  2023-02-26 16:26 [RFC PATCH v1 0/2] Documentation: Introducing `wq_cpu_set` mount option for btrfs Ammar Faizi
  2023-02-26 16:26 ` [RFC PATCH v1 1/2] Documentation: btrfs: Document wq_cpu_set mount option Ammar Faizi
@ 2023-02-26 16:26 ` Ammar Faizi
  2023-02-27  2:15   ` Bagas Sanjaya
  1 sibling, 1 reply; 8+ messages in thread
From: Ammar Faizi @ 2023-02-26 16:26 UTC (permalink / raw)
  To: Chris Mason, Josef Bacik, David Sterba
  Cc: Ammar Faizi, Filipe Manana, Linux Doc Mailing List,
	Linux Btrfs Mailing List, Linux Kernel Mailing List,
	Linux Fsdevel Mailing List, GNU/Weeb Mailing List

If wq_cpu_set option is set, the default thread_pool value will be
adjusted accordingly.

Signed-off-by: Ammar Faizi <[email protected]>
---
 Documentation/ch-mount-options.rst | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/ch-mount-options.rst b/Documentation/ch-mount-options.rst
index 48fe63ee5e95c297..c38caf5e5fd0b719 100644
--- a/Documentation/ch-mount-options.rst
+++ b/Documentation/ch-mount-options.rst
@@ -411,6 +411,9 @@ thread_pool=<number>
         due to increased locking contention, process scheduling, cache-line bouncing or
         costly data transfers between local CPU memories.
 
+        Since 6.5, if *wq_cpu_set* is set, the default value will be the number of
+        online CPUs in the CPU wq_cpu_set plus 2.
+
 treelog, notreelog
         (default: on)
 
-- 
Ammar Faizi


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [RFC PATCH v1 2/2] Documentation: btrfs: Document the influence of wq_cpu_set to thread_pool option
  2023-02-26 16:26 ` [RFC PATCH v1 2/2] Documentation: btrfs: Document the influence of wq_cpu_set to thread_pool option Ammar Faizi
@ 2023-02-27  2:15   ` Bagas Sanjaya
  2023-02-27 10:02     ` Ammar Faizi
  0 siblings, 1 reply; 8+ messages in thread
From: Bagas Sanjaya @ 2023-02-27  2:15 UTC (permalink / raw)
  To: Ammar Faizi, Chris Mason, Josef Bacik, David Sterba
  Cc: Filipe Manana, Linux Doc Mailing List, Linux Btrfs Mailing List,
	Linux Kernel Mailing List, Linux Fsdevel Mailing List,
	GNU/Weeb Mailing List

[-- Attachment #1: Type: text/plain, Size: 341 bytes --]

On Sun, Feb 26, 2023 at 11:26:39PM +0700, Ammar Faizi wrote:
> +        Since 6.5, if *wq_cpu_set* is set, the default value will be the number of
> +        online CPUs in the CPU wq_cpu_set plus 2.
> +
  
Why will the behavior be introduced in such future version (6.5)?

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC PATCH v1 1/2] Documentation: btrfs: Document wq_cpu_set mount option
  2023-02-26 16:26 ` [RFC PATCH v1 1/2] Documentation: btrfs: Document wq_cpu_set mount option Ammar Faizi
@ 2023-02-27  2:24   ` Bagas Sanjaya
  2023-02-27 10:12     ` Ammar Faizi
  0 siblings, 1 reply; 8+ messages in thread
From: Bagas Sanjaya @ 2023-02-27  2:24 UTC (permalink / raw)
  To: Ammar Faizi, Chris Mason, Josef Bacik, David Sterba
  Cc: Filipe Manana, Linux Doc Mailing List, Linux Btrfs Mailing List,
	Linux Kernel Mailing List, Linux Fsdevel Mailing List,
	GNU/Weeb Mailing List

[-- Attachment #1: Type: text/plain, Size: 1601 bytes --]

On Sun, Feb 26, 2023 at 11:26:38PM +0700, Ammar Faizi wrote:
> +wq_cpu_set=<cpu_set>
> +        (since: 6.5, default: all online CPUs)

Why will the knob be introduced in 6.5 instead?

> +
> +        Btrfs workqueues can slow sensitive user tasks down because they can use any
> +        online CPU to perform heavy workloads on an SMP system. This option is used to
> +        isolate the Btrfs workqueues to a set of CPUs. It is helpful to avoid
> +        sensitive user tasks being preempted by Btrfs heavy workqueues.
> +
> +        The *cpu_set* is a dot-separated list of decimal numbers and ranges. The
> +        numbers are CPU numbers, the ranges are inclusive. For example:

"*cpu_set* is a dot-separated list of CPU numbers. Both individual
number and range (inclusive) can be listed".

> +
> +                - *wq_cpu_set=0.3-7* will use CPUs 0, 3, 4, 5, 6 and 7.
> +
> +                - *wq_cpu_set=0.4.1.5* will use CPUs 0, 1, 4 and 5.
> +
> +        This option is similar to the taskset bitmask except that the comma separator
> +        is replaced with a dot. The reason for this is that the mount option parser
> +        uses commas to separate mount options.

"... replaced by dots, since commas has already been used as mount
options separator".

> +        If *wq_cpu_set* option is specificed and the *thread_pool* option is also
> +        specified, the thread pool size will be set to the value of *thread_pool*
> +        option.

"If both options are set ..."

Thanks.

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC PATCH v1 2/2] Documentation: btrfs: Document the influence of wq_cpu_set to thread_pool option
  2023-02-27  2:15   ` Bagas Sanjaya
@ 2023-02-27 10:02     ` Ammar Faizi
  2023-03-01  2:06       ` Bagas Sanjaya
  0 siblings, 1 reply; 8+ messages in thread
From: Ammar Faizi @ 2023-02-27 10:02 UTC (permalink / raw)
  To: Bagas Sanjaya
  Cc: Chris Mason, Josef Bacik, David Sterba, Filipe Manana,
	Linux Doc Mailing List, Linux Btrfs Mailing List,
	Linux Kernel Mailing List, Linux Fsdevel Mailing List,
	GNU/Weeb Mailing List

On Mon, Feb 27, 2023 at 09:15:58AM +0700, Bagas Sanjaya wrote:
> Why will the behavior be introduced in such future version (6.5)?

It's not like it has been staged for the next merge window. It's still
in an RFC state. The changes are not trivial and need further review.

I don't know if it can hit the next merge window. As such, I picked a
long distance for this proposal. If it ends up going upstream sooner, we
can change this document.

-- 
Ammar Faizi


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC PATCH v1 1/2] Documentation: btrfs: Document wq_cpu_set mount option
  2023-02-27  2:24   ` Bagas Sanjaya
@ 2023-02-27 10:12     ` Ammar Faizi
  0 siblings, 0 replies; 8+ messages in thread
From: Ammar Faizi @ 2023-02-27 10:12 UTC (permalink / raw)
  To: Bagas Sanjaya
  Cc: Chris Mason, Josef Bacik, David Sterba, Filipe Manana,
	Linux Doc Mailing List, Linux Btrfs Mailing List,
	Linux Kernel Mailing List, Linux Fsdevel Mailing List,
	GNU/Weeb Mailing List

On Mon, Feb 27, 2023 at 09:24:16AM +0700, Bagas Sanjaya wrote:
> "*cpu_set* is a dot-separated list of CPU numbers. Both individual
> number and range (inclusive) can be listed".

Folded in.

> "... replaced by dots, since commas has already been used as mount
> options separator".

Folded in with s/commas/comma/.

> "If both options are set ..."

Folded in.

Thanks,

-- 
Ammar Faizi


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC PATCH v1 2/2] Documentation: btrfs: Document the influence of wq_cpu_set to thread_pool option
  2023-02-27 10:02     ` Ammar Faizi
@ 2023-03-01  2:06       ` Bagas Sanjaya
  0 siblings, 0 replies; 8+ messages in thread
From: Bagas Sanjaya @ 2023-03-01  2:06 UTC (permalink / raw)
  To: Ammar Faizi
  Cc: Chris Mason, Josef Bacik, David Sterba, Filipe Manana,
	Linux Doc Mailing List, Linux Btrfs Mailing List,
	Linux Kernel Mailing List, Linux Fsdevel Mailing List,
	GNU/Weeb Mailing List

On 2/27/23 17:02, Ammar Faizi wrote:
> On Mon, Feb 27, 2023 at 09:15:58AM +0700, Bagas Sanjaya wrote:
>> Why will the behavior be introduced in such future version (6.5)?
> 
> It's not like it has been staged for the next merge window. It's still
> in an RFC state. The changes are not trivial and need further review.
> 
> I don't know if it can hit the next merge window. As such, I picked a
> long distance for this proposal. If it ends up going upstream sooner, we
> can change this document.
> 

OK, thanks!

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-03-01  2:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-26 16:26 [RFC PATCH v1 0/2] Documentation: Introducing `wq_cpu_set` mount option for btrfs Ammar Faizi
2023-02-26 16:26 ` [RFC PATCH v1 1/2] Documentation: btrfs: Document wq_cpu_set mount option Ammar Faizi
2023-02-27  2:24   ` Bagas Sanjaya
2023-02-27 10:12     ` Ammar Faizi
2023-02-26 16:26 ` [RFC PATCH v1 2/2] Documentation: btrfs: Document the influence of wq_cpu_set to thread_pool option Ammar Faizi
2023-02-27  2:15   ` Bagas Sanjaya
2023-02-27 10:02     ` Ammar Faizi
2023-03-01  2:06       ` Bagas Sanjaya

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox