From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-171.mta0.migadu.com (out-171.mta0.migadu.com [91.218.175.171]) (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 09C3E368D5A for ; Thu, 21 May 2026 09:07:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779354456; cv=none; b=AifDeoRoeOUAu92uwRTN7ZH071B6eSsvHmbt38p72UFIsBrIMRTPTDYMLiKZOoTR/DmtQRmx6Aiwddntmj89ifcz7I1evX0LFwU+kpcnQWFpg3F705mJilqmm2odrXDZnbkg7mqdLSRfAjks+JTs+qnY4Hzs2NwO+RMGrCxYcKI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779354456; c=relaxed/simple; bh=d+sRF5H30DnHl8zsHElEvlBRcbP5jT6jopR0Zg0fwzQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nAygB0k2EY9tQ0nallAMktyVdfs7wsazRrBrs0H57Vj0ybjmTI7dZJ0QKS196+oWOAgyStKn2SFk5fv+Gpp5pzbSALNRGPV3re+noqXqLX7UXu72aC8fM2ICbsfSvBC3LX5Ubcql5HP/1xRA02r97ViR170PW904tSVzatnO2VQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=CY66bobv; arc=none smtp.client-ip=91.218.175.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="CY66bobv" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1779354452; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DXhh/3pfw6eWOrAj3wFcgN8+CS5myBHUR35TRSpaluM=; b=CY66bobv7cI+tfUFCA/g4Yu0zOZlao4OPUOIFKNduJpYTF+RzbO31IbRX6KWQ+V63drLZu XRtEH4aCF3fEdbyuTAH7LHMMYNz7Kd8pSynWJcRysuoMQLxvNa8akJpyPBZWiYGIOotGyO 4s0MP7fuJF/W87waK+o0wlBfxrSuH4U= From: Thorsten Blum To: Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "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 Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Thorsten Blum Subject: [PATCH v2 1/2] vdso: move offset_in_page() from linux/mm.h to vdso/page.h Date: Thu, 21 May 2026 11:06:57 +0200 Message-ID: <20260521090655.160282-5-thorsten.blum@linux.dev> In-Reply-To: <20260521090655.160282-4-thorsten.blum@linux.dev> References: <20260521090655.160282-4-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1390; i=thorsten.blum@linux.dev; h=from:subject; bh=d+sRF5H30DnHl8zsHElEvlBRcbP5jT6jopR0Zg0fwzQ=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDFl8p83L2YoD9YrWr2m+xXYp2k3SYM0CL4mSWtO66ezv3 ujvFvvTUcrCIMbFICumyPJg1o8ZvqU1lZtMInbCzGFlAhnCwMUpABP5pM7I8GsVQ3HH+8xfPgvC XjPkV8g0Zhac5a3P2nxxqbSQQGmDEiPDxOOfXd5Utv4U27LX+cHEXSl8tscvHQjWTTrhvEd9olQ YEwA= X-Developer-Key: i=thorsten.blum@linux.dev; a=openpgp; fpr=1D60735E8AEF3BE473B69D84733678FD8DFEEAD4 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT 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 --- 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 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 */