From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6AC6C433EF for ; Fri, 28 Jan 2022 17:47:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243834AbiA1Rr2 (ORCPT ); Fri, 28 Jan 2022 12:47:28 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:38700 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232613AbiA1Rr0 (ORCPT ); Fri, 28 Jan 2022 12:47:26 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 75455B82698; Fri, 28 Jan 2022 17:47:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33536C340E0; Fri, 28 Jan 2022 17:47:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643392044; bh=fe3LLriNJbj/gKNtEmQukHQOiIHZ1YakMJRXf8yzpGU=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=U9S5LM8k53fjc3ZoZgpVwLV8Pf9bUQUxbCPPKavJMi2sSyQduduuLOaFGx91GbRB9 be3gnTmHJ2FXzWOrLAx429VFTuX68rLjLBR/EfFVaC1i0e42dgUKg/xOhcxpzCDwaf vJ+sNv4A3bMV7lm00hcrDgcZ/1mp2gytQfOC9w6gJ85Bj6n6FEXYdrSwf4JzxyqFQr Q7+eTj8ztIMf2v0ldiriCOtwTDU4us8978zfulKRPRSL9wpeOfg9WsSDR2Grcn7jE5 He+RNcz/kHK7FwMuZZGl/nNAn5dVROelm/cjze+obZ826JwYjaMB3VrUm3t7Lj1kjt zj1nXlCJm5nsA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id E7E835C098D; Fri, 28 Jan 2022 09:47:23 -0800 (PST) Date: Fri, 28 Jan 2022 09:47:23 -0800 From: "Paul E. McKenney" To: Mark Rutland Cc: Sven Schnelle , Steven Rostedt , LKML , Ingo Molnar , Andrew Morton , Yinan Liu , Ard Biesheuvel , Kees Cook , Sachin Sant , linuxppc-dev@lists.ozlabs.org, Russell King , linux-arm-kernel@lists.infradead.org, hca@linux.ibm.com, linux-s390@vger.kernel.org, andriin@fb.com Subject: Re: ftrace hangs waiting for rcu Message-ID: <20220128174723.GA2410054@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20220127114249.03b1b52b@gandalf.local.home> <20220128161547.GL4285@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220128161547.GL4285@paulmck-ThinkPad-P17-Gen-1> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 28, 2022 at 08:15:47AM -0800, Paul E. McKenney wrote: > On Fri, Jan 28, 2022 at 04:11:57PM +0000, Mark Rutland wrote: > > On Fri, Jan 28, 2022 at 05:08:48PM +0100, Sven Schnelle wrote: > > > Hi Mark, > > > > > > Mark Rutland writes: > > > > > > > On arm64 I bisected this down to: > > > > > > > > 7a30871b6a27de1a ("rcu-tasks: Introduce ->percpu_enqueue_shift for dynamic queue selection") > > > > > > > > Which was going wrong because ilog2() rounds down, and so the shift was wrong > > > > for any nr_cpus that was not a power-of-two. Paul had already fixed that in > > > > rcu-next, and just sent a pull request to Linus: > > > > > > > > https://lore.kernel.org/lkml/20220128143251.GA2398275@paulmck-ThinkPad-P17-Gen-1/ > > > > > > > > With that applied, I no longer see these hangs. > > > > > > > > Does your s390 test machine have a non-power-of-two nr_cpus, and does that fix > > > > the issue for you? > > > > > > We noticed the PR from Paul and are currently testing the fix. So far > > > it's looking good. The configuration where we have seen the hang is a > > > bit unusual: > > > > > > - 16 physical CPUs on the kvm host > > > - 248 logical CPUs inside kvm > > > > Aha! 248 is notably *NOT* a power of two, and in this case the shift would be > > wrong (ilog2() would give 7, when we need a shift of 8). > > > > So I suspect you're hitting the same issue as I was. > > And apparently no one runs -next on systems having a non-power-of-two > number of CPUs. ;-) And the fix is now in mainline. Thanx, Paul > > Thanks, > > Mark. > > > > > - debug kernel both on the host and kvm guest > > > > > > So things are likely a bit slow in the kvm guest. Interesting is that > > > the number of CPUs is even. But maybe RCU sees an odd number of CPUs > > > and gets confused before all cpus are brought up. Have to read code/test > > > to see whether that could be possible. > > > > > > Thanks for investigating! > > > Sven From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7726DC433F5 for ; Fri, 28 Jan 2022 17:48:10 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4JllL04VpBz3cQP for ; Sat, 29 Jan 2022 04:48:08 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=U9S5LM8k; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=139.178.84.217; helo=dfw.source.kernel.org; envelope-from=srs0=m9wh=sm=paulmck-thinkpad-p17-gen-1.home=paulmck@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=U9S5LM8k; dkim-atps=neutral Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4JllKD60Sxz2yPL for ; Sat, 29 Jan 2022 04:47:28 +1100 (AEDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C686A61988; Fri, 28 Jan 2022 17:47:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33536C340E0; Fri, 28 Jan 2022 17:47:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643392044; bh=fe3LLriNJbj/gKNtEmQukHQOiIHZ1YakMJRXf8yzpGU=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=U9S5LM8k53fjc3ZoZgpVwLV8Pf9bUQUxbCPPKavJMi2sSyQduduuLOaFGx91GbRB9 be3gnTmHJ2FXzWOrLAx429VFTuX68rLjLBR/EfFVaC1i0e42dgUKg/xOhcxpzCDwaf vJ+sNv4A3bMV7lm00hcrDgcZ/1mp2gytQfOC9w6gJ85Bj6n6FEXYdrSwf4JzxyqFQr Q7+eTj8ztIMf2v0ldiriCOtwTDU4us8978zfulKRPRSL9wpeOfg9WsSDR2Grcn7jE5 He+RNcz/kHK7FwMuZZGl/nNAn5dVROelm/cjze+obZ826JwYjaMB3VrUm3t7Lj1kjt zj1nXlCJm5nsA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id E7E835C098D; Fri, 28 Jan 2022 09:47:23 -0800 (PST) Date: Fri, 28 Jan 2022 09:47:23 -0800 From: "Paul E. McKenney" To: Mark Rutland Subject: Re: ftrace hangs waiting for rcu Message-ID: <20220128174723.GA2410054@paulmck-ThinkPad-P17-Gen-1> References: <20220127114249.03b1b52b@gandalf.local.home> <20220128161547.GL4285@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220128161547.GL4285@paulmck-ThinkPad-P17-Gen-1> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: paulmck@kernel.org Cc: linux-s390@vger.kernel.org, Kees Cook , andriin@fb.com, hca@linux.ibm.com, LKML , Steven Rostedt , Ard Biesheuvel , Sven Schnelle , Sachin Sant , Russell King , Andrew Morton , Yinan Liu , linuxppc-dev@lists.ozlabs.org, Ingo Molnar , linux-arm-kernel@lists.infradead.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, Jan 28, 2022 at 08:15:47AM -0800, Paul E. McKenney wrote: > On Fri, Jan 28, 2022 at 04:11:57PM +0000, Mark Rutland wrote: > > On Fri, Jan 28, 2022 at 05:08:48PM +0100, Sven Schnelle wrote: > > > Hi Mark, > > > > > > Mark Rutland writes: > > > > > > > On arm64 I bisected this down to: > > > > > > > > 7a30871b6a27de1a ("rcu-tasks: Introduce ->percpu_enqueue_shift for dynamic queue selection") > > > > > > > > Which was going wrong because ilog2() rounds down, and so the shift was wrong > > > > for any nr_cpus that was not a power-of-two. Paul had already fixed that in > > > > rcu-next, and just sent a pull request to Linus: > > > > > > > > https://lore.kernel.org/lkml/20220128143251.GA2398275@paulmck-ThinkPad-P17-Gen-1/ > > > > > > > > With that applied, I no longer see these hangs. > > > > > > > > Does your s390 test machine have a non-power-of-two nr_cpus, and does that fix > > > > the issue for you? > > > > > > We noticed the PR from Paul and are currently testing the fix. So far > > > it's looking good. The configuration where we have seen the hang is a > > > bit unusual: > > > > > > - 16 physical CPUs on the kvm host > > > - 248 logical CPUs inside kvm > > > > Aha! 248 is notably *NOT* a power of two, and in this case the shift would be > > wrong (ilog2() would give 7, when we need a shift of 8). > > > > So I suspect you're hitting the same issue as I was. > > And apparently no one runs -next on systems having a non-power-of-two > number of CPUs. ;-) And the fix is now in mainline. Thanx, Paul > > Thanks, > > Mark. > > > > > - debug kernel both on the host and kvm guest > > > > > > So things are likely a bit slow in the kvm guest. Interesting is that > > > the number of CPUs is even. But maybe RCU sees an odd number of CPUs > > > and gets confused before all cpus are brought up. Have to read code/test > > > to see whether that could be possible. > > > > > > Thanks for investigating! > > > Sven From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 135A2C433F5 for ; Fri, 28 Jan 2022 17:48:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CXWQQRWVWsrTbqkdQ9pjUGkZJbEecbC3fMk6IJp2ljM=; b=fRLGTNXjlkoAjR Hq/YBw4AjdPLZdZAWWAQs7WcIjwYB55NfZ401cgVO0rsr5NDiMlQ9urAhMcUfp2PAU4QtNXM2FZZH R6OcgIh9YJvTfBKRvhZRbHnMNl27xWAfbx/W5IMYOJ464Oc6JTv45H7A0Q0C4eD0SfqbX5bAZ2WaL OthUgXBbg7XLwGKZ7s4NkxS50mrEt14Wp7D2HLIqeYk7ufue41nMePW57hI62fJLhbv5eXWI5eXfi MmXJAB3Ft+dUCGOK5BkwidUOIczQ1t4k2BWHRcBYFVpTtk+OX/FZ0LQcYMbD9ZFGKwHzF6/T13tP3 GJdoiXZnmOPht9lOvR9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nDVLM-003FG5-3z; Fri, 28 Jan 2022 17:47:28 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nDVLJ-003FFl-Cd for linux-arm-kernel@lists.infradead.org; Fri, 28 Jan 2022 17:47:26 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C686A61988; Fri, 28 Jan 2022 17:47:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33536C340E0; Fri, 28 Jan 2022 17:47:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643392044; bh=fe3LLriNJbj/gKNtEmQukHQOiIHZ1YakMJRXf8yzpGU=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=U9S5LM8k53fjc3ZoZgpVwLV8Pf9bUQUxbCPPKavJMi2sSyQduduuLOaFGx91GbRB9 be3gnTmHJ2FXzWOrLAx429VFTuX68rLjLBR/EfFVaC1i0e42dgUKg/xOhcxpzCDwaf vJ+sNv4A3bMV7lm00hcrDgcZ/1mp2gytQfOC9w6gJ85Bj6n6FEXYdrSwf4JzxyqFQr Q7+eTj8ztIMf2v0ldiriCOtwTDU4us8978zfulKRPRSL9wpeOfg9WsSDR2Grcn7jE5 He+RNcz/kHK7FwMuZZGl/nNAn5dVROelm/cjze+obZ826JwYjaMB3VrUm3t7Lj1kjt zj1nXlCJm5nsA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id E7E835C098D; Fri, 28 Jan 2022 09:47:23 -0800 (PST) Date: Fri, 28 Jan 2022 09:47:23 -0800 From: "Paul E. McKenney" To: Mark Rutland Cc: Sven Schnelle , Steven Rostedt , LKML , Ingo Molnar , Andrew Morton , Yinan Liu , Ard Biesheuvel , Kees Cook , Sachin Sant , linuxppc-dev@lists.ozlabs.org, Russell King , linux-arm-kernel@lists.infradead.org, hca@linux.ibm.com, linux-s390@vger.kernel.org, andriin@fb.com Subject: Re: ftrace hangs waiting for rcu Message-ID: <20220128174723.GA2410054@paulmck-ThinkPad-P17-Gen-1> References: <20220127114249.03b1b52b@gandalf.local.home> <20220128161547.GL4285@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220128161547.GL4285@paulmck-ThinkPad-P17-Gen-1> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220128_094725_535346_94E24C89 X-CRM114-Status: GOOD ( 31.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: paulmck@kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jan 28, 2022 at 08:15:47AM -0800, Paul E. McKenney wrote: > On Fri, Jan 28, 2022 at 04:11:57PM +0000, Mark Rutland wrote: > > On Fri, Jan 28, 2022 at 05:08:48PM +0100, Sven Schnelle wrote: > > > Hi Mark, > > > > > > Mark Rutland writes: > > > > > > > On arm64 I bisected this down to: > > > > > > > > 7a30871b6a27de1a ("rcu-tasks: Introduce ->percpu_enqueue_shift for dynamic queue selection") > > > > > > > > Which was going wrong because ilog2() rounds down, and so the shift was wrong > > > > for any nr_cpus that was not a power-of-two. Paul had already fixed that in > > > > rcu-next, and just sent a pull request to Linus: > > > > > > > > https://lore.kernel.org/lkml/20220128143251.GA2398275@paulmck-ThinkPad-P17-Gen-1/ > > > > > > > > With that applied, I no longer see these hangs. > > > > > > > > Does your s390 test machine have a non-power-of-two nr_cpus, and does that fix > > > > the issue for you? > > > > > > We noticed the PR from Paul and are currently testing the fix. So far > > > it's looking good. The configuration where we have seen the hang is a > > > bit unusual: > > > > > > - 16 physical CPUs on the kvm host > > > - 248 logical CPUs inside kvm > > > > Aha! 248 is notably *NOT* a power of two, and in this case the shift would be > > wrong (ilog2() would give 7, when we need a shift of 8). > > > > So I suspect you're hitting the same issue as I was. > > And apparently no one runs -next on systems having a non-power-of-two > number of CPUs. ;-) And the fix is now in mainline. Thanx, Paul > > Thanks, > > Mark. > > > > > - debug kernel both on the host and kvm guest > > > > > > So things are likely a bit slow in the kvm guest. Interesting is that > > > the number of CPUs is even. But maybe RCU sees an odd number of CPUs > > > and gets confused before all cpus are brought up. Have to read code/test > > > to see whether that could be possible. > > > > > > Thanks for investigating! > > > Sven _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel