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=-9.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 0EBC7C11F66 for ; Tue, 29 Jun 2021 08:55:43 +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 C9D6261DC1 for ; Tue, 29 Jun 2021 08:55:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C9D6261DC1 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=MscwvJk4LWuGUcy+vENg8puHSwk1wazWPI8yByB0JiI=; b=Wdp2TzmbTCXmzX OO1Og/75WmaoZbiMBd5dU9RAz6yminMUXZwLE1fS7p/G/nrVJMv5+CrdHpL6/xe1edvqQ7fZn/8j/ yHsnuCo9sJuyzEFMuQSnsqFD2hbq4cs8Uld/vKul5exdnoulsLcy8DC9xfbzSntPvk3Q0jEAmaE8X VdCtcwU+7hYAewWawlEf6W0gAW8WJSQ7MhHKh8P6w12eYUzYjeM5oIZRbCjFMeXKx/oDBJbsMRZ2S xl2m30jKCaRZisdm7GsRMRKjzliRQHesgSMwpYRuOFkZwGfzu5BLb/THwbZ8G2ucrsdtnw0STPrKd surRm71eA5V0YMnr99kg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ly9VV-00AIbi-9w; Tue, 29 Jun 2021 08:54:13 +0000 Received: from muru.com ([72.249.23.125]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ly9VQ-00AIaF-U6 for linux-arm-kernel@lists.infradead.org; Tue, 29 Jun 2021 08:54:10 +0000 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id E864880FC; Tue, 29 Jun 2021 08:54:17 +0000 (UTC) Date: Tue, 29 Jun 2021 11:54:02 +0300 From: Tony Lindgren To: Mike Rapoport Cc: Mike Rapoport , linux-arm-kernel@lists.infradead.org, Andrew Morton , Kefeng Wang , 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: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210629_015409_059945_847DE75C X-CRM114-Status: GOOD ( 21.17 ) 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, * Mike Rapoport [210629 05:33]: > On Mon, Jun 28, 2021 at 06:26:26PM +0300, Tony Lindgren wrote: > > * Mike Rapoport [210628 14:07]: > > > Can you please send log with 'memblock=debug' added to the command line? > > > > Sure, log now available at: > > > > http://muru.com/beagle-x15.txt > > Hmm, no clues yet :( > > Do you have CONFIG_DEBUG_VM, CONFIG_DEBUG_VM_PGFLAGS and > CONFIG_PAGE_POISONING enabled in your config? > If not, can you please enable them and see if any of VM_BUG_* triggers? OK enabled, and no errors or warnings are triggered. > Do you use FLATMEM or SPARSEMEM in your config? Looks like make omap2plus_defconfig enables FLATMEM: $ grep -e SPARSEMEM -e FLATMEM .config CONFIG_ARCH_FLATMEM_ENABLE=y CONFIG_ARCH_SPARSEMEM_ENABLE=y CONFIG_FLATMEM_MANUAL=y # CONFIG_SPARSEMEM_MANUAL is not set CONFIG_FLATMEM=y > Let's try seeing what PFNs get false results from pfn_valid, maybe this > will give a better lead. With your patch below, system boots with lots of the following: [ 13.058654] Freeing unused kernel image (initmem) memory: 1024K ... [ 13.129211] pfn_valid(__sync_icache_dcache+0x2c/0x138): pfn: fffb6: is_map: 1 overlaps: 0 [ 13.137481] pfn_valid(__sync_icache_dcache+0x2c/0x138): pfn: fffb7: is_map: 1 overlaps: 0 [ 13.145751] pfn_valid(__sync_icache_dcache+0x2c/0x138): pfn: fffb8: is_map: 1 overlaps: 0 [ 13.153991] pfn_valid(__sync_icache_dcache+0x2c/0x138): pfn: fffb9: is_map: 1 overlaps: 0 [ 13.162200] pfn_valid(__sync_icache_dcache+0x2c/0x138): pfn: fffba: is_map: 1 overlaps: 0 [ 13.170440] pfn_valid(__sync_icache_dcache+0x2c/0x138): pfn: fffbb: is_map: 1 overlaps: 0 [ 13.178680] pfn_valid(__sync_icache_dcache+0x2c/0x138): pfn: fffbc: is_map: 1 overlaps: 0 [ 13.186920] pfn_valid(__sync_icache_dcache+0x2c/0x138): pfn: fffbd: is_map: 1 overlaps: 0 [ 13.195159] pfn_valid(__sync_icache_dcache+0x2c/0x138): pfn: fffbe: is_map: 1 overlaps: 0 [ 13.203399] pfn_valid(__sync_icache_dcache+0x2c/0x138): pfn: fffbf: is_map: 1 overlaps: 0 [ 13.211639] pfn_valid(__sync_icache_dcache+0x2c/0x138): pfn: fff00: is_map: 1 overlaps: 0 ... Then changing console loglevel to 0 boots system to login prompt. But I'm seeing some init processes segfaulting during start-up. Regards, Tony > diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c > index 6162a070a410..66985fc3e730 100644 > --- a/arch/arm/mm/init.c > +++ b/arch/arm/mm/init.c > @@ -126,10 +126,16 @@ int pfn_valid(unsigned long pfn) > { > phys_addr_t addr = __pfn_to_phys(pfn); > unsigned long pageblock_size = PAGE_SIZE * pageblock_nr_pages; > + bool overlaps = memblock_overlaps_region(&memblock.memory, > + ALIGN_DOWN(addr, pageblock_size), > + pageblock_size); > > if (__phys_to_pfn(addr) != pfn) > return 0; > > + if (memblock_is_map_memory(addr) != overlaps) > + pr_info("%s(%pS): pfn: %lx: is_map: %d overlaps: %d\n", __func__, (void *)_RET_IP_, pfn, memblock_is_map_memory(addr), overlaps); > + > /* > * If address less than pageblock_size bytes away from a present > * memory chunk there still will be a memory map entry for it > > -- > Sincerely yours, > Mike. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel