Re: [PATCH 3/4] locking: Introduce smp_cond_acquire()

From: Peter Zijlstra
Date: Thu Dec 03 2015 - 15:32:14 EST


On Thu, Dec 03, 2015 at 11:41:39AM -0800, Davidlohr Bueso wrote:

> >+#define smp_cond_acquire(cond) do { \
> >+ while (!(cond)) \
> >+ cpu_relax(); \
> >+ smp_rmb(); /* ctrl + rmb := acquire */ \
> >+} while (0)
>
> So this hides the fact that we actually are waiting on the cond, as opposed
> to conditional acquiring. Could it be renamed to something like smp_waitcond_acquire()?

Right, I'm conflicted about that. On the one hand you're right, on the
other hand we spin-wait so the next person will want it called
smp_spin_wait_cond_acquire(), also it gets terribly long either way :/

bike-shed away I imagine.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/