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 X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9042BC2B9F4 for ; Mon, 28 Jun 2021 10:22:14 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5D71E61C6A for ; Mon, 28 Jun 2021 10:22:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D71E61C6A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=atomide.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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=zHO8pou5aJOJC0Q9zP8/pvjQ3JH/IJOISlTTBYrkQiA=; b=vN5qpficKlxqsw 5/1GYPj9C593j901o/LvvuCscmD5WXg8s315o5mToAAzAWFDGhQqk8aY6hnIh+z6jfah7KY90ca9t /mjmgW6kha0tiRTQtGgI4nLDXcXd2n4Q3TyKerLYRM4Lb2XoYLSHNO52W4bfwdB0JKm51qOYSoqUZ gWKJT+7S+ridxumsVxEBj8z3hd3sDMAvLng2U60QxwqrSQAUMAo79N6SnvC3zlwzVp/G76mIswm4d gw3a8NqCPjFH+SMfJFMNkjHNHtSw/wraksk5oZWLnQHU9xeG7bvchu8zDyLMH+9e18WUIUAp+rxuz L1dyqduQzYr++75NQ5mQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lxoNK-007bxI-Ot; Mon, 28 Jun 2021 10:20:22 +0000 Received: from muru.com ([72.249.23.125]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lxoNH-007bvl-E2 for linux-arm-kernel@lists.infradead.org; Mon, 28 Jun 2021 10:20:20 +0000 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id EFAE68047; Mon, 28 Jun 2021 10:20:25 +0000 (UTC) Date: Mon, 28 Jun 2021 13:20:11 +0300 From: Tony Lindgren To: Mike Rapoport Cc: linux-arm-kernel@lists.infradead.org, Andrew Morton , Kefeng Wang , Mike Rapoport , Russell King , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-omap@vger.kernel.org, regressions@lists.linux.dev Subject: Re: [PATCH v2 3/3] arm: extend pfn_valid to take into accound freed memory map alignment Message-ID: References: <20210519141436.11961-1-rppt@kernel.org> <20210519141436.11961-4-rppt@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210519141436.11961-4-rppt@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210628_032019_536701_A0EF9DD2 X-CRM114-Status: GOOD ( 25.47 ) 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 Hi, Looks like this patch causes a boot regression at least for Cortex-A15. That's commit 990e6d0e1de8 ("arm: extend pfn_valid to take into accound freed memory map alignment") in Linux next. Most of the time I see the following on beagle-x15 right after init starts: Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b CPU0: stopping CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.13.0-rc7-next-20210625 #100 Hardware name: Generic DRA74X (Flattened Device Tree) [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack_lvl+0x40/0x4c) [] (dump_stack_lvl) from [] (do_handle_IPI+0x2c8/0x334) [] (do_handle_IPI) from [] (ipi_handler+0x14/0x20) [] (ipi_handler) from [] (handle_percpu_devid_irq+0xa8/0x22c) [] (handle_percpu_devid_irq) from [] (handle_domain_irq+0x64/0xa4) [] (handle_domain_irq) from [] (gic_handle_irq+0x88/0xb0) [] (gic_handle_irq) from [] (__irq_svc+0x6c/0x90) Exception stack(0xc0f01f08 to 0xc0f01f50) 1f00: 00000f38 00000f37 00000000 fe600000 c0ff90c0 00000000 1f20: c0f0520c c0f05260 00000000 c0f00000 00000000 c0e788f0 00000000 c0f01f58 1f40: c0126aa0 c0107dc4 60000013 ffffffff [] (__irq_svc) from [] (arch_cpu_idle+0x1c/0x3c) [] (arch_cpu_idle) from [] (default_idle_call+0x38/0xe0) [] (default_idle_call) from [] (do_idle+0x214/0x2cc) [] (do_idle) from [] (cpu_startup_entry+0x18/0x1c) [] (cpu_startup_entry) from [] (start_kernel+0x5cc/0x6c4) Sometimes the system boots to console, but maybe only about 20% of the time. Reverting 990e6d0e1de8 makes Linux next boot again for me. Regards, Tony #regzb introduced: 990e6d0e1de8 ("arm: extend pfn_valid to take into accound freed memory map alignment") * Mike Rapoport [700101 02:00]: > From: Mike Rapoport > > When unused memory map is freed the preserved part of the memory map is > extended to match pageblock boundaries because lots of core mm > functionality relies on homogeneity of the memory map within pageblock > boundaries. > > Since pfn_valid() is used to check whether there is a valid memory map > entry for a PFN, make it return true also for PFNs that have memory map > entries even if there is no actual memory populated there. > > Signed-off-by: Mike Rapoport > --- > arch/arm/mm/init.c | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c > index 9d4744a632c6..6162a070a410 100644 > --- a/arch/arm/mm/init.c > +++ b/arch/arm/mm/init.c > @@ -125,11 +125,22 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max_low, > int pfn_valid(unsigned long pfn) > { > phys_addr_t addr = __pfn_to_phys(pfn); > + unsigned long pageblock_size = PAGE_SIZE * pageblock_nr_pages; > > if (__phys_to_pfn(addr) != pfn) > return 0; > > - return memblock_is_map_memory(addr); > + /* > + * If address less than pageblock_size bytes away from a present > + * memory chunk there still will be a memory map entry for it > + * because we round freed memory map to the pageblock boundaries. > + */ > + if (memblock_overlaps_region(&memblock.memory, > + ALIGN_DOWN(addr, pageblock_size), > + pageblock_size)) > + return 1; > + > + return 0; > } > EXPORT_SYMBOL(pfn_valid); > #endif > -- > 2.28.0 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel