Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4228109pxv; Tue, 29 Jun 2021 01:56:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxb3szEUJw3ah1MVJCyybG4FbDDodRY2IQdJlxAEhzw+SrkwEaEZUAsXRQ8zYTGWXFktiGb X-Received: by 2002:a17:907:1b02:: with SMTP id mp2mr28846194ejc.196.1624957001366; Tue, 29 Jun 2021 01:56:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624957001; cv=none; d=google.com; s=arc-20160816; b=Y3IouEQh5dp6YHBIpMeNc17RlwOa+sG0zguY6S32+71BUnaW0c6kalo2xjIbQWM7Pk DvkqZMgSEFraAsU9ro/6nr/x0o2KmSzpUoQd7VnZ3ojO/kcboXkA4awGxKSNNi+D+kPW 9m+6kv3J2XM+0GLuTdBrgFiiDoR0LfD3eq6jp5KqYEI/1OAX/BxxEHr9GDlDjyUUjE1Q HH9fJAYnm9nYGoAZ92bbtldmJ2viLEa58JzGMunLU7xZIujJ2f0bueqpUkfPq5KWO87W RIefJIiqeW13L24/rY7Hnd0TyHF3rW6+883W830mq27O5/g58/Px8ke2kyAfyesbhzJS WHPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=SPxQAXokLOdgOpQBjr6sEgF+ujK4V6kf2EFSQms/feQ=; b=yKtaieDuVa0DIJkvmLJH7sq+5RUiH3Hlxx5oCnAEgfrIzvvZlUnQG/4CT9t1JwFSFX QKOdgC5rAVNyneireCodTCzpwrULZXyyrSvLg/q+yOxFeFOOyMonDtMsCoYWsmQYtqRv l8mmhFQVbqiiG6sq+bj0UJgKG/7SOOwD+7WSxo4wfOBOmKxJyB9R5AccGAQrrnvxiyyx 884fsJv8q3qQWqfUPt+1urdCoACCmRLVUZ+0Ng4itZyOdt3roO6jviTm3MD//QRJ3v3P RjT89wuCE7C0wBl+db2Kiz8azHBuItGtFnTFO+45TwTyZZIz2ulQeJB7quE2f4UADoEx BxMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bo20si3276697edb.17.2021.06.29.01.56.17; Tue, 29 Jun 2021 01:56:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232529AbhF2I4g (ORCPT + 99 others); Tue, 29 Jun 2021 04:56:36 -0400 Received: from muru.com ([72.249.23.125]:58398 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232491AbhF2I4e (ORCPT ); Tue, 29 Jun 2021 04:56:34 -0400 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.