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 012A6C433EF for ; Fri, 28 Jan 2022 16:14:54 +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: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:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MHgwJK8gmUql4Su0wqNUFUcObICfpmL2R9k8JobO0gI=; b=CJQwMpIZ2sg+nD +E4a8L5KdXSiFNFfB8F3bDf3IvfvVTaXfX+dGeWMAZjhcY6f2TCasDVmkRtDhz8A+rLF84I3nidBE o675vYK5H9TpwQHfiEvjHYzczSsmx8fKQ+XEMBQJRo0hKbw0cgGzJqwPTzlprhpbZsR0PrqTlbJMF MVnVv93OfxHcIGKGy3DP9hEN+9Dl7C3Ys4/6k2osD77QXtnkFcGYgnEXVT/f4cON5ZbAIt6WnUiPS 3fswh3vlyobwilVmu1Zs0hQ74RhOFmnwjpdlSy4LEGsah1ZvKwglPVmGmGKiK1kTevyQA/jdUreFQ 4Scfi8FOJGwLyme6322w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nDTsF-002tvp-5D; Fri, 28 Jan 2022 16:13:19 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nDTr7-002tVx-RJ for linux-arm-kernel@lists.infradead.org; Fri, 28 Jan 2022 16:12:11 +0000 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 CB099113E; Fri, 28 Jan 2022 08:12:08 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.13.45]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 60D523F793; Fri, 28 Jan 2022 08:12:06 -0800 (PST) Date: Fri, 28 Jan 2022 16:11:57 +0000 From: Mark Rutland To: Sven Schnelle Cc: 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, "Paul E. McKenney" Subject: Re: ftrace hangs waiting for rcu Message-ID: References: <20220127114249.03b1b52b@gandalf.local.home> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220128_081209_980169_A2229DF8 X-CRM114-Status: GOOD ( 23.14 ) 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: , 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 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. 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