[PATCH] Add a counter and debug printf to change the latency inside tlb_sync

Jessica Clarke jrtc27 at jrtc27.com
Fri Jan 10 11:08:34 PST 2025


On 10 Jan 2025, at 02:16, Chao-ying Fu <icebergfu at gmail.com> wrote:
> 
> On Thu, Jan 9, 2025 at 5:18 PM Bo Gan <ganboing at gmail.com> wrote:
>> 
>> Hi Chaoying,
>> 
>> I don't think this patch does anything at all. Using printf to delay is naive.
>> Can you give concrete example of how the livelock happened and when it happens
>> some precise number on the performance impact?
> 
> Yes, the patch is naive, and we can treat it as the debug patch.
> However, this patch does help us to avoid livelock.
> From our 24-hart configuration, one hart cannot update the variable
> tlb_sync, because another hart always wins to read the value. Then,
> the tlb_sync loop never exits.

That sounds like your core violates the forward progress guarantee
required by the RISC-V spec.

Jess

> The performance impact is minimal, I think. But, I don't have precise numbers.
> Thanks a lot!
> 
> Regards,
> Chao-ying




More information about the opensbi mailing list