aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorDev Jain <[email protected]>2024-03-30 23:05:56 +0530
committerAndrew Morton <[email protected]>2024-04-25 20:56:32 -0700
commit7033c6cc96203eec738ff192829a18a4e12308dc (patch)
treef507f80fc9c0e6a409ae6c9da3daa4c0fe9e75a7 /tools/perf/scripts/python/stackcollapse.py
parentc7876a0cc6a0a74b407b10f9afe5d77920d803ba (diff)
selftests/mm: mremap_test: optimize execution time from minutes to seconds using chunkwise memcmp
Mismatch index is currently being checked by a brute force iteration over the buffer. Instead, break the comparison into O(sqrt(n)) number of chunks, with the chunk size of this order only, where n is the size of the buffer. Do a brute-force iteration to print to stdout only when the highly optimized memcmp() library function returns a mismatch in the chunk. The time complexity of this algorithm is O(sqrt(n)) * t, where t is the time taken by memcmp(); for our test conditions, it is safe to assume t to be small. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Dev Jain <[email protected]> Cc: Anshuman Khandual <[email protected]> Cc: John Hubbard <[email protected]> Cc: Kalesh Singh <[email protected]> Cc: Shuah Khan <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions