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

Xiang W wxjstz at 126.com
Thu Mar 16 00:51:22 PDT 2023


在 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                                  |
      +<------------------------------------->+
      .
      .
      .

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(-)
> 




More information about the opensbi mailing list