Skip to content

f3probe: new probing algorithm#261

Merged
AltraMayor merged 5 commits intomasterfrom
probe_rand
Mar 9, 2026
Merged

f3probe: new probing algorithm#261
AltraMayor merged 5 commits intomasterfrom
probe_rand

Conversation

@AltraMayor
Copy link
Owner

No description provided.

When probabilistic_test() in find_cache_size() finds a bad block,
find_cache_size() calls assess_reset_effect() to decide
the cache size.  assess_reset_effect(), in turn, calls
count_good_blocks() to counts how many good blocks are in
the region under test.  probabilistic_test() performs sparse
random reads, whereas count_good_blocks() reads large chunks
sequentially (1MB at a time).

Some fake drives have a "tiny" (e.g. 8KB) cache for random accesses
and a "large" (e.g. 4MB) cache for sequential accesses.  So,
for these fake drives, it is possible for probabilistic_test() to
find a bad block and count_good_blocks() to find no bad blocks.
This situation has been verified with the donated drive from
issue #50.  The example cache sizes come from the following
discussion among Linux kernel developers:
https://linux-arm-kernel.infradead.narkive.com/h3crV0D3/mmc-quirks-relating-to-performance-lifetime

This commit removes assess_reset_effect() and count_good_blocks(),
so f3probe only issues random reads to circunvent the problem.
As a side effect of removing count_good_blocks(), there is no
longer need to call dev_reset().  Therefore this commit also
removes all code associated with resetting the drive under test.
The new probing algorithm will hopefully eliminate false negatives,
that is, drives that f3probe identifies as good but are actually
fake; see issue #247 for an example.
Since f3probe no longer uses drive resets to probe a drive,
there is no need to report reset statistics.
This patch removes a bias toward higher values that
the current uint64_rand() has.
This commit reviews probe_device_max_blocks() to account for
the new probing algorithm.
@AltraMayor AltraMayor added Enhancement Feature request Features that users have expressed interest in. labels Mar 9, 2026
@AltraMayor AltraMayor merged commit c45485b into master Mar 9, 2026
18 checks passed
@AltraMayor AltraMayor deleted the probe_rand branch March 9, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Feature request Features that users have expressed interest in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant