[PATCH v3 1/2] lib: sbi_init: Avoid thundering hurd problem with coldboot_lock

Heinrich Schuchardt xypron.glpk at gmx.de
Wed Aug 19 08:08:44 EDT 2020


On 19.08.20 14:03, Sean Anderson wrote:
> On 8/18/20 12:07 AM, Anup Patel wrote:
>> We can have thundering hurd problem with coldboot_lock where the
>> boot HART can potentially starve trying to acquire coldboot_lock
>> because some of the non-boot HARTs are continuously acquiring and
>> releasing coldboot_lock. This can happen if MIP.MSIP bit is already
>> set for some of the non-boot HARTs.
>>
>> To avoid thundering hurd problem for coldboot_lock, we use the
>> __smp_load_acquire() and __smp_store_release() for coldboot_done
>> flag and use coldboot_lock only for coldboot_wait_hmask.
>>
>> Signed-off-by: Anup Patel <anup.patel at wdc.com>
>> Tested-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
>> Reviewed-by: Atish Patra <atish.patra at wdc.com>
>
> Just curious, what are the changes from v1 and v2?

Barriers are realized in a different way in patch 1.

Except for the barriers patch 1 follows what I proposed in my original
patch and the following discussion.

And for sure Jessica was right that at least compiler barriers are needed.

Best regards

Heinrich



More information about the opensbi mailing list