Re: [RESEND PATCH v4] x86/hpet: Reduce HPET counter read contention

From: Dave Hansen
Date: Fri Aug 12 2016 - 17:20:20 EST


On 08/12/2016 02:10 PM, Waiman Long wrote:
>> I don't think this is right. If the HPET ever returns the same value
>> twice in a row (unlikely because it's generally too slow to read, but
>> it's plausible that someone will make a fast HPET some day), then this
>> could deadlock.
>
> What is the deadlock scenario you are talking about?

A reader loops waiting for the HPET update by looking for the value to
change. If the HPET updater does an update, but the HPET itself hasn't
advanced, it will write the same value as was there before. The reader
will keep looping thinking there was no update.