From patchwork Sun Feb 26 16:26:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 13152453 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 B7080C64ED6 for ; Sun, 26 Feb 2023 16:26:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229793AbjBZQ04 (ORCPT ); Sun, 26 Feb 2023 11:26:56 -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 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org 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-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= + (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 ^^^^^^^^^^^^^^^^^^^^^^^^ From patchwork Sun Feb 26 16:26:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 13152454 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 CBFB4C64ED6 for ; Sun, 26 Feb 2023 16:27:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229832AbjBZQ1C (ORCPT ); Sun, 26 Feb 2023 11:27:02 -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 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org 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-options.rst index 48fe63ee5e95c297..c38caf5e5fd0b719 100644 --- a/Documentation/ch-mount-options.rst +++ b/Documentation/ch-mount-options.rst @@ -411,6 +411,9 @@ thread_pool= 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)