From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9AE45386C0F for ; Thu, 21 May 2026 11:16:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779362162; cv=none; b=tai/RTUKHis+U6l+rEwpRGB6ML/zKuwDpJCMKrK2MMzhGutbQ+OFX1AkR8ooDmZeEek94n4l0QN8Vxhh9PuQHWra2g/iEdWhOjlHZL3m+V8Tb1R71L9nmYdf29Pkb4buFNXRc/YffJqKDfRLpjeBUV8d/Ok84rJmd5lgYn/OAoc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779362162; c=relaxed/simple; bh=IGBtbAmB7cEZl3xQ4EsXc49qDr1TRn7Fa3y+9e7+BH8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gMz8uSj80Rl/UOPXKPH8ZJ+uIJ7F6Ju/k2s9w3LSNwdfm+RmZgZBk1CeCsFNyFBSWfkwZgSycgRk004aTNAvf7AXcyrxVbCrO9V3IaH0u1C6dHyoK1ubI1ApKsGloiOHRc1YG62Da9ITyFaV1ZL+mEmS2gXrQVkKKNLNtqWQMbk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kdUL/Zxx; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kdUL/Zxx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 881061F000E9; Thu, 21 May 2026 11:15:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779362161; bh=tUqCEaIwv59xhPWZ9lQM3IUpmmiAbOqHhySQs5puZTA=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=kdUL/ZxxJfh5nK6UeSNnf7xvyM3C361vwopwhd/c8kQLVkYZkHMBvlp9FTEggIVSB Mct4rJ9w9SMxTHCMTBl4dvw3tw68jnTGNlkpZC4+2qOHmnqpgyCqmCVNj+J0XnGKia oCZvPQ9+/66ee8xZY1LuJAYznv15Oa0lnI1B/rrI2SzpDODHTDidtJCUqfLRPTJHGq krFQcbqKf49uVpkszEOrns4bKSi+BvMaEh5jp4Xy2bLAOOv9iWnljwuUxhmrlJJqTS IJruLON27FQFRYjNzgqGWRYNqZj8hO1/nNsrWAL5x3YocTEMQYKk9lUsS1do0g4dtK eURRBzpI6etiQ== Date: Thu, 21 May 2026 12:15:54 +0100 From: Lorenzo Stoakes To: Thorsten Blum Cc: Andrew Morton , David Hildenbrand , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Kees Cook , Andy Shevchenko , Yury Norov , David Laight , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] vdso: move offset_in_page() from linux/mm.h to vdso/page.h Message-ID: References: <20260521090655.160282-4-thorsten.blum@linux.dev> <20260521090655.160282-5-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260521090655.160282-5-thorsten.blum@linux.dev> On Thu, May 21, 2026 at 11:06:57AM +0200, Thorsten Blum wrote: > Move offset_in_page() out of linux/mm.h so users that only need page > offset calculations can include the lightweight vdso/page.h header > instead of pulling in the large linux/mm.h. > > Include vdso/page.h from linux/mm.h so existing users of > offset_in_page() continue to build. > > Signed-off-by: Thorsten Blum LGTM other than dropping the include below (maybe Andrew can do it for us?), so: Reviewed-by: Lorenzo Stoakes > --- > include/linux/mm.h | 2 +- > include/vdso/page.h | 2 ++ > 2 files changed, 3 insertions(+), 1 deletion(-) > > diff --git a/include/linux/mm.h b/include/linux/mm.h > index 9cedc5e75aa9..d5c7f1ca80ef 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -37,6 +37,7 @@ > #include > #include > #include > +#include Yeah as per David Laight, we don't need this. > > struct mempolicy; > struct anon_vma; > @@ -3023,7 +3024,6 @@ static inline void clear_page_pfmemalloc(struct page *page) > */ > extern void pagefault_out_of_memory(void); > > -#define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) > #define offset_in_folio(folio, p) ((unsigned long)(p) & (folio_size(folio) - 1)) > > /* > diff --git a/include/vdso/page.h b/include/vdso/page.h > index bc47186c07fc..948b13091084 100644 > --- a/include/vdso/page.h > +++ b/include/vdso/page.h > @@ -28,4 +28,6 @@ > #define PAGE_MASK (~(PAGE_SIZE - 1)) > #endif > > +#define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) > + > #endif /* __VDSO_PAGE_H */