datastruct/hash: Simplify hashtorture initial insertion

Commit 1314f0a0 ("datastruct/hash: Speed up hashtorture initial
insertions") replaced random element placement with a linear scan
guarded by:

        if (elperupdater / 2 - j <= elperupdater - i || random() % 2)

The left disjunct is always true along the loop execution.  The loop
maintains the invariant i == j, starting from i == j == 0.  The guard
therefore reduces to elperupdater / 2 <= elperupdater, and each forced
insertion increments both i and j.  Thus random() % 2 is never
evaluated, and the loop has inserted the first elperupdater / 2
elements consecutively since 2020.

Simplify both perftest_updater_init() and zoo_updater_init() to plain
for loops, drop the unused counter j and random.h include, and update
the comment to describe the actual deterministic behavior.

This does not change the test behavior exercised since 2020.  The
randomized initial population was the only stochastic element in this
initialization path, while the concurrent update loop is a deterministic
round-robin over each updater's elements.  The perfbook description of
hashtorture ("RCU-Protected Hash Table Validation") lists invariant
verification, concurrent-corruption detection, resize correctness,
and performance-data collection as the documented coverage; none is
described as depending on the initial key distribution.

Signed-off-by: Kunwu Chan <kunwu.chan@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 file changed