Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1197294rdb; Tue, 30 Jan 2024 10:36:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IFNJeF9o5LBsEGufOblUo/Cd0Ji6FfswPk2MrpxEn05aBtMHfRWJryyswZN+CckCdW4/Oj9 X-Received: by 2002:a05:6358:ca8:b0:178:7630:fb4e with SMTP id o40-20020a0563580ca800b001787630fb4emr4760480rwj.60.1706639801820; Tue, 30 Jan 2024 10:36:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706639801; cv=pass; d=google.com; s=arc-20160816; b=vR1acvWfed2oGjGzYIlw+aAQAfGxQxfGimKOogvB7pfGUsyi7XxzuCQZG2xkyjUBUb R0Uumwsv9pkDDsSd5UW7EbwLNSLmml/Zz+wmAY51nO4pF2Z2sAPAFg775p4PnDEn/Vgi lMcjmJ5RLo6J7/GcxwLdA7I5L2mR9GVSXaxJs5NVGT8AfITPAFgrl0Ix9zjM9huoShQm Y+pJwdS+NhYugCbYkuw/ay2/z8IRfdpV7Buzwe5zkCEaGBw8nDPD9KcZFc6VM8Qir/wW gO5lfmskGFDk5VbAyLLJI6pnhk8qkGqKWnwFuTnofTDZ/1+rhFLhFjOXJxLLOWfJq6YF wKAw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=2zEEimyOdTkcF6f/u66KBqEEbATKOuXf1jTOu6zU+Ug=; fh=lt2js4+oSVfpbDjw8gm9/JJoU0YKcT6Mty9go3Ytfy0=; b=P9RR6OFy7WpPv+xjgj099pjYSxv/nyXmjrI3luZx+60lxuCypwGBkRnN1z7UUwYu51 rpVs4tg50W67INLcwdGS5L3LB2CR3nGFK5IqhpD1+9J/B07U9HyWL41AKCvIX8AtNsZi raVv+jyxQtm9soA+LRgBp6peH8CptTwa57V9UrxpR52TP+Yujr6Z+2h1lk+c/8v6mz5N vJfwHR9l0ExDfPal/9l0sJe3EbBouYmr/bnOz5WaiPU0nD6TXiwxAl9YkHDG9WHT0RJ4 O9m85/ZvS3ZsrVEjnDjpq3RF7gBFdvqlzxVr4NAdH6jA000buptkNuHzktegtIW9J/1G T9dQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZQdKKw8w; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-45114-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45114-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id i133-20020a636d8b000000b005cfd6ba16d2si7618876pgc.76.2024.01.30.10.36.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 10:36:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45114-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZQdKKw8w; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-45114-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45114-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 4DE11B22142 for ; Tue, 30 Jan 2024 18:34:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CEE7B762F5; Tue, 30 Jan 2024 18:34:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZQdKKw8w" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6EE13762D0 for ; Tue, 30 Jan 2024 18:34:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706639643; cv=none; b=nOc1xR6V6jJV9J11pGAA/s9YHwU555T/LJ/jSNVIZ4iDVrfKSR4K6a2RaL9QMv7zuFx5M7XjyEmL+14KCd3ek6pZw8blO8vsY2kO8N/eLSc5ihCWqG3eIJUzVHihUwqBf2xdXIZXHDRbqshD3BgMS4XuxW5drWefRy5eruv70Lc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706639643; c=relaxed/simple; bh=Aa3cym5mjG1BHlHIUMCHX33rDI7Y6taSaQCcsrAKHSI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=H/P4sNRqsBTamz2Q4sMRw8Wew9pKIKsVuhEd3ejY+EZuxOj1Fsw5dba0lpCW08lGXF7+7S8OShSn7ULESCsGJFYs3uPThlLaPTvZ7C41E6K9jz0djspaw4XyPbfn8+RfRz5qYtuWhkiSqF+rx7Nl4fjeAEA0xCwkPKD1KUCKxho= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=ZQdKKw8w; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706639640; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2zEEimyOdTkcF6f/u66KBqEEbATKOuXf1jTOu6zU+Ug=; b=ZQdKKw8ww81lmCy+fgFkxYo6IvIr2rPt4FOFP3e/6GjOOnFgALiYF58RQy6a51dJITqjs1 9V7U2rlqCjmgom7BZ1QkbBuWynBnAc4q35V6+zOoCVHhUPPuyxK2Mtz660HF0TaFQwr9p0 33M00qE5JTIIuB1QqySQH1617XtGGWY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-529-3y4lfYFJNYGkuFMrPlx6XQ-1; Tue, 30 Jan 2024 13:33:56 -0500 X-MC-Unique: 3y4lfYFJNYGkuFMrPlx6XQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8DA5710665A0; Tue, 30 Jan 2024 18:33:56 +0000 (UTC) Received: from llong.com (unknown [10.22.8.207]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2B47040CD14D; Tue, 30 Jan 2024 18:33:56 +0000 (UTC) From: Waiman Long To: Tejun Heo , Lai Jiangshan Cc: linux-kernel@vger.kernel.org, Juri Lelli , Cestmir Kalina , Alex Gladkov , Waiman Long Subject: [RFC PATCH 1/3] workqueue: Skip __WQ_DESTROYING workqueues when updating global unbound cpumask Date: Tue, 30 Jan 2024 13:33:34 -0500 Message-Id: <20240130183336.511948-2-longman@redhat.com> In-Reply-To: <20240130183336.511948-1-longman@redhat.com> References: <20240130183336.511948-1-longman@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 Skip updating workqueues with __WQ_DESTROYING bit set when updating global unbound cpumask to avoid unnecessary work and other complications. Signed-off-by: Waiman Long --- kernel/workqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 76e60faed892..350179382667 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -5784,7 +5784,7 @@ static int workqueue_apply_unbound_cpumask(const cpumask_var_t unbound_cpumask) lockdep_assert_held(&wq_pool_mutex); list_for_each_entry(wq, &workqueues, list) { - if (!(wq->flags & WQ_UNBOUND)) + if (!(wq->flags & WQ_UNBOUND) || (wq->flags & __WQ_DESTROYING)) continue; /* creating multiple pwqs breaks ordering guarantee */ -- 2.39.3