[PATCHv6 15/17] mm: Remove the branch from compound_head()

Vlastimil Babka vbabka at suse.cz
Tue Feb 10 08:42:22 PST 2026


On 2/2/26 16:56, Kiryl Shutsemau wrote:
> The compound_head() function is a hot path. For example, the zap path
> calls it for every leaf page table entry.
> 
> Rewrite the helper function in a branchless manner to eliminate the risk
> of CPU branch misprediction.
> 
> Signed-off-by: Kiryl Shutsemau <kas at kernel.org>
> Reviewed-by: Muchun Song <muchun.song at linux.dev>
> Reviewed-by: Zi Yan <ziy at nvidia.com>

Reviewed-by: Vlastimil Babka <vbabka at suse.cz>




More information about the linux-riscv mailing list