Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1476252rdb; Sat, 3 Feb 2024 07:44:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IEbeGveOOMNSLpFNM8IuIIZzEU1k1wTtfy4gaXTPuuKQB0Jkf2rs/fp1Eu9sVTbUovnd54y X-Received: by 2002:a05:620a:2099:b0:783:8649:4174 with SMTP id e25-20020a05620a209900b0078386494174mr2605930qka.23.1706975066205; Sat, 03 Feb 2024 07:44:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706975066; cv=pass; d=google.com; s=arc-20160816; b=REi2axpXIFWiU+qeCgAXRhor/GuYqe2W1sZq8OyxCTxJ0ghsYi0kBX9WMnApDcxIzo Pv2VtohcoFiMfLTTuiuIAefKGVsjf9ljYTOOMAeEEU2nVWOv9XFttviIfWPPtYXGXz5s vxuAxYlzdgtWFyvzZmt3FOmt2hQcTHIHrDITZiTn2bJHehyZc8SX4jbBWt8xUXJmTFR7 wCL2op8njSG3c7O3Pt6KZviCA/yKAEAWY6OoWWI2T1V8PNBb/G5GvKOtMwhdW9ri26IA ic5fEEbnrbTKNIvAJ7ArSr/NuRSal1yntcWOo8Ydb8FkuiXzeyscaHM92y265qTLmrGy CmYw== 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=ScQv56Q4rXaTpdzN/ahpTLTPw10jjay2oLMnvSHai9Q=; b=rPwrOAB2rdG2QS6awV+N44HYFAOZDhEeGJMxNct0jNY4cvy516jEDrCFuWs19jeSlD SbjDUPbPGtH5LZgM1sCkTnqCqS9Tn5G1FtnDmXR6JYmW5Zx5OYfGnR7aVeiP9FbimNYB 5a/+SY7bCuSu5ptAW/hXMIb0tW0tHIVE4p1xq8kTj5nHib/gHBdS91TPdrUyf59oYCWv su+4EgOXaGOkafDflTkX+3FAmnLbV1HsA9DYCwE3DO1V7Y2yflOHKfxSMoinbVNixlp4 EUFM0yMh2pGbTQZioPfq1+qorKpytMIAkwNc8vwTRHUTG1Pdh+6NXxW0zI/K5VUDEIpO VASw==; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51156-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=1; AJvYcCUAQvAhJxOpGftcWMIZ5XsMzptpEmSAKgbKxM2TSHK2yt9k0gErNhvDZiGYuo1ZFXktwI8uU8LoT/kRRtBRRG4Ze6rxMq2SxugjHUCVEg== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id i10-20020ac85c0a000000b0042c0b2477e8si2411749qti.441.2024.02.03.07.44.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 07:44:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51156-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51156-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id EFABE1C22196 for ; Sat, 3 Feb 2024 15:44:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CF3FC5F846; Sat, 3 Feb 2024 15:44:06 +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 ; 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 To: Tejun Heo , Lai Jiangshan Cc: linux-kernel@vger.kernel.org, Juri Lelli , Cestmir Kalina , Alex Gladkov , Phil Auld , Costa Shulyupin , Waiman Long 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: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 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 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 */ -- 2.39.3