From patchwork Fri Feb 16 18:04:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 202302 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp702701dyb; Fri, 16 Feb 2024 10:25:49 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXkxYdoZQccZaOT/83qhAedakDsDUlkiEI1hVr2+kZx+yPp9aNj4vVGMHCKo3peboGoOODcXYTqP4j/wyQDMqg/DJ47lw== X-Google-Smtp-Source: AGHT+IGjpPqluJKbqpV+zGoOspQomt1iDfj+YVtbuDSh5MTW3QXR2NP4qYQiXDHq8wnhJRaU+kIS X-Received: by 2002:a05:6a21:150b:b0:1a0:6856:d19b with SMTP id nq11-20020a056a21150b00b001a06856d19bmr7234386pzb.6.1708107948879; Fri, 16 Feb 2024 10:25:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708107948; cv=pass; d=google.com; s=arc-20160816; b=hQlaNMHbhotUWMsQlBlh/YpgB8e8TpZ5XenN0qDP/SM34e8eYx6ZH0OdWr/6gEMJqo qb99u9d4LWrwWpq5jnJ5BeKiHzc8g0mDtaOtrYAGeFJPJvzl4ysxajAHT+z9IE9dvZTh h0/aTyexntNJi5G5+Dk+adkPS/NRLgbcwbAluawYsea2WyuHa1ljvL1Ti24bnsru3mJ+ pTPqUXYMcjIKJxwU2dutPAtLJLQabKNgZ9Y0mf+ynzBdEptniB3dPNskeNRJec7Li2Fe 2xPrWzcBxL8SsMkdIYqC3fn39I6dNQ0HAgV9QZDDCr6UoM33/SCpAa+5nqrOQOl/23fL HffA== 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:sender:dkim-signature; bh=pIltjVUaiFwUeua93wdSXtPQLjPPFRChCUpwRSlDMH8=; fh=YfyOijUT4aWTsMaJNRcspdtRsIP3TsjAX2n/ORofxNA=; b=YYYSgYpd/fCalFR1AK1/Srfydobnl6tp17qvGgc4/h56Ei8pbKxDZ2lm9KEfxszD4j 7DY2Icxn/fazlRlZmt5kdKioNeYRoBOaoPIqdcz3Mt9WYLJvt0hj6D6/+LD389y8N3uP zO2eFpI8OhuwprzQEEo+/nA4HktQz1CfReAHyfCl7+nhUdcJmHuEVQUYFbwZKlI1pmBa FMujteiJ5WSYO11+WzALnqCLZ2LWmby2Xws02q2jcOjpIAYJgq70cRrPDP8Lj9UKaYZ1 pBTIUMgVO80mW1JurK/40Bo2w+Syd4dY5xYdcYZfHA95yFzqRgkubxe5FIHwjzb93PkW ae4g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HawJlmN2; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-69120-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69120-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id c133-20020a63358b000000b005d8c19ca98dsi258485pga.137.2024.02.16.10.25.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 10:25:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69120-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=@gmail.com header.s=20230601 header.b=HawJlmN2; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-69120-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69120-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 07640B25639 for ; Fri, 16 Feb 2024 18:06:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D28ED135405; Fri, 16 Feb 2024 18:06:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HawJlmN2" Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE99C1350CD for ; Fri, 16 Feb 2024 18:06:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708106779; cv=none; b=i9Wc8zoKEYYDSVK2xZPf1hBqaCF582QO8dyGufKzG84pb6lu//R6NFSqsDbhNr8gWk6JLlGqMqWJKXaU/xz/JKQX9DploDPnpUpcewcCEF4whsZsQqiFcc98kK25BdwrIbCOoR7+V5BAR2sNraoiLENvHEShgn4+SX/eTApbIDY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708106779; c=relaxed/simple; bh=qzo6BYrcleW4zRxM5K55RwFrekOKOLB8qjWI1ALQZYk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=m30wm7NmeA/q9CYLIzQvlp0O66IBB2WVc69hvO9dohP1xhhJBlJr2QxILT4rfUgJCOMHyoMKIonv00HBQyPNytM6pBzqpnBTzYdNbUWjiWqnloXwV+XEdl4fJq9a6yIa4jVsH61Fys0a/w2r7PYWgwBxdSTDct1h3Ne867ts0Xg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HawJlmN2; arc=none smtp.client-ip=209.85.210.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-6e0f5934813so1886683b3a.2 for ; Fri, 16 Feb 2024 10:06:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708106777; x=1708711577; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=pIltjVUaiFwUeua93wdSXtPQLjPPFRChCUpwRSlDMH8=; b=HawJlmN2IwfBdNnChc+iiHUToYKabT/gsQ2w0BC1igkWyNAPNpsINkqEWpSSKiwYJZ pETtzMpZCe3XxkhJstCHMKW/K+4Yu0bmopax9sAPhQ3BuH+sFhY/6sKA6omH4voWVOQE K75UKnNRMuU2OKX33dpIQEt37nakUOPFySpEVPHYvzN5FuHoS47fKpicjuGcHY+r9MBk F9Ajk9Nplhc4/6MgWYl/v31lB9usbRRrojVpBZAx3f/38MlbKEmTtp/jSVOt2XqnrVev kE0lE5UNXhQ+0ijX+rUQnYau5Bz6cuhWepfUEr7xzZadEH2D1FqdIkmrcxUBhwrk1gZn o8Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708106777; x=1708711577; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=pIltjVUaiFwUeua93wdSXtPQLjPPFRChCUpwRSlDMH8=; b=fhNvYg1XrGkLTf9MAjuuQfjRdNdaA/gFGYkBhG8HqvAYDo1d/xAqatdL8DSQJyW+x9 fuUJiIqhWFnVTpjvuVWrHCwA1sr6qsRnYALBya9pPHwprjh6Xtiju4eYlULC+OC5RB8G ZkisxOSYqI+TPwd3xgLRAXDK1pbkdyi+jErjByzrMZ/VKj8DbFyVKsoL8xIOJlQ+zlRS 6Qp30EQH+f8Tmgq+ubidZLFb0kb/sp1YHPs4/z8SgefiOl2Xx7P4wE7FevVS9HZRFo2C DqaJZ0b1azkGDeMX6HUzkvqhLfsjLa13VOFQuno7hOgYAvPB4jfLB23x60vOBQuUCz3d TIFQ== X-Forwarded-Encrypted: i=1; AJvYcCUHL7FT/hygCv97UQf/ShnnmS0SpNUsXLBbTOFTj0ZaeiSCkWc857MrVSBR+LYTGz1gRmgOFWva4xMLQFEZFdmRWDl4tlJ9+B8QuVeT X-Gm-Message-State: AOJu0Yw4O6ALJDG5IxksXJAWQX2oePa/HDXFAdrNAXEKaqUcsU2mdLzk z5Kz/cmm+PY+I2GcU/6NlWMkk18I9RyYwHNaxGupfrRDxT2CyBz/ X-Received: by 2002:a05:6a20:d046:b0:19c:ac7f:c3e4 with SMTP id hv6-20020a056a20d04600b0019cac7fc3e4mr5432849pzb.42.1708106776937; Fri, 16 Feb 2024 10:06:16 -0800 (PST) Received: from localhost (dhcp-141-239-158-86.hawaiiantel.net. [141.239.158.86]) by smtp.gmail.com with ESMTPSA id x40-20020a056a000be800b006ddcf5d5b0bsm235158pfu.153.2024.02.16.10.06.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 10:06:16 -0800 (PST) Sender: Tejun Heo From: Tejun Heo To: jiangshanlai@gmail.com Cc: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, allen.lkml@gmail.com, kernel-team@meta.com, Tejun Heo Subject: [PATCH 02/17] workqueue: Use rcu_read_lock_any_held() instead of rcu_read_lock_held() Date: Fri, 16 Feb 2024 08:04:43 -1000 Message-ID: <20240216180559.208276-3-tj@kernel.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240216180559.208276-1-tj@kernel.org> References: <20240216180559.208276-1-tj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791081000264178560 X-GMAIL-MSGID: 1791081000264178560 The different flavors of RCU read critical sections have been unified. Let's update the locking assertion macros accordingly to avoid requiring unnecessary explicit rcu_read_[un]lock() calls. Signed-off-by: Tejun Heo --- kernel/workqueue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index b280caf81fb2..87750e70b638 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -515,12 +515,12 @@ static void show_one_worker_pool(struct worker_pool *pool); #include #define assert_rcu_or_pool_mutex() \ - RCU_LOCKDEP_WARN(!rcu_read_lock_held() && \ + RCU_LOCKDEP_WARN(!rcu_read_lock_any_held() && \ !lockdep_is_held(&wq_pool_mutex), \ "RCU or wq_pool_mutex should be held") #define assert_rcu_or_wq_mutex_or_pool_mutex(wq) \ - RCU_LOCKDEP_WARN(!rcu_read_lock_held() && \ + RCU_LOCKDEP_WARN(!rcu_read_lock_any_held() && \ !lockdep_is_held(&wq->mutex) && \ !lockdep_is_held(&wq_pool_mutex), \ "RCU, wq->mutex or wq_pool_mutex should be held")