Re: [PATCHv2 13/14] mm: Remove the branch from compound_head()

From: Muchun Song

Date: Mon Dec 22 2025 - 01:32:17 EST




> On Dec 18, 2025, at 23:09, Kiryl Shutsemau <kas@xxxxxxxxxx> 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@xxxxxxxxxx>

Reviewed-by: Muchun Song <muchun.song@xxxxxxxxx>

Thanks.