From: netdev-bot+sashiko@kernel.org
To: poros@redhat.com
Cc: netdev@vger.kernel.org, ivecera@redhat.com, jiri@nvidia.com,
corbet@lwn.net, skhan@linuxfoundation.org, shuah@kernel.org,
rdunlap@infradead.org, jani.nikula@intel.com,
vadim.fedorenko@linux.dev, arkadiusz.kubalewski@intel.com,
jiri@resnulli.us, andrew+netdev@lunn.ch, davem@davemloft.net,
edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net-next v4 13/14] selftests: dpll: add concurrency stress tests
Date: Mon, 16 Nov 2026 14:30:10 +0000 [thread overview]
Message-ID: <179483941092.3136.2707903628491620214@kernel.org> (raw)
In-Reply-To: <20261112130359.840795-14-poros@redhat.com>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] In tools/testing/selftests/drivers/dpll/dpll_stress.sh,
concurrent_worker() installs worker_exit as its EXIT trap (line 281)…
- [Low] delete_worker_devices() (dpll_stress.sh:56-66) calls
dpllsim_delete_device on every name…
- [Low] test_concurrent_workers() clears WORKER_BASES unconditionally
(dpll_stress.sh:322) after the end-of-test sweep.
--
selftests: dpll: add concurrency stress tests
This adds test_concurrent_workers and test_many_devices to dpll_stress.sh.
Each worker runs in a subshell, gets its own reserved range of clock-ids,
and removes the device it has in flight from an exit trap. The parent
removes worker devices by name at the end of the test and from cleanup().
> diff --git a/tools/testing/selftests/drivers/dpll/dpll_stress.sh b/tools/testing/selftests/drivers/dpll/dpll_stress.sh
> index 1745643955da1..2abfacc43b48b 100755
> --- a/tools/testing/selftests/drivers/dpll/dpll_stress.sh
> +++ b/tools/testing/selftests/drivers/dpll/dpll_stress.sh
[ ... ]
> @@ -39,18 +50,111 @@ untrack_device()
> CREATED_DEVICES=("${remaining[@]}")
> }
>
> +# Remove whatever a worker started from the given base clock-id left
> +# behind, which is the device in flight when the worker had to be killed.
> +# A device that does not exist counts as deleted.
> +delete_worker_devices()
> +{
> + local base=$1
> + local i name
> +
> + for i in $(seq 1 "$STRESS_WORKER_ITERATIONS"); do
> + name="st$((base + i))"
> + dpllsim_delete_device "$name" ||
> + log_info "cannot delete device $name"
> + done
> +}
[Severity: Low]
Can this sweep remove a device that this run never created?
dpllsim_create_device() in dpll_lib.sh refuses to take over an existing
directory:
# A directory of that name was left behind by something else and
# must never be recorded as a device of this run.
[ -e "$dev_path" ] && return 1
Clock-ids start at 96000 + RANDOM, so the st<N> left behind by an earlier
failed run can fall inside a worker's range. dpll_lib_cleanup() keeps
configfs mounted on purpose in that case.
When that happens, the worker's create fails and it only counts a failure.
Then delete_worker_devices(), called from test_concurrent_workers() and
from cleanup() for every base in WORKER_BASES, undeploys and removes that
leftover device and its pins by name anyway.
Should the sweep only cover names a worker actually created, or skip
names that already existed before the worker started?
[ ... ]
> +# Create and delete STRESS_WORKER_ITERATIONS devices with clock-ids
> +# following the given base, in a subshell. Each worker derives its own
> +# unique clock-ids from a range reserved for it, so its devices can never
> +# be confused with those of another worker or of the parent. The parent
> +# records the base of every worker, so that the device a killed worker
> +# left behind can be removed by name.
> +concurrent_worker()
> +{
> + # The workers inherit the state of the generator from the parent
> + # and would draw the same pin layouts, so reseed it with the pid of
> + # the subshell first.
> + RANDOM=$BASHPID
> + local base=$1
> + local i name failed=0
> +
> + trap worker_exit EXIT
> + trap 'exit 143' TERM
> + trap 'exit 130' INT
[Severity: Low]
Is DPLLSIM_CREATED_NAME still set to the parent's value when this trap is
armed?
The subshell forked by "concurrent_worker "$base" &" gets a copy of the
parent's DPLLSIM_CREATED_NAME. After test_rapid_create_delete() the
parent's copy still names its last device, because nothing clears it
after the successful delete.
The worker only overwrites it once dpllsim_create_device() gets past the
"[ -e "$dev_path" ] && return 1" check. There are two ways it can reach
worker_exit() with the inherited name:
- cleanup() sends SIGTERM before the worker's first create
- every create in the worker fails at the -e check
In both cases worker_exit() runs:
if [ -n "$DPLLSIM_CREATED_NAME" ]; then
dpllsim_delete_device "$DPLLSIM_CREATED_NAME"
and that acts on a parent device outside the worker's reserved range.
This conflicts with the comment above, which says a worker's devices "can
never be confused with those of another worker or of the parent".
Would setting DPLLSIM_CREATED_NAME="" at the start of concurrent_worker(),
before the EXIT trap is installed, close this gap?
> +
> + for i in $(seq 1 "$STRESS_WORKER_ITERATIONS"); do
> + if ! create_stress_device $((base + i)) 3; then
> + failed=$((failed + 1))
> + continue
> + fi
> + name=$DPLLSIM_CREATED_NAME
> + dpllsim_delete_device "$name" ||
> + failed=$((failed + 1))
> + done
> +
> + [ "$failed" -eq 0 ]
> +}
> +
> +test_concurrent_workers()
> +{
[ ... ]
> + check_err "$failed" "some concurrent workers failed"
> +
> + for base in "${WORKER_BASES[@]}"; do
> + delete_worker_devices "$base"
> + done
> + WORKER_BASES=()
[Severity: Low]
What happens to a worker device that this sweep fails to remove?
delete_worker_devices() only passes a failed dpllsim_delete_device() to
log_info and does not return the failure. WORKER_BASES is then cleared
unconditionally.
After that the device is not in CREATED_DEVICES, not in WORKER_BASES, and
not in the parent's DPLLSIM_CREATED_NAME, so cleanup() never tries to
remove it again.
The other tests in this file, test_many_devices() for example, keep the
device tracked when removal fails:
if dpllsim_delete_device "$i"; then
untrack_device "$i"
else
check_err 1 "cannot delete device $i"
fi
Should the base of a worker whose devices were not all removed stay in
WORKER_BASES, with the failure reported through check_err?
> +
> + log_test "DPLL concurrent workers ($STRESS_CONCURRENT_PROCS processes)"
> +}
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112130359.840795-1-poros%40redhat.com
next prev parent reply other threads:[~2026-11-16 14:30 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 13:03 [PATCH net-next v4 00/14] dpll: add a simulated DPLL device driver Petr Oros
2026-11-12 13:03 ` [PATCH net-next v4 01/14] dpll: dpllsim: Add " Petr Oros
2026-11-12 13:03 ` [PATCH net-next v4 02/14] selftests: dpll: add test library and device lifecycle tests Petr Oros
2026-11-16 14:29 ` netdev-bot+sashiko
2026-11-12 13:03 ` [PATCH net-next v4 03/14] dpll: dpllsim: Add configurable pins Petr Oros
2026-11-12 13:03 ` [PATCH net-next v4 04/14] selftests: dpll: add pin enumeration and property tests Petr Oros
2026-11-12 13:03 ` [PATCH net-next v4 05/14] dpll: dpllsim: Add support to set input pin state Petr Oros
2026-11-12 13:03 ` [PATCH net-next v4 06/14] selftests: dpll: add pin state tests Petr Oros
2026-11-16 14:30 ` netdev-bot+sashiko
2026-11-12 13:03 ` [PATCH net-next v4 07/14] dpll: dpllsim: Add support to get/set priority on input pins Petr Oros
2026-11-12 13:03 ` [PATCH net-next v4 08/14] selftests: dpll: add pin priority test Petr Oros
2026-11-16 14:30 ` netdev-bot+sashiko
2026-11-12 13:03 ` [PATCH net-next v4 09/14] dpll: dpllsim: Add support to set frequency on pins Petr Oros
2026-11-12 13:03 ` [PATCH net-next v4 10/14] selftests: dpll: add pin frequency test Petr Oros
2026-11-16 14:30 ` netdev-bot+sashiko
2026-11-12 13:03 ` [PATCH net-next v4 11/14] dpll: dpllsim: Add support to adjust phase Petr Oros
2026-11-16 14:30 ` netdev-bot+sashiko
2026-11-12 13:03 ` [PATCH net-next v4 12/14] selftests: dpll: add pin phase adjust test Petr Oros
2026-11-16 14:30 ` netdev-bot+sashiko
2026-11-12 13:03 ` [PATCH net-next v4 13/14] selftests: dpll: add concurrency stress tests Petr Oros
2026-11-16 14:30 ` netdev-bot+sashiko [this message]
2026-11-12 13:03 ` [PATCH net-next v4 14/14] selftests: dpll: add reference leak tests Petr Oros
2026-11-16 14:30 ` netdev-bot+sashiko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179483941092.3136.2707903628491620214@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=arkadiusz.kubalewski@intel.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=ivecera@redhat.com \
--cc=jani.nikula@intel.com \
--cc=jiri@nvidia.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=poros@redhat.com \
--cc=rdunlap@infradead.org \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=vadim.fedorenko@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox