Re: [PATCH 02/18] x86/ticketlock: convert spin loop to C

From: Andi Kleen
Date: Wed Aug 24 2011 - 16:02:34 EST


Jeremy Fitzhardinge <jeremy@xxxxxxxx> writes:
> +
> + for (;;) {
> + if (inc.tickets.head == inc.tickets.tail)
> + goto out;

What's wrong with break ? Similar below.

> + cpu_relax();
> + inc.tickets.head = ACCESS_ONCE(lock->tickets.head);
> + }
> +out: barrier(); /* make sure nothing creeps before the lock is taken */
> }


-Andi
--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only
--
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/