[PATCH v3 1/2] lib: sbi_init: Avoid thundering hurd problem with coldboot_lock
Anup Patel
Anup.Patel at wdc.com
Thu Aug 20 07:43:02 EDT 2020
> -----Original Message-----
> From: Heinrich Schuchardt <xypron.glpk at gmx.de>
> Sent: 19 August 2020 17:39
> To: Sean Anderson <seanga2 at gmail.com>; Anup Patel
> <Anup.Patel at wdc.com>; Atish Patra <Atish.Patra at wdc.com>; Alistair
> Francis <Alistair.Francis at wdc.com>
> Cc: opensbi at lists.infradead.org; Anup Patel <anup at brainfault.org>
> Subject: Re: [PATCH v3 1/2] lib: sbi_init: Avoid thundering hurd problem with
> coldboot_lock
>
> 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.
Yes, v1->v2 is replacing use of atomic_read/write() with__smp_load/store_xyz().
v2->v3 is only a typo-fix in PATCH1 subject.
Regards,
Anup
More information about the opensbi
mailing list