Re: [PATCH v4 30/39] unwind_user/deferred: Make unwind deferral requests NMI-safe

Peter Zijlstra
2025-01-23T22:21:20Z

On Thu, Jan 23, 2025 at 11:48:07AM -0800, Josh Poimboeuf wrote:
> > > > cookie = READ_ONCE(current->unwind_info.cookie);
> > > > do {
> > > > if (cookie)
> > > > return cookie;
> > > > cookie = ctx_to_cookie(cpu, ctr+1);
> > > > } while (!try_cmpxchg64(&current->unwind_info.cookie, &cookie, cookie));
>
> Should not the 2nd argument be &zero?

This I suppose

cookie = READ_ONCE(current->unwind_info.cookie);
do {
if (cookie)
return cookie;
} while (!try_cmpxchg64(&current->unwind_info.cookie, &cookie,
ctx_to_cookie(cpu, ctr+1)));