Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4345628pxv; Tue, 29 Jun 2021 05:03:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5rZtMX6UvZQLdzeF+3Vhr70uxw/whQ6nBVBaLw8rFyFJ4BdpH/O2f+dfxHFng7/3Bdrhj X-Received: by 2002:a92:d245:: with SMTP id v5mr20611818ilg.287.1624968227128; Tue, 29 Jun 2021 05:03:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624968227; cv=none; d=google.com; s=arc-20160816; b=YY7MxG6l7t2RAAqJuuIJqs6LKCF5kEHfs98uVU/8P7wWgBXTWlK5kZRCmXPi4a3thf 1D39tbhbPE6dnlRczX5r5JR61CNBYwLzD8w+KBvoXV4UIjbcBUqGAOil55amADvyVVvc EKFwewiFrydHX0+Ntj6rIb2hKUEvRL01qlLz4xb42zZR2FiTiToRHoR6gJZBtPvc3PjF KBJjselX7z+M6BoNfBRq2B0sj56hDSEJeHSOzQvOKbrFTw6Jj9lIp5h3vkSaG1sOtkkB JJAu98OOU7t32u815bxuXXGQXUzpfnb/rTmQAeM3UIEiPKuaoDlsVkU7erPirjGZSBtt bMgg== 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=QK9+vuiBu3yR2plHpRumpXNfW5115yp/S7Cz+lD6KCw=; b=DNxLW4UzQ20YAGH0WioBdlI/k9AKzSmR9vIrnF8BF2HMkXy1LuwXE2aFj0FxFOHFwH 5fjQtwcrTsgX2D0zw8pAYQP3nKtdJdynMk6Xky2c2WuH+J02LnePz2jwrBbMiB1BITBB yCE6QgDnPZJUMWJEf7H8xEf/ZMnqwRklRM65ByiwP0gsc8L7x/cXAY9u7gTiwfOWWaC+ 1575cklrSkAJklv3M5OOz48hlxztd7ihCyklPhNTvF22M9RpAfFzYK+0CJePpS6M1DIq v0VIgU9OspTC0BzMIuJqVCqMkG2ndr0gJB1EDG0SyoLoss2OMwP7iLq7+R4+VVW33Y81 LLOA== 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 o8si5435291jat.91.2021.06.29.05.03.35; Tue, 29 Jun 2021 05:03:47 -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 S232985AbhF2LzN (ORCPT + 99 others); Tue, 29 Jun 2021 07:55:13 -0400 Received: from muru.com ([72.249.23.125]:58522 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232556AbhF2LzL (ORCPT ); Tue, 29 Jun 2021 07:55:11 -0400 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 9808580FC; Tue, 29 Jun 2021 11:52:54 +0000 (UTC) Date: Tue, 29 Jun 2021 14:52:39 +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 * Mike Rapoport [210629 10:51]: > As it seems, the new version of pfn_valid() decides that last pages are not > valid because of the overflow in memblock_overlaps_region(). As the result, > __sync_icache_dcache() skips flushing these pages. > > The patch below should fix this. I've left the prints for now, hopefully > they will not appear anymore. Yes this allows the system to boot for me :) I'm still seeing these three prints though: ... smp: Brought up 1 node, 2 CPUs SMP: Total of 2 processors activated (3994.41 BogoMIPS). CPU: All CPU(s) started in SVC mode. pfn_valid(__pageblock_pfn_to_page+0x14/0xa8): pfn: afe00: is_map: 0 overlaps: 1 pfn_valid(__pageblock_pfn_to_page+0x28/0xa8): pfn: affff: is_map: 0 overlaps: 1 pfn_valid(__pageblock_pfn_to_page+0x38/0xa8): pfn: afe00: is_map: 0 overlaps: 1 devtmpfs: initialized ... Regards, Tony > diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c > index 6162a070a410..7ba22d23eca4 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 - 1); > > 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 > @@ -137,7 +143,7 @@ int pfn_valid(unsigned long pfn) > */ > if (memblock_overlaps_region(&memblock.memory, > ALIGN_DOWN(addr, pageblock_size), > - pageblock_size)) > + pageblock_size - 1)) > return 1; > > return 0; > > -- > Sincerely yours, > Mike.