On Mon, Nov 25, 2024 at 09:01:56PM -0800, Ankur Arora wrote: > Ankur Arora <ankur.a.arora@xxxxxxxxxx> writes: > > +/** > > + * smp_cond_load_relaxed_timeout() - (Spin) wait for cond with no ordering > > + * guarantees until a timeout expires. > > + * @ptr: pointer to the variable to wait on > > + * @cond: boolean expression to wait for > > + * @time_expr_ns: evaluates to the current time > > + * @time_limit_ns: compared against time_expr_ns > > + * > > + * Equivalent to using READ_ONCE() on the condition variable. > > + * > > + * Due to C lacking lambda expressions we load the value of *ptr into a > > + * pre-named variable @VAL to be used in @cond. > > Based on the review comments so far I'm planning to add the following > text to this comment: > > Note that in the generic version the time check is done only coarsely > to minimize instructions executed while spin-waiting. > > Architecture specific variations might also have their own timeout > granularity. Looks good. > Meanwhile, would appreciate more reviews. It's the middle of the merging window, usually not much review happens unless they are fixes/regressions. -- Catalin