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 A11EAC6FA8E for ; Sun, 26 Feb 2023 18:26:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229678AbjBZS01 (ORCPT ); Sun, 26 Feb 2023 13:26:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229557AbjBZS0Z (ORCPT ); Sun, 26 Feb 2023 13:26:25 -0500 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97C0711EB0; Sun, 26 Feb 2023 10:26:24 -0800 (PST) Received: from biznet-home.integral.gnuweeb.org (unknown [182.253.183.169]) by gnuweeb.org (Postfix) with ESMTPSA id 8C45E83191; Sun, 26 Feb 2023 18:26:20 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1677435984; bh=Iz5h8+IvB6AGuGph3EUQwH4CjEnn4umqDZWcNOgJEhU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XmoHYGC+4XhKP+Syq5r9hpOCyl3yg8Xx/8d669vPKBl7eFyJUSGrRhheM9/1baMmP K1o48wOEL17Kzehoq3ICGyDQRKXrmh4/zvoE/EwsCWNEubD4NORt9yUgPDy0e1E4aS fgk0v3Ms1+TEjwmt5+XfsJbFBuN7zHnlC5yhyMNCQyTCTuTLjjOI3YYVUVvdSAosRY gwrNbez2CLyCg0YwV5ZgRhHV4swMlLHhDqYAawuouYWCc06HJq/PzuR/YvtZMrQy2U BdLJSfiZQfthlsrUxT7iTfmXKNyhgYLXyfsBm326fAqefkfAgt6gfO8yIGXZDSk+9O r7MEDUsqCzp1Q== Date: Mon, 27 Feb 2023 01:26:16 +0700 From: Ammar Faizi To: Tejun Heo Cc: Chris Mason , Josef Bacik , David Sterba , Lai Jiangshan , Filipe Manana , Linux Btrfs Mailing List , Linux Kernel Mailing List , Linux Fsdevel Mailing List , GNU/Weeb Mailing List Subject: Re: [RFC PATCH v1 0/6] Introducing `wq_cpu_set` mount option for btrfs Message-ID: References: <20230226160259.18354-1-ammarfaizi2@gnuweeb.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Bpl: hUx9VaHkTWcLO7S8CQCslj6OzqBx2hfLChRz45nPESx5VSB/xuJQVOKOB1zSXE3yc9ntP27bV1M1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Sun, 26 Feb 2023 07:01:41 -1000, Tejun Heo wrote: > Hmm... the allowed cpumasks for unbounded workqueues can already be set > through /sys/devices/virtual/workqueue/cpumask and also each individual > workqueue can be exposed in the matching subdirectory by setting WQ_SYSFS. > Wouldn't the proposed btrfs option be a bit reduandant? Thank you for the comment. I just realized the sysfs facility for this. So I will take a look into it deeper. For now, I have several reasons to use the `wq_cpu_set` option: 1. Currently, there are 15 btrfs workqueues. It would not be convenient to let the user manage each of them via the sysfs. Using `wq_cpu_set` option at mounting time allows the user to set all of them in one shot. (for btrfs maintainers): I am also not sure if the number of btrfs workqueues is stable so that the user can rely on the WQ_SYSFS facility. 2. I looked at /sys/devices/virtual/workqueue/ and saw its subdirectories. The directory name is taken from the wq->name. But how to distinguish multiple workqueues with the same name? Each btrfs mount will at least do this: alloc_workqueue("btrfs-compressed-write", flags, max_active); When we do: mount -t -o rw btrfs /dev/sda1 a; mount -t -o rw btrfs /dev/sda2 b; mount -t -o rw btrfs /dev/sda3 c; mount -t -o rw btrfs /dev/sda4 d; Is there a way to identify which sysfs devices correspond to a specific mounted btrfs fs workqueues? Let's say I want each mount to have a different CPU mask. -- Ammar Faizi