[Skiboot] question about sbe-p9 timer

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Fri Feb 14 02:08:07 AEDT 2020


On 2/13/20 7:16 AM, Oliver O'Halloran wrote:
> On Thu, Feb 13, 2020 at 3:32 AM Thiago Jung Bauermann
> <bauerman at linux.ibm.com> wrote:
>>
>>
>> Hello,
>>
>> I've been studying the timer code in hw/sbe-p9.c and I have a question
>> regarding concurrency: I noticed that in almost all cases,
>> sbe_last_gen_stamp is accessed with sbe->lock held (where sbe is the
>> default chip).
>>
>> Except in one case: p9_sbe_update_timer_expiry() calls
>> p9_sbe_timer_schedule() - which reads sbe_last_gen_stamp - without
>> acquiring sbe->lock. Is this a problem that needs to be fixed?
> 
> The SBE timer state is protected by a separate lock (sbe_timer_lock)
> since it's global state and not tied to a specific SBE. When starting
> the timer we take the per-SBE lock for the default SBE since we need
> to modify its message queue. Seems ok to me.


Oliver is correct. sbe->lock is per SBE lock used for modifying message queue, etc.

Timer is one specific functionality of SBE.. which is protected by `sbe_timer_lock`.

I don't see any issue in the code.

-Vasant



More information about the Skiboot mailing list