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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5C50EB64D9 for ; Thu, 15 Jun 2023 15:51:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 124418E0001; Thu, 15 Jun 2023 11:51:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0D5346B0074; Thu, 15 Jun 2023 11:51:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EB6828E0001; Thu, 15 Jun 2023 11:51:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id DC36E6B0072 for ; Thu, 15 Jun 2023 11:51:08 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id AF6D040967 for ; Thu, 15 Jun 2023 15:51:08 +0000 (UTC) X-FDA: 80905421016.17.1AF2706 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf07.hostedemail.com (Postfix) with ESMTP id 5379F40003 for ; Thu, 15 Jun 2023 15:51:04 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=HtfzZGG4; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf07.hostedemail.com: domain of nathan@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=nathan@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1686844265; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=6tNA3VS+/z5P9QGyzrnlG3JH8gBRslkRlBgCYBWxS5Q=; b=onYgubUvaytwS0+kR5YjHDYzuDB01SLJmSneAlEbhGryqrkEdq3XplxMYbHwyVcdY7xPda t6d/EB65N57xqSXuN19HE3b+wPKL08NqtuhN/TzzGI8j7kuPcz2s0vZ7lUgup8/1CePelK QH0mU5Hac9CMdgw+b0rKf0PU//NCvrI= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=HtfzZGG4; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf07.hostedemail.com: domain of nathan@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=nathan@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1686844265; a=rsa-sha256; cv=none; b=p1UCX8lkOkHTpVk9TMGbyjERIokK/6S4/YtaTVX/JHe1d/suEZZScRxeg7igr99mf+CHQ9 AgNiPV/dZ2+6lMxw+pQbjg1OUBOJ0pKUIA11mvD3kh8kQ7nc8NSrvtm7SG5rHdMzX2QLJt HS0kjHeIv47x34oDG61NZFnDxtcDl+I= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3543D615C3; Thu, 15 Jun 2023 15:51:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A065C433C0; Thu, 15 Jun 2023 15:51:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686844263; bh=4vpbcLIWH8N9kUhfy14gCg44JnNZ7tmcDbTQofjr2PY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HtfzZGG4h7OB0EE/lQpmPVeug5hEItWTKVdQh4sHq5pkRyi+IBc4bQYhPGfLUyXAE O6q85QbbLOckkkq+ZDCntMP7kzjRH0BvUgQTZTsRtxOQVhMz+kPywYdC329KKPHRCd EzHAMzGxIY08qUxBzBs5hhcSI+TdpRxjxhxRYluzPI7qsWgQhBwbTOga8HmP1oqokR Nfn1KKfQ7SfISyWUrNFe+l7vvHqttosQ0oHQWcCUmbPCzjqzV6ZQmJ6Lgxc8I7me24 3i0BNy8Yi/K34Ad5bteBhAQILk/jkgdXefVdp3M52mTzK8Ji4AXkYMW3KmuCjB1GQn 39zP25YPwdB6Q== Date: Thu, 15 Jun 2023 08:50:59 -0700 From: Nathan Chancellor To: Hugh Dickins Cc: Andrew Morton , Mike Kravetz , Mike Rapoport , "Kirill A. Shutemov" , Matthew Wilcox , David Hildenbrand , Suren Baghdasaryan , Qi Zheng , Peter Zijlstra , Russell King , Catalin Marinas , Will Deacon , Geert Uytterhoeven , Greg Ungerer , Michal Simek , Thomas Bogendoerfer , Helge Deller , John David Anglin , "Aneesh Kumar K.V" , Michael Ellerman , Alexandre Ghiti , Palmer Dabbelt , Heiko Carstens , Christian Borntraeger , Claudio Imbrenda , Alexander Gordeev , John Paul Adrian Glaubitz , "David S. Miller" , Chris Zankel , Max Filippov , x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2 07/23] mips: update_mmu_cache() can replace __update_tlb() Message-ID: <20230615155059.GB3665766@dev-arch.thelio-3990X> References: <178970b0-1539-8aac-76fd-972c6c46ec17@google.com> <20230614231758.GA1503611@dev-arch.thelio-3990X> <344a4da-3890-45fd-607e-b5f85ca6ad48@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <344a4da-3890-45fd-607e-b5f85ca6ad48@google.com> X-Rspamd-Queue-Id: 5379F40003 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 6cindpeanq7quhha6c1gg951q1ogu6gr X-HE-Tag: 1686844264-910853 X-HE-Meta: U2FsdGVkX19lLuHdqGpygRehOa3DuNOA702CjIe7aDOhnK2EMWvfkrYhY7vU8gMKpGi5QwG6ttT2Ayx10WBW+ZQWnAnGI7JoEcxf5EywHlTMxwyKCwCcRg60I52U0PBF51lD6woKgvGhlL6ZuPrjBOO2WRsFx+VBEkJtTjCI1qkGRYTBXCMelmKu8LIzJVW1Sv8atlFnXoUT/7xOf7rsde89ZjEF2Zlc9q4Eh9i/oj5cWCovlLEFSRZQwW/hL0zpLpYpVM/Ya92rTJIKX8obRFVnzQqhw2EY9DZxO26AWRRow/msNzF1Bve+Fd8Xa8Cs/go5KwG+9/opRIHd7mQTr/As+9/Sj+7Tm+ppWeesDNDlSV7p6g18cwJxFhphfw24w78YoCHNOVeLc2yNsw2FohYUAX06IyFKq6Ukt6bxnexojyVqhssPwGx7jPP5kV10AojqlLV2p977p5Ol11fSb5StZc8vIGQevWNUU6VdW2ozkbl/cUjZ1yXJaRTxwuPeowJEnTKKO5m8hKGEZCaqBIYSi1f4eupreUV7UHi2U649C/pS9yDFPL0Lwo+94p45wRwn3BJdi6E5ctFvptx69oVMK9f+REexwaORqtU8+xH4vnY1VApje8vHcJANZu4YkaBrCoAjbFfgQWCR6AemZDpLVYJZYFZnbGM+86qdWWJhavnQnL0Kqe7syLbYCoA1HC/UYCWXB+UQC4jPH/RbuQ50U5+T3/EFkvmoBrLM2hvnPje/sJh9oOGfOW06jVRL3ARnMvaBj/jXCI91F5tQNg5KZLMKb5jVjW3896SkG/oPxHdVIW2l5SC8c7q+iuBDIpb/jcjgHbfm1u5mRakzA1fITgyz0vTheDKGKkwA39ZPoyrBa8R6+NYJi86Rfo1m3X+/cJYxbRdp3Pn1VPbT1MRZTjOOeUs6IkeAQXhXl000NX9fi6JbBi6pUimEDZHTBYhvjoD3JxfXyuKHnNd cBOrb1zJ QdqvskD1CIo1YvKgjEQwRo9rpqwdhBwr8T8oePIRF6bKHnHq08+0SHray/CSS9TU1DxtgFhywOLAa83Yod1p1emcdOI62PngwJKd/jn4r7+3506U8xD1qo7PD1d3cwOJSXpc2VlcNT++DkwBbpBkwUrDAaPU0mubR93E+igndoQwvEj0Eo9vFFiZd54bx027fsclKQgk9CwIHiUAGytzbR13dqT2voR6BCJctB52vDbAvOQbaeIiOMc5W7kVJgjxbOztF133TvwSEG28w6VbFaMtLWGEfLfB/xqArt0IAPoh/+cbi3FLC6FwZd3hDu1ov5LPvivPsF/wAmdWUVa9/xTSeKw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Jun 14, 2023 at 10:43:30PM -0700, Hugh Dickins wrote: > On Wed, 14 Jun 2023, Hugh Dickins wrote: > > On Wed, 14 Jun 2023, Nathan Chancellor wrote: > > > > > > I just bisected a crash while powering down a MIPS machine in QEMU to > > > this change as commit 8044511d3893 ("mips: update_mmu_cache() can > > > replace __update_tlb()") in linux-next. > > > > Thank you, Nathan, that's very helpful indeed. This patch certainly knew > > that it wanted testing, and I'm glad to hear that it is now seeing some. > > > > While powering down? The messages below look like it was just coming up, > > but no doubt that's because you were bisecting (or because I'm unfamiliar > > with what messages to expect there). It's probably irrelevant information, > > but I wonder whether the (V)machine worked well enough for a while before > > you first powered down and spotted the problem, or whether it's never got > > much further than trying to run init (busybox)? I'm trying to get a feel > > for whether the problem occurs under common or uncommon conditions. Ugh sorry, I have been looking into too many bugs lately and got my wires crossed :) this is indeed a problem when running init (which is busybox, this is a simple Buildroot file system). > > > Unfortunately, I can still > > > reproduce it with the existing fix you have for this change on the > > > mailing list, which is present in next-20230614. > > > > Right, that later fix was only for a build warning, nothing functional > > (or at least I hoped that it wasn't making any functional difference). > > > > Thanks a lot for the detailed instructions below: unfortunately, those > > would draw me into a realm of testing I've never needed to enter before, > > so a lot of time spent on setup and learning. Usually, I just stare at > > the source. > > > > What this probably says is that I should revert most my cleanup there, > > and keep as close to the existing code as possible. But some change is > > needed, and I may need to understand (or have a good guess at) what was > > going wrong, to decide what kind of retreat will be successful. > > > > Back to the source for a while: I hope I'll find examples in nearby MIPS > > kernel source (and git history), which will hint at the right way forward. > > Then send you a patch against next-20230614 to try, when I'm reasonably > > confident that it's enough to satisfy my purpose, but likely not to waste > > your time. > > I'm going to take advantage of your good nature by attaching > two alternative patches, either to go on top of next-20230614. > > mips1.patch, > arch/mips/mm/tlb-r4k.c | 12 +----------- > 1 file changed, 1 insertion(+), 11 deletions(-) > > is by far my favourite. I couldn't see anything wrong with what's > already there for mips, but it seems possible that (though I didn't > find it) somewhere calls update_mmu_cache_pmd() on a page table. So > mips1.patch restores the pmd_huge() check, and cleans up further by > removing the silly pgdp, p4dp, pudp, pmdp stuff: the pointer has now > been passed in by the caller, why walk the tree again? I should have > done it this way before. > > But if that doesn't work, then I'm afraid it will have to be > mips2.patch, > arch/mips/include/asm/pgtable.h | 15 ++++++++++++--- > arch/mips/mm/tlb-r3k.c | 5 ++--- > arch/mips/mm/tlb-r4k.c | 27 ++++++++++++++++++--------- > 3 files changed, 32 insertions(+), 15 deletions(-) > > which reverts all of the original patch and its build warning fix, > and does a pte_unmap() to balance the silly pte_offset_map() there; > with an apologetic comment for this being about the only place in > the tree where I have no idea what to do if ptep were NULL. > > I do hope that you find the first fixes the breakage; but if not, then I hate to be the bearer of bad news but the first patch did not fix the breakage, I see the same issue. > I even more fervently hope that the second will, despite my hating it. > Touch wood for the first, fingers crossed for the second, thanks, Thankfully, the second one does. Thanks for the quick and thoughtful responses! Cheers, Nathan