[PATCH v4 0/4] Miscellaneous about sbi_tlb and sbi_ipi

Anup Patel anup at brainfault.org
Wed Apr 5 21:57:06 PDT 2023


On Thu, Mar 16, 2023 at 1:52 PM Xiang W <wxjstz at 126.com> wrote:
>
> 在 2023-02-02星期四的 16:51 +0800,Xiang W写道:
> > Removed the mutual waiting between process and sync in sbi_tlb
> > Update ipi first then wait together
> >
> Please review!
> Optimization can improve tlb sync efficiency.
>
> sequence diagram before optimization:
> ===================================================================
> send ipi hart       hart 0       hart 1     hart 2   ...
>       +               +           +           +
>       |               |           |           |
>       | update hart 0 |           |           |
>       +<------------->+--+        |           |
>       |               |  |process |           |
>       |               |  |        |           |
>       |               +<-+        |           |
>       | sync          |           |           |
>       +<------------->+           |           |
>       | update hart 1             |           |
>       +<------------------------->+--+        |
>       |                           |  |process |
>       |                           |  |        |
>       |                           +<-+        |
>       | sync                      |           |
>       +<------------------------->+           |
>       | update hart 2                         |
>       +<------------------------------------->+--+
>       |                                       |  |process
>       |                                       |  |
>       |                                       +<-+
>       | sync                                  |
>       +<------------------------------------->+
>       .
>       .
>       .
>
> sequence diagram after optimization:
> ===================================================================
> send ipi hart       hart 0       hart 1     hart 2   ...
>       +               +           +           +
>       |               |           |           |
>       | update hart 0 |           |           |
>       +<------------->+--+        |           |
>       | update hart 1 |  |process |           |
>       +<--------------|--|------->+--+        |
>       | update hart 2 +<-+        |  |process |
>       +<--------------|-----------|--|------->+--+
>       |               |           +<-+        |  |process
>       |               |           |           |  |
>       | sync          |           |           +<-+
>       +<------------->+           |           |
>       | sync                      |           |
>       +<------------------------->+           |
>       | sync                                  |
>       +<------------------------------------->+
>       .
>       .
>       .

Sorry for being slow on this series. Overall, the approach looks
good but I need to review individual patches.

In the meantime, I suggest you try running stress-ng one
QEMU virt machine with this patch applied in OpenSBI.

Regards,
Anup

>
> Regards,
> Xiang W
>
> > V4 Changes:
> > PATCH1: Fixed not adding one to tlb_sync when SBI_FIFO_UNCHANGED
> > PATCH4: Add comments
> >
> > V3 Changes:
> > PATCH2: Remove missing sync in update
> > add PATCH4: Optimize sbi_tlb queue waiting
> >
> > V2 Changes:
> > PATCH2: Fix m changes after update IPIs
> >
> > Xiang W (4):
> >   lib: sbi: Optimize sbi_tlb
> >   lib: sbi: Optimize sbi_ipi
> >   lib: sbi: rename function of sbi_ipi
> >   lib: sbi: Optimize sbi_tlb queue waiting
> >
> >  include/sbi/sbi_ipi.h |  3 +++
> >  lib/sbi/sbi_ipi.c     | 43 ++++++++++++++++++++++++++++++-------
> >  lib/sbi/sbi_tlb.c     | 49 +++++++++++++++++++------------------------
> >  3 files changed, 61 insertions(+), 34 deletions(-)
> >
>
>
> --
> opensbi mailing list
> opensbi at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi



More information about the opensbi mailing list