[PATCH v3 1/2] lib: sbi_init: Avoid thundering hurd problem with coldboot_lock
Anup Patel
Anup.Patel at wdc.com
Fri Aug 21 23:51:00 EDT 2020
> -----Original Message-----
> From: Bin Meng <bmeng.cn at gmail.com>
> Sent: 18 August 2020 14:46
> To: Anup Patel <Anup.Patel at wdc.com>
> Cc: Atish Patra <Atish.Patra at wdc.com>; Alistair Francis
> <Alistair.Francis at wdc.com>; Heinrich Schuchardt <xypron.glpk at gmx.de>;
> OpenSBI <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 Tue, Aug 18, 2020 at 12:09 PM Anup Patel <anup.patel at wdc.com> 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>
> > ---
> > lib/sbi/sbi_init.c | 20 +++++++++++++-------
> > 1 file changed, 13 insertions(+), 7 deletions(-)
> >
>
> Reviewed-by: Bin Meng <bin.meng at windriver.com>
Applied this patch to the riscv/opensbi repo
Regards,
Anup
More information about the opensbi
mailing list