From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795948742; b=5CdroYRcbfv8JoyKDIDP1MPnjNuB9S+oXNEB98xcADaeUKXZGqr48j5urb4kBrmE0Oc8 tMx3U7i2YnEBno0zvnegmJL6mXe/4Ywx6wRdm5mHssvk+BaiNYE0hGjs/dF5hoztn4k9I hcIrSNfGwjBz53P8xlOnRAcuJ2Vp3tnrUi+1E7XYq7Xf100sVr1/tDi4G7SWs9kZOYCal hDQZQ7SGUyMfqCYXjFW3hxVMQb5Qa5H+icrrpPDX2jnIvUCtA6RLUqnEecHE+LFR2I9jc r5raQLq7eIFudP8I1YjdT1/Ugt2ESyeCMe/LQnDSt4+6YESueCuxs0sX1useaqR+HjA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795948742; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=tNwc/8YPjhLumy/F4frMcHxWXg/Gl4BXIxUbZ5WIsC8=; b=4+kPnKJrquV6cl49hZKsIWYGHBK/Yq/NtJVNMw4rW3BYaXPtGcEkKDpcYj/RpvOyKDQq +lhhQvA0ZsLa6I+CUF+AxEgBKHWFsgxNPVZq05gMR4kwY11aFlMAiL4I3ZUcc0IEvPjQd QDWDvTp7MMiTALVAsK8C9lWTgSwVfF4WaO3U2+negO30cSZEa+BuWtZIoxcHxEBG9SJxm S1xFXEvlHKaURErHTeu4ZmtDCiAho6mKx9fAFCD7LVrdT6fH8Dud/6QyYh40CnZxdEn+L at1cWqeZbADt6ptiCc0/gxcnxkGt4F66FEwbx+MdtUkdpdvVWmAYX07P1fPIpRaXErQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=UZHskt1O; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7804C606A325; Sun, 29 Nov 2026 10:39:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=UZHskt1O Received: by smtp.kernel.org (Postfix) with ESMTPSA id A84B21F0092A; Sun, 29 Nov 2026 10:39:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795948741; bh=tNwc/8YPjhLumy/F4frMcHxWXg/Gl4BXIxUbZ5WIsC8=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=UZHskt1OcCQBjelNngt3gw386JsvrH5Mg7gcSEVKaUHEDeO3nZ6rWQUP7cjzKZ38o glNhWRk5ZmWcKj0PfKWvU0E65JgMM+7o5EVFofhBuzADoiHOx3Y04Nwjv56L8ILpSd DEXDZPFT1kJBwo/q1F3OIR+rhJjWT4JzPg0yjW+fysNj8glGvCgtbVfuYuUjngvKud LW9evyvdd7+vNp9E9tavcr/NtH1sEPEuvfbJyZ+8Ru5f6P/ieIn16ii7vG4iDlu+Xn EarEfLnqCNh8CZORAgNuZHc9vylf1Qc+Erayca/72oZ+TmV4yB2huUY2yCj5JE/dWL P3cHjAv1VCmNg== Subject: Re: [PATCH net-next v5 14/14] selftests: dpll: add reference leak tests 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 Date: Sun, 29 Nov 2026 10:39:00 +0000 Message-ID: <179594874023.3146.370947298957325220@kernel.org> In-Reply-To: <20261125090522.3777494-15-poros@redhat.com> References: <20261125090522.3777494-15-poros@redhat.com> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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_lib.sh, __dpll_ref_tracker_note_changed() updates the snapshot with `sed -i… -- selftests: dpll: add reference leak tests This adds library helpers to the dpll selftests that snapshot the ref_tracker debugfs entries before a test creates its devices. They then report entries that appear later and still hold references. A probe test checks that the tracker works, and it runs first in dpll_stress.sh and in the new dpll_reftrack.sh. > diff --git a/tools/testing/selftests/drivers/dpll/dpll_lib.sh b/tools/testing/selftests/drivers/dpll/dpll_lib.sh > index 6f07837a7d9de..06402b3194a11 100644 > --- a/tools/testing/selftests/drivers/dpll/dpll_lib.sh > +++ b/tools/testing/selftests/drivers/dpll/dpll_lib.sh [ ... ] > @@ -799,3 +817,366 @@ dpllsim_setup_standard_device() [ ... ] > +dpll_ref_tracker_snapshot_file() > +{ > + local file pid > + > + find "$DPLL_RUN_DIR" -maxdepth 1 \ > + -name "${DPLL_REF_SNAPSHOT_PREFIX##*/}.*" -mmin +1440 -delete \ > + 2>/dev/null > + for file in "$DPLL_REF_SNAPSHOT_PREFIX".*; do > + [ -f "$file" ] || continue > + pid=${file#"$DPLL_REF_SNAPSHOT_PREFIX".} > + pid=${pid%%.*} > + [[ "$pid" =~ ^[0-9]+$ ]] || continue > + [ -d "/proc/$pid" ] || rm -f "$file" > + done > + mktemp "$DPLL_REF_SNAPSHOT_PREFIX.$$.XXXXXX" > +} [ ... ] > +__dpll_ref_tracker_note_changed() > +{ > + local file=$1 > + local entry name content hash changed="" > + > + for entry in "$DPLL_REF_TRACKER_DIR"/dpll_device@* \ > + "$DPLL_REF_TRACKER_DIR"/dpll_pin@*; do > + [ -f "$entry" ] || continue > + name=$(basename "$entry") > + grep -q "^$name " "$file" || continue > + content=$(cat "$entry" 2>/dev/null) || continue > + hash=$(__dpll_ref_tracker_hash "$content") > + grep -qx "$name $hash" "$file" && continue > + sed -i "s/^$name .*/$name $hash/" "$file" [Severity: Low] Can this sed -i leave a stray file behind in /run/dpll-selftest? GNU sed -i writes the new content to its own temporary file, named sedXXXXXX, in the directory of the input file, here DPLL_RUN_DIR. It then renames that file over the snapshot. If sed is killed before the rename, the temporary file stays, since GNU sed only removes it on its internal error path and not when it gets a signal. A signal to the whole process group while sed runs is enough. That can be a Ctrl-C, or the kselftest runner timeout: runner.sh runs the inner /usr/bin/timeout without --foreground, so it signals the whole group. The stale file sweeps in dpll_ref_tracker_snapshot_file() only match refsnap.*: find "$DPLL_RUN_DIR" -maxdepth 1 \ -name "${DPLL_REF_SNAPSHOT_PREFIX##*/}.*" -mmin +1440 -delete for file in "$DPLL_REF_SNAPSHOT_PREFIX".*; do so a leftover sedXXXXXX file is never removed by later runs. This path is only reached from dpll_ref_tracker_check_leaks() when an entry already in the snapshot changed its content, so the window is narrow. Would it work to write the updated snapshot to a file from mktemp "$DPLL_REF_SNAPSHOT_PREFIX.$$.XXXXXX" and mv it over the snapshot, or to rebuild the snapshot with a shell redirect? Then every temporary file would carry the prefix that the sweep matches. > + changed="$changed $name" > + done > + > + [ -n "$changed" ] && log_info \ > + "references of another driver changed (ignored):$changed" > + return 0 > +} [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261125090522.3777494-1-poros%40redhat.com