πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #17264

Re: [PATCH net-next v4 13/14] selftests: dpll: add concurrency stress tests

#17264
From: netdev-bot+sashiko
Date: Mon, 16 Nov 2026 14:30
177 lines
14107 bytes
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
Technical Details
Message-ID: <179483941092.3136.2707903628491620214@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364454-linux-kernel-netdev=dewy.ru
References: <20261112130359.840795-14-poros@redhat.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364454-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v4 13/14] selftests: dpll: add concurrency stress tests
Date: Mon, 16 Nov 2026 14:30:10 +0000
Organization: Usenet Network
Message-ID: <179483941092.3136.2707903628491620214@kernel.org>
References: <20261112130359.840795-14-poros@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2087032"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:TusO9KF+Uh7cOQ7i8uxR7WjhAN0= sha256:Ya75j+vrQ3iYhXUQF66upCWcT2wD5qLyMHgtui28ke0=
	sha1:RLED8FZhCEJIyUD3iIgVD/2uNAU= sha256:cRXt2YxrAz05fyjcMBDCR134bk/Z/ugh7NIxkG3IrvI=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 8A0E7114C85; Mon, 16 Nov 2026 17:30:48 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id n2IaoOaflN3i;
	Mon, 16 Nov 2026 17:30:42 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-364454-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 5FA51114C81; Mon, 16 Nov 2026 17:30:30 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 41E303A1CB; Mon, 16 Nov 2026 14:30:25 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794839413;
	b=TkslcGtOegnVZDzsNYb5JjY12NDSRh4sU35+pjexViORJSI5qSuWca54J1Q3Lou8SgZZ
	 vbefohGPNpZOqp3wX7mb+RUv10JbW795bLCcxo69apo6S0aR5upIn8CNq6OcBlDH3FZxD
	 MCd5GPLHd7DjBYPD1mnmxHv189CWFuj5STEKq9X8UTZtvoYVwz1BdOAX6oPUKq/XBGN8/
	 /X52XIbIYV4C4SBVI2uLSqHVsQpp4O2gwGIajlcu5CJZ7vYbsPyMFbg2EA9VYYHax8ovl
	 Nu+/wEKAVD102eLGDdL/mb5s0Wa2jeyorMfUMXZ/WNKPomlbzfQVEB0pLHo7uoYXvkA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794839413;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=srRlVwk9lBJVIEpctIRrC3iPgdIcKtJ/p/8zkMOs+Nk=;
	b=bU+KGx45nXImaiqWXr8KcOe+joChr8YsCUSWEEjxX4D9idZeTd95u0NByFv1tgk2XHD9
	 Xjrj6LjzC89tUbkVm1eyPofD318nC6cKyNkvK8EXOMCkEV85TZJpOyxceRcDUjIf9Pnph
	 fVdu3IgEi8rcyAIiq64snBdbhSlS/AWSngXu2qiPAQ6Kj6+CJ2aKuNF+gd3q7EdgynG2H
	 mjjR4RoZHMD4lm/DANv/RLZd/+zOljSfMOmAaEnT9RYQgiJk3Gzj684Oa/pR+novjQLmB
	 ayHX1nwXVmAGJYjRHgsSjY+nUuYigJS3DGns6aknNVghvLQO+JaSkuCLcA5GCBHYpyQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=GGevwkOR;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 6E162606A880;
	Mon, 16 Nov 2026 14:30:13 +0000 (UTC)
X-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=GGevwkOR
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794839412;
	b=qOkfg/wA0rTCHEgwWOjiH0+Qmrbu2uMQAx1FF2HxP+2mPhxdeRdCMgc8jjneiEOBKYjF
	 mfKdWVzThirGMkDJeuqJS02fNeK5z9iLC1/4yGElj3nGUkLYNPPvxxisZkGZo1aRY12g7
	 jDX04svLT2kJnCeb7GFE/lctwW+NfCJPGwiab9JK92JxN+zDDMDCyzKHk03KkXrlY8NXj
	 jvAL0CQ541RFbE2apRIfJlAKi+Hfb3oRqiRyK7kIgt+97iEGVOgSx4wtfx3VGvk0gs9zZ
	 Uli0+VD/3LahkoC90a3/8i13avG5hoShu17DDORHHA4A1lqKsTsUlGEsxZ9NJaiudZg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794839412;
	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=srRlVwk9lBJVIEpctIRrC3iPgdIcKtJ/p/8zkMOs+Nk=;
	b=L1wKJ6pO19ynv4VA48i842C6qGCIXcCaVIICOjXG0wX9M2wsFxYIyPYkP+h35IvpiSzv
	 nqbLv/40zY3YNL9m6dXD10gjd1u6rap8tenfmgouvbjNc13Y+EGbSYG46MPMmGJqJc953
	 f6oiv93hEgFHr6HxDptJ2Q6EmSQt7nv7TI9OvHQBz8MeRt+8dZxayoCPwWHMNUvCvg9an
	 ZwwudwQ9PuQUleR+pT72F1FqD3AA9yEtPm+xHuusqY47neDtdig0YSEjxZYYmChxn5ee4
	 3qerfLaqutYUNX4aMmazw24dCMiBMNZ2n1s/KVVqU8w6c2lqbaVlGHDkpmS6beKz4VA==
X-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=GGevwkOR;
	arc=none smtp.remote-ip=100.103.45.18
X-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 8EB66606A886;
	Mon, 16 Nov 2026 14:30:12 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F8F61F000C7;
	Mon, 16 Nov 2026 14:30:11 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794839412;
	bh=srRlVwk9lBJVIEpctIRrC3iPgdIcKtJ/p/8zkMOs+Nk=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=GGevwkOR2sb61fIURNDHNk0sJ5KrbRmHH2ZnXh/2NWZzRlRsSxyQRtijKaBNZFLeG
	 bd6m3yEEZFrG7AdDEnQml8fLujSFtTDIfrR0GDv6AHQQaEuoZajCZXcNf5ByTGOoqh
	 hGUSdCS3a/lFmlTU7FUg9/GIXQI9yhG5MgIFfcFl19iV0RRHhBMnQV/v8AZrOaGkXK
	 t9o7F362YG+A0kA5H49HSU7Kwhvtnb1DxXvU53+0p8/ncL1Rkl5xpr/NTRtywADCg2
	 5YZVVEEuIyzq5NNeKNZGP3A0wuSynk4nOr7uvRbIFsh7UcKmpigzZVW27eVYUbxma4
	 8YFlLePQzKNlw==
X-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
X-In-Reply-To: <20261112130359.840795-14-poros@redhat.com>
X-sashiko-severity: Low
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list