Re: [Question] smp_wmb() in prepare_uprobe()

From: Oleg Nesterov
Date: Thu Nov 22 2018 - 07:37:00 EST


Hi,

On 11/21, Andrea Parri wrote:
>
> The comment for the smp_wmb() in prepare_uprobe() says:
>
> "pairs with rmb() in find_active_uprobe()"

it seems that this comment was wrong from the very beginning,


> but I see no (smp_)rmb() in find_active_uprobe(); I see the smp_rmb() in
> handle_swbp(): is this the intended pairing barrier?

Yes, and the comment near this rmb() says "pairs with wmb() in install_breakpoint()",
today this is not right too.

> Which memory accesses do you want to "order" with this pairing?

See 142b18ddc81439acda4bc4231b291e99fe67d507 ("uprobes: Fix handle_swbp()
vs unregister() + register() race") and the comment above this rmb().

Oleg.