Re: [PATCH 2/3] mm: add bytes_to_page_end() helper
From: David Hildenbrand (Arm)
Date: Mon May 18 2026 - 11:32:18 EST
On 5/18/26 16:52, Thomas Weißschuh wrote:
> On Mon, May 18, 2026 at 04:41:38PM +0200, David Hildenbrand (Arm) wrote:
>> On 5/18/26 16:29, Thomas Weißschuh wrote:
>>>
>>> The idea behind the vdso/ header namespace is that it can be used from
>>> vDSO userspace code. A weird middleground between linux/*.h and uapi/linux/*.h.
>>> Also in a compat vDSO anything depending on BITS_PER_LONG is wrong, and instead
>>> __BITS_PER_LONG needs to be used. A bunch of kconfig settings, like
>>> CONFIG_64BIT can also be off. Additionally internal kernel symbols are
>>> obviously not reachable from vDSO code.
>>>
>>> Regular kernel code should not use the vdso/ namespace but instead use the
>>> regular linux/ headers, which in turn include the corresponding vdso/ one.
>>
>> offset_in_page() is that trivial that I don't see how it shouldn't just go next
>> to PAGE_SIZE / PAGE_MASK, though?
>
> Yes, IMO it could go into vdso/page.h. The related offset_in_folio() which is
> defined right next to offset_in_page() however can not go there, as folios do
> not exist in the vDSO userspace context.
yes, folio stuff should not go in there indeed.
>
> Personally I don't care about where this goes and just wanted to clarify the
> background of the vDSO headers.
Yes, thanks!
--
Cheers,
David