Sparse HART id improvements
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest0 of 3 patches 0 repliesNew
Patches in v1 No applies recorded yet
None of the 3 patches the cover letter announces are in this archive.
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] Sparse HART id improvements
? 2023-10-09???? 14:06 +0530?Anup Patel???
Quoted 38 lines · On Sat, Oct 7, 2023 at 9:19?AM Xiang W <[email protected]> wrote:
Quoted 19 lines
? 2023-10-06???? 10:05 +0530?Anup Patel???
Quoted 11 lines · On Sun, Sep 24, 2023 at 9:28?PM Xiang W <[email protected]> wrote:
Quoted 9 lines
Modify last_hartindex_having_scratch/hartindex_to_hartid_table /hartindex_to_scratch_table as static variables to prevent accidental modification and reduce memory consumption
Xiang W (3):
? lib: sbi: Refactorsbi_scratch_last_hartindexas a function ? lib: sbi: Refactorsbi_hartindex_to_hartidas a function ? lib: sbi: Refactorsbi_hartindex_to_scratchas a functionQuoted 6 lines
All these are in hot-path at various places so introducing a function is certainly not helping.
Also, if some buggy code is accidentally modifying global data then that buggy code should be fixed rather than papering over the problem by introducing these functions.
Quoted 6 lines
PATCH1:
The original code is a bit strange in that there is already a global variablelast_hartindex_having_scratch, but instead of using it outside ofsbi_scratch.c, the macrosbi_scratch_last_hartindexis used. If don't want to modify this macro into a function, why not just change the name of thelast_hartindex_having_scratchrenamed tosbi_scratch_last_hartindexand then remove the macro?The
sbi_scratch_last_hartindex()macro allows adding instrumentation code for debugging purposes. The caller ofsbi_scratch_last_hartindex()should not care about how it is implemented.Quoted 6 lines
PATCH2:
The arrayshartindex_to_hartid_tableandplat->hart_index2idstore similar content, and the extra length of thehartindex_to_hartid_tablearray is not used because there is a determination of whether the index is less thansbi_scratch_last_hartindex. the array can be removed by adding just a little bit of checking.
Quoted 5 lines
The "
plat->hart_index2id" is optional and can be NULL as well so we have to always use "if ()" before accessing "plat->hart_index2id".Also, we always have to access "hart_index2id[]" via "plat" pointer which is slower compared to a global array like "hartindex_to_hartid_table[]".
My expression may not be very accurate, please review my code.
https://lists.infradead.org/pipermail/opensbi/2023-October/005703.html
Regards,
Xiang W
Quoted 25 lines
Regards,
AnupQuoted 21 lines
Regards,
Xiang WQuoted 17 lines
Regards,
AnupQuoted 13 lines
?include/sbi/sbi_scratch.h | 35 ++++++++++++----------------------- ?lib/sbi/sbi_scratch.c???? | 30 ++++++++++++++++++++++++++---- ?2 files changed, 38 insertions(+), 27 deletions(-)
--
2.40.1--
opensbi mailing list
opensbi at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi