[PATCH-wq,v2,1/5] workqueue: Skip __WQ_DESTROYING workqueues when updating global unbound cpumask
Message ID | 20240203154334.791910-2-longman@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-51156-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp1080097dyc; Sat, 3 Feb 2024 07:48:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IFfp/eNx3PWWSi9uWFU8zdHn1HQLlCZ8JDwSTajkhu6AUxMJNVEcJWjb3WqtDymEF32c3hQ X-Received: by 2002:a17:90a:6b47:b0:290:28f8:f5a7 with SMTP id x7-20020a17090a6b4700b0029028f8f5a7mr2350777pjl.12.1706975316950; Sat, 03 Feb 2024 07:48:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706975316; cv=pass; d=google.com; s=arc-20160816; b=NVO9r19UdKimyw4nlIwkmGhK78PszceJbhmDgJ0ajMCfV9KAScpp5EEslivtOAm6jP TbxyuxkLurIUsAAPTtHXzBdZBPaoUPXTDM402E1drhnSzFOmxpEm5eNgLhnpWb0tcrxK OFYiH2jjOcZPiq2ZdyCO3AAVB4U8MXRVOwEZN6/puNuUL3Fwpme8A2+mtqQWP5aYGzxh T2IFUs7YakUykTC574eMq7KJrErHCg+OJqC1b6RlvJgX2DAYW/mNMnlNXzWCZmw5i0py t4Wgp7qxIg5sqwsmV8Q0926K76bA62ELs++CtGxMVIx2Q2mPzahOqfAqe9GjH3lBZghM NUMg== 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=Qd3lbhuW8fX+DsS5188RrMwd7iN3OLF290p+wTUe/dc=; fh=c7zAGiTr3EddLHefKkk6vbXRbv2YklXim+VHcQ5b5Gg=; b=HIku0ZNY3lWtX+NxlXWFRUqDXIADBvq9/6mUgHm7AJHg8In+/0D9h7tq6C1C5wtjnH K5hzw4ld+VJWzbiPPGdae96GXV34Qhcc6pAoIQ99wQyo4ZR8QvbWeuqtlp7JDXzh619v gSTYrSQDsOON5ncNZOqiy/CMxqybYHDJn2UT0m3qI3Ml95f1PKBhDyDBEBFUgcWg8/uV zSdd9pbWYXmv2BhAG3HuAZpC3Lijkh3ttbUteDg5L8M/h6u/jQnaJGL4wPIx06uOj4gn PagsooPt+XRwH+QuZ3zY0FgncSEWWATFIc5kqZxcwBPAwi2bl9nPp/v/fnKG5a+fP81w xH6A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UN3lK1be; 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-51156-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51156-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=1; AJvYcCWk/co/YxdzUBcp9wscQr/o8MbXVuvQ0al3iiQn3hGopQ65G30EjsR720+aq3SYLz4h8A3q4K/sc1SDcYiZ0jISUPQa3Q== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 21-20020a170902e9d500b001d781dc0f70si3350333plk.591.2024.02.03.07.48.36 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 07:48:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51156-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UN3lK1be; 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-51156-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51156-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 8A4E0B22C59 for <ouuuleilei@gmail.com>; Sat, 3 Feb 2024 15:44:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE0035F87A; Sat, 3 Feb 2024 15:44:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="UN3lK1be" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 7D9F75F557 for <linux-kernel@vger.kernel.org>; Sat, 3 Feb 2024 15:44:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706975046; cv=none; b=VRgUPQIJG5Mzfn7V1l8PpdfzTdPMrXtRgtcdu5H06zRSPnb+7N3PTVg7mk6TroMQUPlLo29ZBqiychHb3En/EbVi2EoDwGM6vaoctPnpD0xJOqbbovZjoqy40rao/Qw+ITdwUnO7NVmCiJicW6LpzovOi/230Lwo+knqu/6Sbq0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706975046; c=relaxed/simple; bh=N0NFN9G6d8VckDtQzeRTKSXMqsIlgHOkxLBCqDdAB+Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=il4Sa6mfIUTG/EW+ZGY8hJ+QA+5a5gYJJpwLOSE6kqdVYK5lu80p2GQXt43zQKXu6AEKbRXLsXEudfssY/9ClEYGPwEbWwxGxxFAOMtCDDIMzWjJHCmJ9fPdzuhri14wPVHkFALMiOCl1lpxmCQ61jg7sZK7OPNvDVutskLSq8o= 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=UN3lK1be; arc=none smtp.client-ip=170.10.133.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=1706975043; 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=Qd3lbhuW8fX+DsS5188RrMwd7iN3OLF290p+wTUe/dc=; b=UN3lK1beGPMzr4dsr0b9cKs1uKH4G8ZD4wM/6pq5boXAdvfSSB9ecrL9+gYDoiyWojaTF3 iibRtWmVBWp1TxO/Dy+8o6zt8nXsVt86g4EY9QNtODUIcx8W//QiaB+R2bU0OflAioNEkH EnxD8VlM8ve11EB+dtVP3xgDatRq5oI= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-350-XtEwpxLtMrWxLbKcxe-wAw-1; Sat, 03 Feb 2024 10:43:59 -0500 X-MC-Unique: XtEwpxLtMrWxLbKcxe-wAw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (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 39BB73C0C136; Sat, 3 Feb 2024 15:43:59 +0000 (UTC) Received: from llong.com (unknown [10.22.32.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id B8BA5492BC6; Sat, 3 Feb 2024 15:43:58 +0000 (UTC) From: Waiman Long <longman@redhat.com> To: Tejun Heo <tj@kernel.org>, Lai Jiangshan <jiangshanlai@gmail.com> Cc: linux-kernel@vger.kernel.org, Juri Lelli <juri.lelli@redhat.com>, Cestmir Kalina <ckalina@redhat.com>, Alex Gladkov <agladkov@redhat.com>, Phil Auld <pauld@redhat.com>, Costa Shulyupin <cshulyup@redhat.com>, Waiman Long <longman@redhat.com> Subject: [PATCH-wq v2 1/5] workqueue: Skip __WQ_DESTROYING workqueues when updating global unbound cpumask Date: Sat, 3 Feb 2024 10:43:30 -0500 Message-Id: <20240203154334.791910-2-longman@redhat.com> In-Reply-To: <20240203154334.791910-1-longman@redhat.com> References: <20240203154334.791910-1-longman@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789893349894194699 X-GMAIL-MSGID: 1789893349894194699 |
Series |
workqueue: Enable unbound cpumask update on ordered workqueues
|
|
Commit Message
Waiman Long
Feb. 3, 2024, 3:43 p.m. UTC
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 <longman@redhat.com>
---
kernel/workqueue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hello, On Sat, Feb 03, 2024 at 10:43:30AM -0500, Waiman Long wrote: > 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 <longman@redhat.com> Applied to wq/for-6.9. Thanks.
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index ffb625db9771..7ef393f4012e 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -6313,7 +6313,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 */