From patchwork Tue Jan 30 18:33:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waiman Long X-Patchwork-Id: 194264 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1419819dyb; Tue, 30 Jan 2024 10:34:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IGcNKWE2J6w6WKWGdL08tUiMRo0Og+fL7oPwbZFdDm0Q+gAujjudilNe1Q4AijWA1f5OF8P X-Received: by 2002:a17:906:361a:b0:a35:3eb8:2f6e with SMTP id q26-20020a170906361a00b00a353eb82f6emr2407009ejb.33.1706639686819; Tue, 30 Jan 2024 10:34:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706639686; cv=pass; d=google.com; s=arc-20160816; b=lFVPRvQVff3HXWxhsr3LhM9B/MDVL5lvdxSRYQu4nkH3qX8WsdXmXdkf9+iqIbeRdG Z3YgfJJcUbGXsDxuA6ZGXmkFDtvfSzlG+wMngbw+h6wVbiX6L1dD6ZNEFRIYkp928S3q SvH2oOmI2w7wQ9mo3IziZIAeKWvLdSAr00VRPFU8GH1cSVG5O61xLFGlSq5CWiLFZ1Rj IfWmEOhaeezB8BERVHvwYER8Iuv98St01zqs1iOBCVjRgFYOyb6s+HpFG3a6XGurEPEu +IZPw76E6glGSlVC5Lzs6vyRVs18c4rIrA7yWJf01mdDa10Hwbmpzqlf9Eq0mheVt4UE VYgw== 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45114-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f14-20020a170906494e00b00a349dc9c0a7si4694476ejt.205.2024.01.30.10.34.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 10:34:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45114-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45114-ouuuleilei=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 63B311F23CDC for ; Tue, 30 Jan 2024 18:34:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C1D8678B50; Tue, 30 Jan 2024 18:34:05 +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 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789541416326525961 X-GMAIL-MSGID: 1789541416326525961 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 */