Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp4320524rwe; Tue, 30 Aug 2022 08:09:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR7bQ5o3FXX9ge3bJV0fGot91WjKS7dsOozjQUyVUEvwxpdfkAkNnsoCPy1qysAAhJTaeWDa X-Received: by 2002:a17:907:7d90:b0:738:2f9b:9869 with SMTP id oz16-20020a1709077d9000b007382f9b9869mr17905151ejc.186.1661872186231; Tue, 30 Aug 2022 08:09:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661872186; cv=none; d=google.com; s=arc-20160816; b=qbfydAiFUx4Shku8geX/0sUGK520JgnsGK++kvsNH5cmDZIdCFYHuDHuHsLJWXnNyh kOVBToDJtPMEvhMrHCAZlPJSqblve0jq5qXWYWOtvXG3gQbQXp786iAo+eLZKfPYeP5R +VozYuj2s89Tie1gO8CSqLTaV1hcevB+phOf9oB3PZGCSt7ipStgeT9f5h01yjtfpY66 /1f/C/W5Ipxu+I7jLgntwpvnjoSEtAC2gxxvtL7T77WyUVfEGbcRmc94fng+XGzkp9xQ J5YfSJOtp1T5NPR4/EYjDNRJIZpgGrbb9T8ioiN4IpuOcMtXsyWtgVi712m8WAwXrWSB F9LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=WZETe5RlyVKT0mHkiEDx5jjUAa3j1bwbGXJVlil3/kY=; b=rG1qTCwV4BJayYW68G4eNR4q397LH8HnjCK7iv1Z8thnq7ZA9Vzh1a5tYnLM+9TZdG FBH8qKq8iuVKKBdQxZWO5QzoDaLHSXe9Oza4ibqfQ8/XvuJ+2pw3mnem7NkRKZfAKuQm t/lZhdLKN83icOjsfHdE8tNchgVJ1mvkHR1bs5oiYbFwGo0P1BGILI5Z1OOHmz09iBJD hs+GSq1l60YPuW/LSvLsIy1Sht8i08IpXUiUmGR7vXIH+9uwbMsddnTTrIXbbiTsr3yU EZwwYlCO0SOvfJXrZeOp8d+JGrAQt/D4bVvy7oMvFxPaJKcoIMlfEl22ESWlQuarmCir SiIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=J4qTyHLT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qf22-20020a1709077f1600b0072ed60fb78asi6929712ejc.548.2022.08.30.08.09.12; Tue, 30 Aug 2022 08:09:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=J4qTyHLT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229766AbiH3ORB (ORCPT + 99 others); Tue, 30 Aug 2022 10:17:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229620AbiH3ORA (ORCPT ); Tue, 30 Aug 2022 10:17:00 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 337178673F for ; Tue, 30 Aug 2022 07:16:59 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id u18so1750502wrq.10 for ; Tue, 30 Aug 2022 07:16:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=WZETe5RlyVKT0mHkiEDx5jjUAa3j1bwbGXJVlil3/kY=; b=J4qTyHLTavinZxE9B3kIh2MiXTWZ2/rNeGOPWnCnBVXCaHzzDowJfmfP/XJnAzlkBc cd+7GBsrBEnjn8+pl7XJFFl2T5YrVmAyWv9IFJ3Vnxagqrsa2dcyGFPKBlULmMiPNGt+ B+J9PYz5d02QndfF3yM/Wj0iP5jdsUSLwF6DqcHJDURX7Y34P9cZ8zv7N+uu5HYZ6Rgx hAo1875ITavlgqKmRtAVRm9ARWDyBdrfl9S9I1Tfr7RYwkTZPwdrGan6+a5KQjyVbEH8 MVHHu5XTgDnOO9r1yAc0B1QuZJqeVrjEct0u/q7VG5as5vVfDbPvcTkgmdbVxMB+6QqD 7zFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=WZETe5RlyVKT0mHkiEDx5jjUAa3j1bwbGXJVlil3/kY=; b=R/udEgCsuLZE0brBSBrAfEgddJynv6IJQdHiRSETMhfp0PaILaXeB08HwBhZ2G5kE0 hmg4yy4BUFdldbG4npi0tT8yuMDcbQ81LHo3WM8yBfi2h6/G4IqH6JcIchq4jEl1Bt/E tUHCEiqK+WdBrlIz0OFEL9qwl5ykxVcwEnLy5r+OUgmK1L2EqI9Uoi23cERb8mOCptOb 4fWXSz+y9NNd5v/MspQTUF7rycB980x4XtG4q1e42ZJBUNXGQGE4Otpi2Bvd8IkNmJx2 4v9RLb9ZlCeNn8MvJTnujippxPMwKaK/NGDElvnQmac6usn/vngkyWgODESVlL2fb8dm LBIg== X-Gm-Message-State: ACgBeo3IbOZp+2tS2jGKTrG8K3nf2eDI8g9NM9SUFZIf05DnVJ8+OnHw 3pL9uJYr4qSKnHIhK1tE4b+0nYaA+z351pFhkQA= X-Received: by 2002:adf:a490:0:b0:225:2da4:10ff with SMTP id g16-20020adfa490000000b002252da410ffmr9255787wrb.1.1661869017665; Tue, 30 Aug 2022 07:16:57 -0700 (PDT) MIME-Version: 1.0 References: <20220802084146.3922640-1-vschneid@redhat.com> <20220802084146.3922640-2-vschneid@redhat.com> In-Reply-To: <20220802084146.3922640-2-vschneid@redhat.com> From: Lai Jiangshan Date: Tue, 30 Aug 2022 22:16:46 +0800 Message-ID: Subject: Re: [RFC PATCH v3 1/3] workqueue: Hold wq_pool_mutex while affining tasks to wq_unbound_cpumask To: Valentin Schneider Cc: LKML , Tejun Heo , Peter Zijlstra , Frederic Weisbecker , Juri Lelli , Phil Auld , Marcelo Tosatti Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 2, 2022 at 4:42 PM Valentin Schneider wrote: > > When unbind_workers() reads wq_unbound_cpumask to set the affinity of > freshly-unbound kworkers, it only holds wq_pool_attach_mutex. This isn't > sufficient as wq_unbound_cpumask is only protected by wq_pool_mutex. > Hello Valentin, Updating wq_unbound_cpumask requires cpus_read_lock() and unbind_workers() is in the CPU hotplug path and so it is sufficient to access to wq_unbound_cpumask in unbind_workers(). The extra protection is only required when the logic is also moved to destroy_worker(). Thanks Lai