From patchwork Fri Sep 15 08:36:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 140581 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1217645vqi; Fri, 15 Sep 2023 10:44:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHfUmJIKqF2SONzX2mw+cXd+b0SX/egOLcsa3widbzCEaIqP5B+2XsKEskjgj5gszzPrDvV X-Received: by 2002:a17:902:f814:b0:1c4:3e6a:7ad4 with SMTP id ix20-20020a170902f81400b001c43e6a7ad4mr1539385plb.13.1694799895226; Fri, 15 Sep 2023 10:44:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694799895; cv=none; d=google.com; s=arc-20160816; b=dFLmvV0DWmHKugSgx5MBctFxefl9rK2kv0/g2BoWYTNWmtbxQu4yIVNlzr5aXFheg9 aZ3dQrrcitFHato1nWMYCi2iFZfvsQPQGV1BupZHvPfkoL9Tv7XC0pXnq0zbrGh61Zdq j6gFLtN370LZjhBE7aVF++w818mIjujPu7GI+Yxh+PiOA9qASUL110uRQzXZudnuelbt rJqL/K0t5nmaggxY+FsqEI1mM54uS3XCGejLzYCSuzlsimQG/1habtLtwPE0NrRpUgMV 6zhpu62UnlUy2lseeVzPbFm5tvZ0CwLZZYIvm/o7nfBpKgWUoIFXy3l3DJwSm9TPcLEC t9ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=XDekMdwupTyWDwCGZoYIpGZOfxAKnogrAKuuYq2O6hs=; fh=I3HYclQRssgPRceRN2K8cuS0aVdba2UMsUWSaMQsEys=; b=re/Ql31ttUluepVeL8UkSEAD6lin2KKK6d4GLK0kmTQ6PMq3be2nl28i5yEoDASvlJ 1rVSMnFNNK+zc9fPlLsrERmzX1IS5FeyDzO1RMMZt8Lj/dBMWSF1jXbuvoiOVVWfxojQ ug/89ER+ItjiHnzImVS5JaiPzWtyI6vnBzFxKAF/0jXxWY+FE/sLi6k029JFIKucVpHz +VpghrweIUyb9xA6JgNBCdST0YnIJ0uCIeA/9glioG1ZRMOIi1/fBWYWFruvSki6m3R4 6v1na/7eTTFNlcDnbU+83cO60P7+RBVv1hchR4EJ4pqkid3Mdo1be9nMbs7W8481gFhI rFzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="WzXoOA/P"; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id k7-20020a170902c40700b001b3c63eba76si3838453plk.492.2023.09.15.10.44.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 10:44:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="WzXoOA/P"; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 52DF4822CDF6; Fri, 15 Sep 2023 01:36:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232865AbjIOIgY (ORCPT + 32 others); Fri, 15 Sep 2023 04:36:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233115AbjIOIgS (ORCPT ); Fri, 15 Sep 2023 04:36:18 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9768EE6; Fri, 15 Sep 2023 01:36:13 -0700 (PDT) Date: Fri, 15 Sep 2023 08:36:11 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1694766972; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XDekMdwupTyWDwCGZoYIpGZOfxAKnogrAKuuYq2O6hs=; b=WzXoOA/P88KDxWvHoF+hRKOB/lWu+VNeCE5zugfT5TShgTEQS36yLrWEWLmdxRTgNPJL2Q wqeg+7gskf7lw1P90NghGB4cvxFjJluFb/FyyJgMIIPmQ6QuE+Ijo7QrjLJv08JtYSAm1P Q1b0lIoQ5T3k2uEig7ODs9sWtJAvcECqhIVoexK8Deo8JgCpCfSqvxfXVDFG+73iPDTiec IgMt3qnyysyhWI4CmNvMB3K60UqYQkkbJWu+zM64Cdt+OZnU9enVm4JMdb8T4UpX9+myYy oaX04AJiQasH+dl/CpiwvmPK/4xj/pN869m9Uw6vEH4qDf/XGcoPQnNSUS5eEQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1694766972; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XDekMdwupTyWDwCGZoYIpGZOfxAKnogrAKuuYq2O6hs=; b=z6zbHgQBKNDWOPdv/s3pf58SQmDQ3eElerkEIDJfdMukXWuYlqeWnR4PJ3cnOE0sQ3NXzU aCNzrSdUCeEc83Aw== From: "tip-bot2 for Matthew Wilcox (Oracle)" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched: Assert for_each_thread() is properly locked Cc: "Matthew Wilcox (Oracle)" , Ingo Molnar , "Joel Fernandes (Google)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230821134428.2504912-1-willy@infradead.org> References: <20230821134428.2504912-1-willy@infradead.org> MIME-Version: 1.0 Message-ID: <169476697114.27769.10512661720392590327.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 15 Sep 2023 01:36:26 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777126495070097608 X-GMAIL-MSGID: 1777126495070097608 The following commit has been merged into the sched/core branch of tip: Commit-ID: 4de7b17fd05d03fa919e8c47fc66122bd24d7b6c Gitweb: https://git.kernel.org/tip/4de7b17fd05d03fa919e8c47fc66122bd24d7b6c Author: Matthew Wilcox (Oracle) AuthorDate: Mon, 21 Aug 2023 14:44:28 +01:00 Committer: Ingo Molnar CommitterDate: Fri, 15 Sep 2023 10:33:29 +02:00 sched: Assert for_each_thread() is properly locked list_for_each_entry_rcu() takes an optional fourth argument which allows RCU to assert that the correct lock is held. Several callers of for_each_thread() rely on their caller to be holding the appropriate lock, so this is a useful assertion to include. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Ingo Molnar Reviewed-by: Joel Fernandes (Google) Link: https://lore.kernel.org/r/20230821134428.2504912-1-willy@infradead.org --- include/linux/sched/signal.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h index 0014d3a..9610bad 100644 --- a/include/linux/sched/signal.h +++ b/include/linux/sched/signal.h @@ -656,7 +656,8 @@ extern bool current_is_single_threaded(void); while ((t = next_thread(t)) != g) #define __for_each_thread(signal, t) \ - list_for_each_entry_rcu(t, &(signal)->thread_head, thread_node) + list_for_each_entry_rcu(t, &(signal)->thread_head, thread_node, \ + lockdep_is_held(&tasklist_lock)) #define for_each_thread(p, t) \ __for_each_thread((p)->signal, t)