Re: [PATCH 2/2] mm/userfaultfd: fix wrong likely() hint on mmap_changing check in move_pages()
From: Peter Xu
Date: Mon Mar 30 2026 - 15:45:47 EST
On Sat, Mar 28, 2026 at 05:01:01PM +0000, David Carlier wrote:
> The mmap_changing check in move_pages() uses likely() but the condition
> being true (concurrent mapping changes during UFFDIO_MOVE) is the
> exceptional case, not the common one. All other mmap_changing checks in
> the same file correctly use no branch hint or use unlikely().
>
> Replace likely() with unlikely() to match the expected branch behavior.
>
> Signed-off-by: David Carlier <devnexen@xxxxxxxxx>
Reviewed-by: Peter Xu <peterx@xxxxxxxxxx>
--
Peter Xu