From nobody Mon Sep 8 18:56:56 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EEB99C7EE2F for ; Sun, 26 Feb 2023 16:26:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229819AbjBZQ05 (ORCPT ); Sun, 26 Feb 2023 11:26:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbjBZQ0y (ORCPT ); Sun, 26 Feb 2023 11:26:54 -0500 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 726F11B2C4; Sun, 26 Feb 2023 08:26:53 -0800 (PST) Received: from localhost.localdomain (unknown [182.253.183.169]) by gnuweeb.org (Postfix) with ESMTPSA id 8E101831BF; Sun, 26 Feb 2023 16:26:49 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1677428813; bh=9m8PE6sXBOFOOOY6NkqZStqOnmlRwk8q43mx8hniEY4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JT9v5qKVM1voQrmRYpgWpLLalX8AeNQ2wWeaC2DNNLGWvaUNKhhMMFVQ674uPkpdb QLxrSwjGffkMgo5c36Exrfh/Z830WWlowPdJuf9+Yng2BuKCCCFf9bBWYd6w7EA0YS hA2Je+hJ+pW9BK8lQF2EZ1q5OPsWksOk3q/RAPE+R8nLETUfIH6yMEV+dDK3uESyl5 UZHMquwNIddXIzprSg+SAXzufhx0uC2QoSoQnM0Q2bDYm12o9vcwMxLN0FewZh8vg8 5DddegOIKAhARFBYd4pTuuSv/JwelVf4IUb4iGsYrKLfdl/fMXB/viK8PEEPGnmOAs lACT6/6osOMQQ== From: Ammar Faizi 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 Subject: [RFC PATCH v1 1/2] Documentation: btrfs: Document wq_cpu_set mount option Date: Sun, 26 Feb 2023 23:26:38 +0700 Message-Id: <20230226162639.20559-2-ammarfaizi2@gnuweeb.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230226162639.20559-1-ammarfaizi2@gnuweeb.org> References: <20230226162639.20559-1-ammarfaizi2@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Document a new Btrfs mount option, wq_cpu_set. Signed-off-by: Ammar Faizi --- Documentation/ch-mount-options.rst | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Documentation/ch-mount-options.rst b/Documentation/ch-mount-op= tions.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 detect= ed at runtime, see *rmdir_subvol* feature in *FILESYSTEM FEATURES*. =20 +wq_cpu_set=3D + (since: 6.5, default: all online CPUs) + + Btrfs workqueues can slow sensitive user tasks down because they c= an use any + online CPU to perform heavy workloads on an SMP system. This optio= n is used to + isolate the Btrfs workqueues to a set of CPUs. It is helpful to av= oid + sensitive user tasks being preempted by Btrfs heavy workqueues. + + The *cpu_set* is a dot-separated list of decimal numbers and range= s. The + numbers are CPU numbers, the ranges are inclusive. For example: + + - *wq_cpu_set=3D0.3-7* will use CPUs 0, 3, 4, 5, 6 and 7. + + - *wq_cpu_set=3D0.4.1.5* will use CPUs 0, 1, 4 and 5. + + This option is similar to the taskset bitmask except that the comm= a separator + is replaced with a dot. The reason for this is that the mount opti= on 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 o= f 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 *threa= d_pool* + option. + + DEPRECATED MOUNT OPTIONS ^^^^^^^^^^^^^^^^^^^^^^^^ =20 --=20 Ammar Faizi From nobody Mon Sep 8 18:56:56 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA38AC7EE2F for ; Sun, 26 Feb 2023 16:27:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229809AbjBZQ1E (ORCPT ); Sun, 26 Feb 2023 11:27:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbjBZQ1A (ORCPT ); Sun, 26 Feb 2023 11:27:00 -0500 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3C9D1ADDC; Sun, 26 Feb 2023 08:26:57 -0800 (PST) Received: from localhost.localdomain (unknown [182.253.183.169]) by gnuweeb.org (Postfix) with ESMTPSA id D8F7F8319D; Sun, 26 Feb 2023 16:26:53 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1677428817; bh=a4DJSHEBNpCHZMkW0VGKhaz/c5vRBlHibuGW/RG0Z0c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UObI9LD2OmfFvyNxz1ZD3hoPDd+2RTOTgHbcsum87bh86LeOxf6LGw0lDV4USONap TlWHethmu0+KoGBntSf8f6FSPMJVcuvjPsYfYiOuBNMODN+0oT4TFsWwjngixkMni4 T7fWKLmsUmXsRm5zTgwaZymYVCYQoXGp1AkwwRz4vKdwhhWwWfn96Yv+cwSodqsxZQ 8RbWfvp4Pb7QdpEVa2REXi2qc2EaZ+7ThwB3QowsBQVeyebxQ5gFwX3wXz0nWRVVtd Zq9CRo4g5MCiZ3Tu2k175wyNwmxx5lnyJpg4eV6zF6N4Hcvoobx0zevPeMMuAluPa8 bEYqZlIQejVqQ== From: Ammar Faizi 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 Subject: [RFC PATCH v1 2/2] Documentation: btrfs: Document the influence of wq_cpu_set to thread_pool option Date: Sun, 26 Feb 2023 23:26:39 +0700 Message-Id: <20230226162639.20559-3-ammarfaizi2@gnuweeb.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230226162639.20559-1-ammarfaizi2@gnuweeb.org> References: <20230226162639.20559-1-ammarfaizi2@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" If wq_cpu_set option is set, the default thread_pool value will be adjusted accordingly. Signed-off-by: Ammar Faizi --- Documentation/ch-mount-options.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/ch-mount-options.rst b/Documentation/ch-mount-op= tions.rst index 48fe63ee5e95c297..c38caf5e5fd0b719 100644 --- a/Documentation/ch-mount-options.rst +++ b/Documentation/ch-mount-options.rst @@ -411,6 +411,9 @@ thread_pool=3D due to increased locking contention, process scheduling, cache-lin= e bouncing or costly data transfers between local CPU memories. =20 + Since 6.5, if *wq_cpu_set* is set, the default value will be the n= umber of + online CPUs in the CPU wq_cpu_set plus 2. + treelog, notreelog (default: on) =20 --=20 Ammar Faizi