New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Under Powercut Testing] os/fs/driver/mtd: Read optimization when CRC and Journaling are enabled #6004
base: master
Are you sure you want to change the base?
[Under Powercut Testing] os/fs/driver/mtd: Read optimization when CRC and Journaling are enabled #6004
Conversation
gSahitya-samsung
commented
Dec 7, 2023
•
edited
edited
- When CRC and Journaling are both enabled, CRC verification of written data is done by reading it back immediately after writing.
- Hence, we do not need to repeat this verification at the time of reading again.
Test pseudocode: -
The improvements may vary in different configuration settings and testcases. |
f2d4575
to
e2bec88
Compare
6d903d6
to
edf5974
Compare
edf5974
to
8217b8e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion, we should compare 1 time of bread & 2 times of read, in otherwords, read count & read size should be checked.
please verify this with tp1x, tp2x, 8730.
I think read count is more important factor because every time it should lock flash & wait for dma interrupt, for most of case.
#endif | ||
#endif /* defined(CONFIG_MTD_SMART_ENABLE_CRC) && !defined(CONFIG_MTD_SMART_JOURNALING) */ | ||
|
||
errout: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useless errout
We want to check that total read calls to flash are increased/decreased/constant? We should check this at a lower hardware level. We should do this for our most commercialized boards - 8721csm, 8730e and mt87686_hdk |
@gSahitya-samsung We have to evaluate |
I mean count of read will affect to performance more, because flow of read is... External flash (ext flash of tp2x need to be tested)
internal flash
|
|
||
ret = MTD_BREAD(dev->mtd, physsector * dev->mtdBlksPerSector, dev->mtdBlksPerSector, (FAR uint8_t *)dev->rwbuffer); | ||
if (ret != dev->mtdBlksPerSector) { | ||
fdbg("Error reading phys sector %d\n", physsector); | ||
return -EIO; | ||
ret = -EIO; | ||
goto errout; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no cleanup code at errout
. So i think we can directly return from here.
* However, if Journaling is enabled, written data is read back and verified with CRC, | ||
* so we can skip this step. | ||
*/ | ||
/* If journaling is disabled, data is not read back and verified at the time of writing itself. Hence we need to read the entire sector into RAM to validate CRC. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls add a tab at the beginning for this comment and split it into two lines.
When CRC and Journaling are both enabled, CRC verification of written data is done by reading it back immediately after writing. Hence, we do not need to repeat this verification at the time of reading again. Co-authored-by: Amogh Hassija <a.hassija@samsung.com>
8217b8e
to
f3a7484
Compare