From: Juanlu Herrero <juanlu@fastmail.com>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Robin Murphy <robin.murphy@arm.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Shuah Khan <shuah@kernel.org>,
Eric Dumazet <edumazet@kernel.org>,
netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org, iommu@lists.linux.dev
Subject: Re: [PATCH 2/3] dma-debug: skip irrelevant buckets for partial syncs
Date: Fri, 4 Dec 2026 12:35:29 -0800 [thread overview]
Message-ID: <axMjMgp9qQqsuzZl@devvm8761.dkl0.facebook.com> (raw)
In-Reply-To: <59325d7b-846e-4e5e-9c82-741f87523397@samsung.com>
On Fri, Dec 04, 2026 at 04:16:48PM +0100, Marek Szyprowski wrote:
> On 03.12.2026 18:38, Robin Murphy wrote:
> > On 2026-11-10 9:36 pm, Juanlu Herrero wrote:
> >> Partial syncs may start after a mapping's first hash bucket. Finding the
> >> mapping then requires locking earlier buckets.
> >>
> >> Keep a conservative size bound per bucket and skip those that cannot
> >> span the sync range. Raise the bound on insertion and reset it when the
> >> bucket empties. Stale larger bounds only add searches, so removal needs
> >> no list rescan to update the bound.
> >>
> >> This relies on ordered map publication before sync and unmapping after
> >> sync. The bucket lock carries earlier bound updates through later
> >> insertions even when the bound is unchanged.
> >
> > Doesn't this then run the risk of then mis-reporting a sync/unmap with a larger-than-mapped size? The whole point of dma-debug is to catch bad API usage, so obviously it cannot rely on callers being correct. It is an explicit choice for developers who want to check correctness and accept the massive performance impact of doing so, so any reduction of robustness/coverage for the sake of making the inherently slow thing a little less slow seems like a wrong move, and rather missing the point.
>
>
> If I got it right, this optimization only speeds up the lookup of the
> entries. When entry is found then all checks on it are still being
> performed and same issues are reported as without this speedup. The
> only thing that might be improved to ensure proper reporting of all
> possible API violations is to redo the full search if no entry has been
> found and some buckets has been skipped.
>
That is correct and sounds good on redoing the full search if no entry
is found. I will incorporate that into v2 (along with only sending the
dma-debug changes in the patchset and the net-next portion).
--
Juanlu Herrero
next prev parent reply other threads:[~2026-12-04 20:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20261110213736eucas1p1eab83ca5602049b731a5e4937b7d8c4f@eucas1p1.samsung.com>
2026-11-10 21:36 ` [PATCH 0/3] dma-debug: skip irrelevant buckets for partial syncs Juanlu Herrero
2026-11-10 21:36 ` [PATCH 1/3] selftests: net: make iou-zcrx area size configurable Juanlu Herrero
2026-11-10 21:36 ` [PATCH 2/3] dma-debug: skip irrelevant buckets for partial syncs Juanlu Herrero
2026-12-03 17:38 ` Robin Murphy
2026-12-03 23:44 ` Juanlu Herrero
2026-12-04 15:16 ` Marek Szyprowski
2026-12-04 20:35 ` Juanlu Herrero [this message]
2026-11-10 21:36 ` [PATCH 3/3] dma-debug: add bucket bound lifetime coverage Juanlu Herrero
[not found] ` <778b6afe-b25e-4906-bf4d-c6cead3bddd3@samsung.com>
2026-12-03 17:29 ` [PATCH 0/3] dma-debug: skip irrelevant buckets for partial syncs Juanlu Herrero
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=axMjMgp9qQqsuzZl@devvm8761.dkl0.facebook.com \
--to=juanlu@fastmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=iommu@lists.linux.dev \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robin.murphy@arm.com \
--cc=shuah@kernel.org \
/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