Re: [PATCH v5 7/8] x86/string: extend memcpy_flushcache() fixed-size fastpaths

Borislav Petkov <[email protected]>
Newsgroups org.kernel.vger.linux-arch,org.kernel.vger.linux-hardening,org.kernel.vger.linux-kernel,org.kvack.linux-mm
Message-ID <20260706171902.GCakvjhl5U89iJdaNP@fat_crate.local>
On Mon, Jul 06, 2026 at 03:43:46PM +0800, Li Zhe wrote:
> The extra IS_ALIGNED() check is meant as a conservative performance
> choice, not because MOVNTI itself would be invalid on a misaligned
> destination.

Dude, you can't just wait for me to pull every unobvious decision in the code
out of you - you need to write it down in your commit messages! I'm not a mind
reader, you know.

> As the Intel optimization reference manual notes, higher-throughput
> data movement usually comes with alignment considerations, and can
> be more efficient when the destination is naturally aligned.

This can't get any more vague.

> So for these larger fixed-size cases, I kept the inline path limited
> to the aligned case. For misaligned destinations, falling back to
> __memcpy_flushcache() is expected to be the better choice, since it
> already handles the unaligned head first and only then enters its
> MOVNTI loops.
> 
> I will make that rationale explicit in the code comment and commit
> message in v6.

No, you need to show whether the alignment brigns anything and then add it or
remove it. We don't do things based on hearsay in the kernel - only on hard
performance numbers.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.