From: Peter Zijlstra Subject: Re: [RFC PATCH 2/7] mm/vmalloc: Track which page-table levels were modified Date: Fri, 8 May 2020 21:10:48 +0200 Message-ID: <20200508191048.GA2957@hirez.programming.kicks-ass.net> References: <20200508144043.13893-1-joro@8bytes.org> <20200508144043.13893-3-joro@8bytes.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20200508144043.13893-3-joro@8bytes.org> Sender: linux-acpi-owner@vger.kernel.org To: Joerg Roedel Cc: x86@kernel.org, hpa@zytor.com, Dave Hansen , Andy Lutomirski , rjw@rjwysocki.net, Arnd Bergmann , Andrew Morton , Steven Rostedt , Vlastimil Babka , Michal Hocko , Joerg Roedel , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org List-Id: linux-arch.vger.kernel.org On Fri, May 08, 2020 at 04:40:38PM +0200, Joerg Roedel wrote: > +/* > + * Architectures can set this mask to a combination of PGTBL_P?D_MODIFIED values > + * and let generic vmalloc and ioremap code know when arch_sync_kernel_mappings() > + * needs to be called. > + */ > +#ifndef ARCH_PAGE_TABLE_SYNC_MASK > +#define ARCH_PAGE_TABLE_SYNC_MASK 0 > +#endif > + > +void arch_sync_kernel_mappings(unsigned long start, unsigned long end); > + if (mask & ARCH_PAGE_TABLE_SYNC_MASK) > + arch_sync_kernel_mappings(start, end); So you're relying on the compiler DCE'ing the call in the 'normal' case. Works I suppose, but I went over the patches twice to look for a default implementation of it before I figured that out ...