From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Wilcox Subject: Re: [PATCH v2 1/4] mm/vmalloc: fix vmalloc_to_page for huge vmap mappings Date: Mon, 13 Apr 2020 06:34:44 -0700 Message-ID: <20200413133444.GM21484@bombadil.infradead.org> References: <20200413125303.423864-1-npiggin@gmail.com> <20200413125303.423864-2-npiggin@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20200413125303.423864-2-npiggin@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane-mx.org@lists.infradead.org To: Nicholas Piggin Cc: linux-arch@vger.kernel.org, "H. Peter Anvin" , Will Deacon , x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Ingo Molnar , Borislav Petkov , Catalin Marinas , Thomas Gleixner , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org List-Id: linux-arch.vger.kernel.org On Mon, Apr 13, 2020 at 10:53:00PM +1000, Nicholas Piggin wrote: > vmalloc_to_page returns NULL for addresses mapped by larger pages[*]. > Whether or not a vmap is huge depends on the architecture details, > alignments, boot options, etc., which the caller can not be expected > to know. Therefore HUGE_VMAP is a regression for vmalloc_to_page. > > This change teaches vmalloc_to_page about larger pages, and returns > the struct page that corresponds to the offset within the large page. > This makes the API agnostic to mapping implementation details. I'm trying to get us away from returning tail pages from various functions. How much of a pain would it be to return the head page instead of the tail page? Obviously the implementation gets simpler, but can the callers cope? I've been focusing on the page cache, so I haven't been looking at the vmalloc side of things at all. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 13 Apr 2020 06:34:44 -0700 From: Matthew Wilcox Subject: Re: [PATCH v2 1/4] mm/vmalloc: fix vmalloc_to_page for huge vmap mappings Message-ID: <20200413133444.GM21484@bombadil.infradead.org> References: <20200413125303.423864-1-npiggin@gmail.com> <20200413125303.423864-2-npiggin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200413125303.423864-2-npiggin@gmail.com> Sender: owner-linux-mm@kvack.org To: Nicholas Piggin Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" List-ID: Message-ID: <20200413133444.rCqqfh5QelD9zBJtsDCjl7zA_COh0UlkCJkNrRfsY7c@z> On Mon, Apr 13, 2020 at 10:53:00PM +1000, Nicholas Piggin wrote: > vmalloc_to_page returns NULL for addresses mapped by larger pages[*]. > Whether or not a vmap is huge depends on the architecture details, > alignments, boot options, etc., which the caller can not be expected > to know. Therefore HUGE_VMAP is a regression for vmalloc_to_page. > > This change teaches vmalloc_to_page about larger pages, and returns > the struct page that corresponds to the offset within the large page. > This makes the API agnostic to mapping implementation details. I'm trying to get us away from returning tail pages from various functions. How much of a pain would it be to return the head page instead of the tail page? Obviously the implementation gets simpler, but can the callers cope? I've been focusing on the page cache, so I haven't been looking at the vmalloc side of things at all.