On Thu, Jul 02, 2026 at 03:37:50PM +0800, Li Zhe wrote:
> The relevant target sizes here are the x86_64 sizeof(struct page)
> values which patch 8 can hit: 64, 80, and 96 bytes.
> 
> On x86_64, CONFIG_HAVE_ALIGNED_STRUCT_PAGE keeps struct page 16-byte
> aligned. That gives 64 bytes in the common case, 80 bytes when
> WANT_PAGE_VIRTUAL or CONFIG_KMSAN adds extra fields, and 96 bytes when
> both are present. I stopped there deliberately because this series does
> not have a current caller which needs larger constant sizes.
> 
> The 32-byte and 48-byte cases were added only as intermediate fixed-size
> combinations used to build those larger struct page-sized copies while
> keeping them on the inline movnti path.

This needs to be in a comment over that code so that it is clear why that
distinction has been made.

> Yes. The separate helper is there exactly because the added
> 32/48/64/80/96-byte cases carry an extra 8-byte destination-alignment
> check, while I left the existing 4/8/16-byte inline cases unchanged.
> 
> The intent was to keep the larger fixed-size cases on the inline
> movnti path only when they already match the alignment assumptions
> used by __memcpy_flushcache(); otherwise they fall back to that
> out-of-line helper, which already handles the misaligned head/tail
> fragments before entering its movnti loops.

Why can't the larger MOVNTI sizes deal with misaligned cases too and thus make
the code even simpler and more straight-forward this way?

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Reply via email to