Maybe... I've got a patch for that variation too.
> BTW even if gcc had problems optimizing that, I'd rather make it explicit,
> that the two variables contain the same information:
>
> activity = sem->activity = 0;
> if (!list_empty(&sem->wait_list))
> sem = __rwsem_do_wake(sem, activity);
>
> IMO that's more readable and will still work if gcc had to flush the
> cached information before using it.
Brrr... I don't like that. If I'm going to pass in a second argument, then I
want it to be what Christoph's version because it's more readable and more
obvious what it's doing (and, since the value is constant, the optimiser can
obviously get rid of it easily). I don't think gcc is going to be a problem in
that respect since the activity member is not volatile.
David
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/