From: netdev-bot+sashiko@kernel.org
To: poros@redhat.com
Cc: netdev@vger.kernel.org, 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, ivecera@redhat.com, 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 v6 14/14] selftests: dpll: add reference leak tests
Date: Thu, 03 Dec 2026 15:36:11 +0000 [thread overview]
Message-ID: <179631217187.3146.6072670993050508350@kernel.org> (raw)
In-Reply-To: <20261202153223.2725780-15-poros@redhat.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 1
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] dpll_stress.sh now exits with KSFT_SKIP (4) on every kernel
where the DPLL reference tracker is missing or unconfirmed, even when…
- [Low] dpll_ref_tracker_probe() in dpll_lib.sh deletes its probe device
and then clears only DPLLSIM_PROBE_DEVICE.
--
selftests: dpll: add reference leak tests
This adds library helpers to the dpll selftests. They snapshot the
ref_tracker debugfs entries for DPLL devices and pins, and they report
entries created after the snapshot that still hold references once the
test devices are removed. A throwaway probe device checks whether the
tracker works. The probe runs first in dpll_stress.sh, which also gains a
final leak check, and it also runs in the new dpll_reftrack.sh script.
> diff --git a/tools/testing/selftests/drivers/dpll/dpll_lib.sh b/tools/testing/selftests/drivers/dpll/dpll_lib.sh
> index 13b57e31593cd..0ca33dc75b125 100644
> --- a/tools/testing/selftests/drivers/dpll/dpll_lib.sh
> +++ b/tools/testing/selftests/drivers/dpll/dpll_lib.sh
[ ... ]
> @@ -824,3 +842,390 @@ dpllsim_setup_standard_device()
> return 1
> fi
> }
[ ... ]
> +dpll_ref_tracker_probe()
> +{
> + local file=$1
> + local name attempt ret=2
> +
> + dpll_ref_tracker_snapshot "$file"
[ ... ]
> + for attempt in 1 2 3; do
> + dpllsim_alloc_clock_id
> + name="probe$DPLLSIM_CLOCK_ID"
> + dpllsim_create_device "$name" "$DPLLSIM_CLOCK_ID" && break
[ ... ]
> + done
> + DPLLSIM_PROBE_DEVICE=$name
> +
> + if dpllsim_add_pin "$name" ext0 ext 10000000 input &&
> + dpllsim_deploy "$name"; then
> + ret=1
> + [ -n "$(__dpll_ref_tracker_new_entries "$file")" ] && ret=0
> + fi
> +
> + if dpllsim_delete_device "$name"; then
> + DPLLSIM_PROBE_DEVICE=""
[Severity: Low]
Should DPLLSIM_CREATED_NAME be cleared here too? dpllsim_create_device()
set it to probe<id>. After a successful delete, only DPLLSIM_PROBE_DEVICE
is reset.
In dpll_reftrack.sh with REF_TRACKER set to 0, test_basic_reftrack()
returns before it creates a device, so nothing overwrites the name. At
exit, cleanup() then runs this against the probe<id> path that the run
already removed:
if [ -n "$DPLLSIM_CREATED_NAME" ]; then
dpllsim_delete_device "$DPLLSIM_CREATED_NAME" ||
log_info "cannot delete device $DPLLSIM_CREATED_NAME"
fi
dpllsim_delete_device() returns 0 for a missing directory, so this is
usually a no-op.
However, dpllsim_create_device() refuses an existing directory so that a
directory created by something else is never recorded as a device of this
run. Suppose something outside the lock creates a probe<id> directory
after the probe deletes its device and before the script exits. Could
the exit handler then undeploy and remove that directory?
destroy_device() in test_basic_reftrack() appears to leave the same stale
record for the device created by dpllsim_setup_standard_device(). A fix
that clears DPLLSIM_CREATED_NAME after a successful delete might need to
cover both paths. cleanup() in dpll_stress.sh reads DPLLSIM_CREATED_NAME
the same way.
> + else
> + log_info "cannot delete device $name"
> + return 4
> + fi
[ ... ]
> diff --git a/tools/testing/selftests/drivers/dpll/dpll_stress.sh b/tools/testing/selftests/drivers/dpll/dpll_stress.sh
> index 1474e1b98540d..dd11c0818d3cf 100755
> --- a/tools/testing/selftests/drivers/dpll/dpll_stress.sh
> +++ b/tools/testing/selftests/drivers/dpll/dpll_stress.sh
> @@ -12,11 +12,13 @@ source "$SCRIPTDIR/../../net/lib.sh"
> source "$SCRIPTDIR/dpll_lib.sh"
>
> ALL_TESTS="
> + dpll_test_ref_tracker_probe
> test_rapid_create_delete
> test_concurrent_workers
> test_pin_state_flooding
> test_many_devices
> test_deploy_cycle
> + test_ref_leaks
> "
[Severity: Medium]
Will dpll_stress.sh now report SKIP as its overall result on kernels
without CONFIG_DPLL_REFCNT_TRACKER, even when all five stress tests pass?
On those kernels, dpll_test_ref_tracker_probe() ends in log_test_skip()
for one of two reasons. Either debugfs or the ref_tracker directory is
missing ("ref_tracker debugfs not available"), or CONFIG_REF_TRACKER is
enabled by another option ("no DPLL reference tracked"). Either way,
REF_TRACKER stays 0, and test_ref_leaks() logs a second skip ("reference
tracker not confirmed by the probe").
log_test() merges each result into EXIT_STATUS:
tools/testing/selftests/net/lib.sh:ksft_exit_status_merge() {
...
__ksft_status_merge "$a" "$b" \
$ksft_xfail $ksft_pass $ksft_skip $ksft_fail
}
Skip ranks above pass, so one skip raises EXIT_STATUS from 0 to
ksft_skip, and the script ends with exit $EXIT_STATUS.
Before this patch, dpll_stress.sh had no skip path, so on these kernels
it exited 0. Could the ref_tracker probe and final check be kept out of
the stress script's merged exit status when the tracker is just not
built in, or be left to dpll_reftrack.sh alone?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202153223.2725780-1-poros%40redhat.com
prev parent reply other threads:[~2026-12-03 15:36 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 15:32 [PATCH net-next v6 00/14] dpll: add a simulated DPLL device driver Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 01/14] dpll: dpllsim: Add " Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 02/14] selftests: dpll: add test library and device lifecycle tests Petr Oros
2026-12-03 15:36 ` netdev-bot+sashiko
2026-12-02 15:32 ` [PATCH net-next v6 03/14] dpll: dpllsim: Add configurable pins Petr Oros
2026-12-03 15:36 ` netdev-bot+sashiko
2026-12-02 15:32 ` [PATCH net-next v6 04/14] selftests: dpll: add pin enumeration and property tests Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 05/14] dpll: dpllsim: Add support to set input pin state Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 06/14] selftests: dpll: add pin state tests Petr Oros
2026-12-03 15:36 ` netdev-bot+sashiko
2026-12-02 15:32 ` [PATCH net-next v6 07/14] dpll: dpllsim: Add support to get/set priority on input pins Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 08/14] selftests: dpll: add pin priority test Petr Oros
2026-12-03 15:36 ` netdev-bot+sashiko
2026-12-02 15:32 ` [PATCH net-next v6 09/14] dpll: dpllsim: Add support to set frequency on pins Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 10/14] selftests: dpll: add pin frequency test Petr Oros
2026-12-03 15:36 ` netdev-bot+sashiko
2026-12-02 15:32 ` [PATCH net-next v6 11/14] dpll: dpllsim: Add support to adjust phase Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 12/14] selftests: dpll: add pin phase adjust test Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 13/14] selftests: dpll: add concurrency stress tests Petr Oros
2026-12-02 15:32 ` [PATCH net-next v6 14/14] selftests: dpll: add reference leak tests Petr Oros
2026-12-03 15:36 ` netdev-bot+sashiko [this message]
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=179631217187.3146.6072670993050508350@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@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