Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp728341pxt; Fri, 6 Aug 2021 12:13:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwm6a9KQ8mTKOpqCOBiWrHXwXajE7isWFWh9mnGA6m5NLAcujouuwn8a39YLzqcGY5fnpzL X-Received: by 2002:a92:dad0:: with SMTP id o16mr201659ilq.65.1628277192335; Fri, 06 Aug 2021 12:13:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628277192; cv=none; d=google.com; s=arc-20160816; b=yJfPYt8dTPa3tI/aX0cVx5ZB6jkpaMtb6jD3x+/muU1eQIqZzWlHCx9CL08V6zPndZ iq7MgG2477zWW3KR5TVY4Tjj4krL/35IajpBr64BgxuGKb7psGjCIAlCmYWVrZPnxYre KGPHf7zuLhpyzJELIit7MsDIFhjAT+VKIpTxlGA6Wsid6UceUm4OvPJbg8od6LJxw5sV YNzyQiCjSXPrc46OyoM4/XRSx7k11K+xrydPEmaf7m3tmI6oJ2vCB3/FBF6Oji1f3tdk nNOIVeZ5GuLYAXmzbQyTi5YIdOyNjlI55+XbegPzM4cZmHK7l9x8azaht5JtZ5HI5D9o yyNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=9Ranq1hfjL1eYgjwcMz8yMZHrAcWpYEO484bdeSl4S0=; b=ZMUwwifLbVAxPLOoRYaJVYRJDtCbI9IyKIZdyX1Chfu/lRRTV3pCcgmIoorQF43kot p+h1jgRY9SQB1P6xCUEC5vsn1Y1nFE5UP4dL1qCL/2Vk1pdj7SKRbxMZvtolrI6gAbzv HcaHOTA/KNmSxEqw3kXhFsQgmsCEm2DirToVUN29VEXj54YkagkOM8SOteHnBHvTEaoA K1xpuMAGFMmAwdgqVpell+kKFMhfYjMQArKtCFAr7EmQvu0npBfnNyi6+kuRG4esk9CU dPrFkE2Rqr6i/BDEWfY0LTf3sGXLPplgmkhvM81uMItjO1iA8sfGFS4uh18ZSGh039xF L4hA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y1si6328423ily.127.2021.08.06.12.12.57; Fri, 06 Aug 2021 12:13:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343719AbhHFMeI (ORCPT + 99 others); Fri, 6 Aug 2021 08:34:08 -0400 Received: from foss.arm.com ([217.140.110.172]:60020 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238794AbhHFMeH (ORCPT ); Fri, 6 Aug 2021 08:34:07 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4617E31B; Fri, 6 Aug 2021 05:33:51 -0700 (PDT) Received: from e107158-lin.cambridge.arm.com (unknown [10.1.195.57]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 13C7A3F40C; Fri, 6 Aug 2021 05:33:48 -0700 (PDT) Date: Fri, 6 Aug 2021 13:33:46 +0100 From: Qais Yousef To: "Paul E. McKenney" Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, mingo@kernel.org, jiangshanlai@gmail.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org, Yanfei Xu Subject: Re: [PATCH rcu 02/18] rcu: Fix stall-warning deadlock due to non-release of rcu_node ->lock Message-ID: <20210806123346.qkddi4kqi4z4666e@e107158-lin.cambridge.arm.com> References: <20210721202042.GA1472052@paulmck-ThinkPad-P17-Gen-1> <20210721202127.2129660-2-paulmck@kernel.org> <20210806095730.tw3bgnjtsytrqqfq@e107158-lin.cambridge.arm.com> <20210806114327.GP4397@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210806114327.GP4397@paulmck-ThinkPad-P17-Gen-1> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/06/21 04:43, Paul E. McKenney wrote: > On Fri, Aug 06, 2021 at 10:57:30AM +0100, Qais Yousef wrote: > > On 07/21/21 13:21, Paul E. McKenney wrote: > > > From: Yanfei Xu > > > > > > If rcu_print_task_stall() is invoked on an rcu_node structure that does > > > not contain any tasks blocking the current grace period, it takes an > > > early exit that fails to release that rcu_node structure's lock. This > > > results in a self-deadlock, which is detected by lockdep. > > > > > > To reproduce this bug: > > > > > > tools/testing/selftests/rcutorture/bin/kvm.sh --allcpus --duration 3 --trust-make --configs "TREE03" --kconfig "CONFIG_PROVE_LOCKING=y" --bootargs "rcutorture.stall_cpu=30 rcutorture.stall_cpu_block=1 rcutorture.fwd_progress=0 rcutorture.test_boost=0" > > > > > > This will also result in other complaints, including RCU's scheduler > > > hook complaining about blocking rather than preemption and an rcutorture > > > writer stall. > > > > > > Only a partial RCU CPU stall warning message will be printed because of > > > the self-deadlock. > > > > > > This commit therefore releases the lock on the rcu_print_task_stall() > > > function's early exit path. > > > > > > Fixes: c583bcb8f5ed ("rcu: Don't invoke try_invoke_on_locked_down_task() with irqs disabled") > > > Signed-off-by: Yanfei Xu > > > Signed-off-by: Paul E. McKenney > > > --- > > > > We were seeing similar issue on Android 5.10. Applying patches 1 and 2 did fix > > the deadlock problem and we get proper RCU stall splat now. > > > > For patches 1 and 2: > > > > Tested-by: Qais Yousef > > Thank you, and I will apply this on the next rebase. > > > They have Fixes tags, so should end up in 5.10 stable I presume. > > Here is hoping! ;-) Leave it with me, I've got a todo to make sure this happens ;-) Thanks! -- Qais Yousef