summaryrefslogtreecommitdiff
path: root/include/linux/zstd_errors.h
diff options
context:
space:
mode:
authorRasmus Villemoes <[email protected]>2025-08-22 20:18:47 +0200
committerTom Rini <[email protected]>2025-09-02 14:11:36 -0600
commit835915bb7d2b76d7e422b6d60628a0f7cef30ddb (patch)
tree287e589a35b90b61020ec2c58252cb46e68b3b2e /include/linux/zstd_errors.h
parent86c5c25b6ca99025ac8ebcbe5c53ea0f398d1f44 (diff)
memtest: only call schedule() once for every 256 words
A function call itself for every word written or read+written in these loops is bad enough. But since the memory test must be run with dcache disabled, the schedule() call, traversing the linked list of registered cyclic clients, and accessing the 'struct cyclic_info' for each to see if any are due for a callback, is quite expensive. On a beagleboneblack, testing a modest 16MiB region takes 2.5 minutes: => dcache off => time mtest 0x81000000 0x82000000 0 1 Testing 81000000 ... 82000000: Iteration: 1 Tested 1 iteration(s) with 0 errors. time: 2 minutes, 28.946 seconds There is really no need for calling schedule() so frequently. It is quite easy to limit the calls to once for every 256 words by using a u8 variable. With that, the same test as above becomes 37 times faster: => dcache off => time mtest 0x81000000 0x82000000 0 1 Testing 81000000 ... 82000000: Iteration: 1 Tested 1 iteration(s) with 0 errors. time: 4.052 seconds Note that we are still making a total of 3 loops * (4 * 2^20 words/loop) / (256 words/call) = 49152 calls during those ~4000 milliseconds, so the schedule() calls are still done less than 0.1ms apart. These numbers are just for a beagleboneblack, other boards may have a slower memory, but we are _two orders of magnitude_ away from schedule() "only" being called at 100Hz, which is still more than enough to ensure any watchdog is kept happy. Signed-off-by: Rasmus Villemoes <[email protected]> Tested-by: Anshul Dalal <[email protected]>
Diffstat (limited to 'include/linux/zstd_errors.h')
0 files changed, 0 insertions, 0 deletions