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=1796094512; b=NKPyx3jv1m1cxkQVCMXG1ITkL+0A2QEAR5ocQKr2Y0cQ8I/2WsLpUwHHelqZ90FkW9yb zfstYehHX/Vg7D7cD3+MdvCvTC9sRF9ElPKHK9RQ/MB4psaVDll/FNqIHiDdsyaKqmhUM G9RRpXdPzyFtmOaF0v6sl5rSjQF4n5S7bFa0vKRGLEj+OIp/E6jEQPSARiIkORTn7jjCh YEmvFvij9cv82AMdI8f8ug2AIVhCp+iuKH4cC4rl2mrphnkagZ2AJ7vyyRryGbUPG3rYy QYmDJIiGmHm9qMb0nFlkEKk8Pwsv+Aqb5LoSA9wHu/As0pFxXPo6tvT9EjI3SuZv/HA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796094512; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=vT8bye/vSnEbUC5kimHl/2oYBQJgpdw5D3beB1biGCI=; b=jqP0/lMWzj9Ap6FKusC4346BWTnFyV4pCE6imaXpKnKe/5vBDKrfNE4hEwOXIpxwgfN9 iwJLSco2Th6mzO+RwEc+W9xyXZPT4u8W36svfMIGaJKjqH9QEdw8FTRWpLvxnuGv/0KEf xZcYFgRgKjYueQ6ANka2vzPiaSCZLR24+CQcjmNxfHtEyekIlnnR9+sFeQmSZh9YT0c37 NuOMnfp6ySpA6S8w5uP6BW0cYf9u1pyX7YpvFEr00GsRpXkxzOuEPbNlwzkn4ExhdJ2gi rHYWm+IUkaT/4E//vWfQswR2uN/+TGsgXUb/OWZhYc0SzrkQpy71r57MQ4gEdfNtAAA== 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=gGsEd9dq; 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 1C773606A31A for ; Tue, 1 Dec 2026 03:08:31 +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=gGsEd9dq Received: by smtp.kernel.org (Postfix) with ESMTPSA id 864201F00893; Tue, 1 Dec 2026 03:08:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796094511; bh=vT8bye/vSnEbUC5kimHl/2oYBQJgpdw5D3beB1biGCI=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=gGsEd9dq5nZkApSs9wl7c6U6/ct3aWGGKKTfwqZybA1NisP7dwivRA11xu3WhIk+Y 2/EdSrUNZ446fIBWj7FzDdiflUOcfNNhjA+GOA6FJhXHs3hYkQ59kpeLxNzWRgXf9P ByNdD72hHKbL5vSdPwSiAUJmoVfyvXSVo8rTH2HnQgib4KAtY1U5D3GW2N+zwj3TN+ iPL5V01sOQgVu+ZDGxDFwAy8m0KbeZdOz+f0vXtBPkn2IKQrFXrrNl3yWA9yMVCE/9 5OrAYIuWaLFMwqda4W0fICTZe9Jk6i1Ema91vSCx/89vAmpf7NDkwiIAVvLHlEkw9A 1Bmd4CtnCvKyA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] dmaengine: dmatest: Add optional per-stage latency profiling Reply-To: sashiko-reviews@lists.linux.dev To: "Baineng Shou" Cc: dmaengine@vger.kernel.org, vkoul@kernel.org, Frank.Li@kernel.org In-Reply-To: <20261201025813.2994236-1-shoubaineng@gmail.com> References: <20261201025813.2994236-1-shoubaineng@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 03:08:31 +0000 X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [High] dmaengine: dmatest: missing Signed-off-by trailer in commit message - [Medium] dmaengine: dmatest: shared-channel race on PROFILE_EXECUTE in dmatest_func() -- commit 62ef94a524c9e2bd5d0c52778b817c95279c83ab Author: Baineng Shou > dmaengine: dmatest: Add optional per-stage latency profiling > > The aggregate dmatest throughput does not show whether time is spent in > DMA mapping, descriptor preparation, execution or completion delivery. > This makes it difficult to investigate a low copy rate without adding > ad-hoc instrumentation to a test client or a controller driver. > > Add a profile parameter to accumulate six consecutive latency intervals > per test thread: map, prep, submit, issue-to-callback, callback-to-wait- > return, and status-check/unmap. Report the average latency, elapsed time > and percentage for each interval after the existing summary, together > with the minimum, average and maximum map-to-unmap latency. Derive the > effective and execution rates from aggregate bytes and aggregate time. > > Publish the callback timestamp before the completion flag using release > and acquire ordering. Include issue_pending() in the issue-to-callback > interval so that a callback running before the issue call returns does > not create overlapping intervals. Stop accumulating samples after the > first transfer error, verification failure or invalid timestamp sequence > to avoid attributing late callbacks to subsequent samples. Leave the > existing test flow and error handling in place. > > Keep profiling disabled by default and print only per-thread totals at > test completion. Preserve the existing summary and verbose output, and > report profiling as unavailable in polled mode. Document the boundaries, > the accounting rules and the added measurement overhead. In particular, > execution latency includes queueing, interrupt and driver completion > processing; neither rate represents hardware-only or whole-run bandwidth. [Severity: High] The commit message is missing a Signed-off-by: trailer certifying the Developer's Certificate of Origin, as required by Documentation/process/submitting-patches.rst. > diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c > index 2ae3469397f37..e692b41759d67 100644 > --- a/drivers/dma/dmatest.c > +++ b/drivers/dma/dmatest.c [ ... ] > @@ -826,6 +960,8 @@ static int dmatest_func(void *data) > tx->callback =3D dmatest_callback; > tx->callback_param =3D done; > } > + if (do_profile) > + ps.ts[PROFILE_SUBMIT] =3D ktime_get_ns(); > cookie =3D tx->tx_submit(tx); > =20 > if (dma_submit_error(cookie)) { > @@ -841,12 +977,17 @@ static int dmatest_func(void *data) > if (status =3D=3D DMA_COMPLETE) > done->done =3D true; > } else { > + if (do_profile) > + ps.ts[PROFILE_EXECUTE] =3D ktime_get_ns(); > dma_async_issue_pending(chan); [Severity: Medium] Can a sibling thread sharing chan issue this thread's submitted descriptor before ps.ts[PROFILE_EXECUTE] is recorded? When multiple dmatest threads share a channel (via threads_per_chan > 1 or when dmatest_add_channel() spawns threads for multiple transaction types on the same channel), tx->tx_submit(tx) places the armed descriptor on the shared channel queue before ps.ts[PROFILE_EXECUTE] is captured: Thread 0 Thread 1 (same chan) dmatest_func() dmatest_func() tx->callback =3D dmatest_callback tx->tx_submit(tx) dma_async_issue_pending(chan) dmatest_callbac= k() callback_ns = =3D ktime_get_n= s() ps.ts[PROFILE_EXECUTE] =3D ktime_get_ns() <-- after callback_ns Because ps.ts[PROFILE_WAKEUP] is later set to done->callback_ns, ps.ts[PROFILE_WAKEUP] < ps.ts[PROFILE_EXECUTE]. dmatest_profile_add() then treats the sample as having an invalid timestamp sequence, sets stats->aborted =3D true, and stops profiling for the remainder of the threa= d's run. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201025813.2994= 236-1-shoubaineng@gmail.com?part=3D1