Netdev List
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Robin Murphy <robin.murphy@arm.com>,
	Juanlu Herrero <juanlu@fastmail.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>
Cc: 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 16:16:48 +0100	[thread overview]
Message-ID: <59325d7b-846e-4e5e-9c82-741f87523397@samsung.com> (raw)
In-Reply-To: <41001cf2-6304-45ff-977f-ac1b66ecf559@arm.com>

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.


Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


  parent reply	other threads:[~2026-12-04 15:16 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 [this message]
2026-12-04 20:35         ` Juanlu Herrero
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=59325d7b-846e-4e5e-9c82-741f87523397@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=iommu@lists.linux.dev \
    --cc=juanlu@fastmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --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