Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp405636lqh; Tue, 7 May 2024 02:51:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXuSoaiZoSEJ6ILAonmSugThf3TMm8gUPunP5/8fDSiM5yLXi7N5oXLYnuEx3w9k/bgz0Ru6NV/pG2dv5cgeAsanqfOst23X+j/QwDEaw== X-Google-Smtp-Source: AGHT+IGbb6ig+1TajB11brma/92njB2w/PmXiyZ8fHD9QtvA5rMsOdTlmrNghDbi3UbR5NpxkBmH X-Received: by 2002:a9d:7d91:0:b0:6f0:51a8:ca25 with SMTP id j17-20020a9d7d91000000b006f051a8ca25mr7284541otn.26.1715075490371; Tue, 07 May 2024 02:51:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715075490; cv=pass; d=google.com; s=arc-20160816; b=KT1Pc+mJnlEfNN0lNhmtAXngmc2ykn9f8fEFK4m/e7SfUW78L4tLg2H0J2EjCXiRH6 /DcukU4f74Bdc4YIGuub2cpx6Fi4OQ/xjyi9Vy+LsqfO8p7Bqcv7izxnse1+QX4xXPlT 5EHMObNH/b2yG9q8lcz5jF8sMlZ7hnnTjvXVTEOBsX705ICQ70mN4W5wCPbKQSJCNGw9 1PhbLMzduJx+xdAAriaizEIIbpmJ9En9cRr9GXsoCtjIZ93RIg+yUdxx5WSpNQiwfavd HUjdgc4d3pVeiu0lLTFdU+qllIlvPRdHdMNCLdjt3szSaN5K63NlEp4n4VRl4RAzxg+0 CzAA== 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=cW00ztMzynhHfGhSqSCg5j9h7Fte9U/1sreRcK4DNwg=; fh=ujTZQxyAyQimldi7dcTmVeikIg2ssJXlZ+HQsiHWJxc=; b=xkGIjwtJtaGx21jVxcx0kMlZyiHUKW/JhcYhTLrSFQyXAgtfx7bFuyxSym/DlqML0x kzgyQi0I1tNaYl7TLVI2k997ZZZEHY/g7Map2wy5sjptt2bWR9VFvgCIVmAhoGWAxnSm TPPGBziki4j78r7/QYd6FgprOZfs9NItMxQ7E8nnzcHxy+eE/XG3Jsru4EKP0lyhlLf8 HfGXfA4k/8pm+K5I2IJjAo/Tmx1+BeOEv+HrrCeQwri2BDtMUt5a3fHE/Q5UsUBqIUCk VnX+nBG7MorF1d3ZFR3Dl9aOu8HXZQFO6doyPkicF7TaVp46P7mDqAxxrnKxrIO00NSv 6jug==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=N5tTyf8D; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-170989-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170989-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 37-20020a630c65000000b005cdfc01b502si10332461pgm.337.2024.05.07.02.51.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 02:51:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170989-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=N5tTyf8D; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-170989-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170989-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 25DDEB24F42 for ; Tue, 7 May 2024 09:42:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5777015FCFC; Tue, 7 May 2024 09:36:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="N5tTyf8D" Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (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 3773615F30E; Tue, 7 May 2024 09:36:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715074568; cv=none; b=NgZQu1AqPLt05yydGhAeXQWselBcvuDgWStLKi6DhVtiT5T6LflRUt9rA/PKsVe7SXBJl8LFgkilxxCeRyZQKFBABdhdKqb7mJ8OvJvHAFWb8HdMFWx2ih5Fx2klZSAKvu1b5WzjD6oQ8SZPjMGO/CkhAeP/AVCIsYL3Ql607Ts= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715074568; c=relaxed/simple; bh=epMddOCm5gZ2sI6W3hNDMzNbpLcxxjqRybXWGAgKqCI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=VqoZQPzb+PiEpJuwRycMSuU0ee8udHlj6ykPORaoAsG5478SOp5jZXOeREWQRE7Hci00tnesRiMDCYeInznYtMTpdKMp7ve3T7/v0wo1mOtCrZ/kYNEyhgYBhjD7gOWaoPWUSALAe+B7Mwi/vGuNoIT7uvrpXDG2ied5ItvhHLU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=N5tTyf8D; arc=none smtp.client-ip=209.85.208.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2e367c2457bso20450891fa.1; Tue, 07 May 2024 02:36:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715074562; x=1715679362; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cW00ztMzynhHfGhSqSCg5j9h7Fte9U/1sreRcK4DNwg=; b=N5tTyf8DToOG/UJkvgW5UHJnuNvCFjRg+qn3c3EYXAqIwbb8lmfaPmU9oCVXT1wom7 0cXDCWb+RuXMug6O4OBrH7gozxoz6WC0PDW5/azL91R96umis+T4og9n2CJRJa9LYxr/ ATaTF7cQ1epjdBKUqBLcUnPFMjBIYOz4mpcxwZsHqOKY3AjRFO/qFwpb85iDh1JXxWL6 nY6pzi+Be+Ysf3B3pWSHNoYA2apwPqgOmWEiOuechHJbl+wszK1YaA3TK1KohWRWLAmt fOuBhWKEzum57AUilmy+iSg4A7S7JBrKr2b2/n3sruiBoarM9RMr2QnuYdOkdBptaec9 q5iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715074562; x=1715679362; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cW00ztMzynhHfGhSqSCg5j9h7Fte9U/1sreRcK4DNwg=; b=AoULq1Vkeqi+lzdO2/iyuf4/g6M3i7s1BtJP6WVtfIsXBTE9FbPVLtcW+2qpE5LOWf k08ewn9IkHsIZa4L2fM5qj/Jz9aJ7nMsljF+1rpXxX+uFyddD/yN78sdRX6ez7HZEz8M qo8CU7Ec1wQE1Ri9vRDXu4m0FQnZepcgT4uCN6QfADOaNy/UHVryMLVOErx9ha15JeEt 7RWCjWOpavUFRFCPzCXg+wEbKOC1UhogM+wAUe1Cvw4IOWeymJRSbwivFG3qjrLv9RUG c17IJRwogjyTboEABEwf+HxPaesjLMZp0UKRg5EQssBaIaQ+QA8Z8y6wdOKdukA0sBun 72zg== X-Forwarded-Encrypted: i=1; AJvYcCVA34JaSv+zdJkQJ1zGRAvA/jfvrZlSgVgJ3zFE+AvT47MtwKhc4v7Rh4DXe5JL2+vipCLIt30voyBKH8mtIheE0hreLKeqM35pXPMQ X-Gm-Message-State: AOJu0YzcXovYNAkYc84lMPg5i6xVkQvK/UFki8mbAVAYA0ldxspQhrGW rzsT+tKUf/okJo6lX06bJE97BWwckY0PfgL7+H0t3c/Qo6xGA5yM X-Received: by 2002:a2e:8904:0:b0:2df:44a1:2987 with SMTP id d4-20020a2e8904000000b002df44a12987mr7930872lji.5.1715074562339; Tue, 07 May 2024 02:36:02 -0700 (PDT) Received: from pc638.lan (host-185-121-47-193.sydskane.nu. [185.121.47.193]) by smtp.gmail.com with ESMTPSA id t18-20020a2e9d12000000b002e29c50c4dcsm1335473lji.27.2024.05.07.02.36.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 02:36:01 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: "Paul E . McKenney" Cc: RCU , Neeraj upadhyay , Boqun Feng , Hillf Danton , Joel Fernandes , LKML , Uladzislau Rezki , Oleksiy Avramchenko , Frederic Weisbecker Subject: [PATCH 30/48] rcu-tasks: Replace exit_tasks_rcu_start() initialization with WARN_ON_ONCE() Date: Tue, 7 May 2024 11:35:12 +0200 Message-Id: <20240507093530.3043-31-urezki@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240507093530.3043-1-urezki@gmail.com> References: <20240507093530.3043-1-urezki@gmail.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 From: "Paul E. McKenney" Because the Tasks RCU ->rtp_exit_list is initialized at rcu_init() time while there is only one CPU running with interrupts disabled, it is not possible for an exiting task to encounter an uninitialized list. This commit therefore replaces the conditional initialization with a WARN_ON_ONCE(). Reported-by: Frederic Weisbecker Closes: https://lore.kernel.org/all/ZdiNXmO3wRvmzPsr@lothringen/ Signed-off-by: Paul E. McKenney Signed-off-by: Uladzislau Rezki (Sony) --- kernel/rcu/tasks.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h index 82e458ea0728..78d74c81cc24 100644 --- a/kernel/rcu/tasks.h +++ b/kernel/rcu/tasks.h @@ -1203,8 +1203,7 @@ void exit_tasks_rcu_start(void) rtpcp = this_cpu_ptr(rcu_tasks.rtpcpu); t->rcu_tasks_exit_cpu = smp_processor_id(); raw_spin_lock_irqsave_rcu_node(rtpcp, flags); - if (!rtpcp->rtp_exit_list.next) - INIT_LIST_HEAD(&rtpcp->rtp_exit_list); + WARN_ON_ONCE(!rtpcp->rtp_exit_list.next); list_add(&t->rcu_tasks_exit_list, &rtpcp->rtp_exit_list); raw_spin_unlock_irqrestore_rcu_node(rtpcp, flags); preempt_enable(); -- 2.39.2