Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753124AbcKGVGL (ORCPT ); Mon, 7 Nov 2016 16:06:11 -0500 Received: from foss.arm.com ([217.140.101.70]:46120 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752213AbcKGVFN (ORCPT ); Mon, 7 Nov 2016 16:05:13 -0500 Date: Mon, 7 Nov 2016 21:05:14 +0000 From: Will Deacon To: Robert Richter Cc: Robert Richter , Mark Rutland , Ard Biesheuvel , Catalin Marinas , David Daney , Hanjun Guo , "linux-arm-kernel@lists.infradead.org" , "linux-efi@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] arm64: mm: Fix memmap to be initialized for the entire section Message-ID: <20161107210514.GP20591@arm.com> References: <1475747527-32387-1-git-send-email-rrichter@cavium.com> <20161006161114.GH22012@rric.localdomain> <20161017185801.GT25086@rric.localdomain> <20161027160136.GD24290@arm.com> <20161028091905.GM22012@rric.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161028091905.GM22012@rric.localdomain> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1599 Lines: 38 On Fri, Oct 28, 2016 at 11:19:05AM +0200, Robert Richter wrote: > On 27.10.16 17:01:36, Will Deacon wrote: > > It feels to me like NOMAP memory is a new type > > of memory where there *is* a struct page, but it shouldn't be used for > > anything. > > IMO, a NOMAP page should just be handled like a reserved page except > that the page is marked reserved. See free_low_memory_core_early(). > Thus, NOMAP pages are not in the free pages list or set to reserved. > It is simply not available for mapping at all. Isn't that exactly what > it should be? > > I also did not yet understand the benefit of the differentiation > between NOMAP and reserved and the original motivation for its > implementation. I looked through the mail threads but could not find > any hint. The only difference I see now is that it is not listed as a > reserved page, but as long as it is not freed it should behave the > same. I remember the case to handle memory different (coherency, > etc.), but are not sure here. Ard, could you explain this? > > > I don't think pfn_valid can describe that, given the way it's > > currently used, and flipping the logic is just likely to move the problem > > elsewhere. > > > > What options do we have for fixing this in the NUMA code? > > Out of my mind: > > 1) Treat NOMAP pages same as reserved pages (my patch). Just to reiterate here, but your patch as it stands will break other parts of the kernel. For example, acpi_os_ioremap relies on being able to ioremap these regions afaict. I think any solution involving pfn_valid is just going to move the crash around. Will