Article View: linux.kernel.netdev
Article #27122Re: [PATCH 2/3] dma-debug: skip irrelevant buckets for partial syncs
From: Juanlu Herrero
Date: Fri, 04 Dec 2026 20:35
Date: Fri, 04 Dec 2026 20:35
32 lines
15358 bytes
15358 bytes
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
Technical Details
Message-ID:
<axMjMgp9qQqsuzZl@devvm8761.dkl0.facebook.com>Path:
mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377617-linux-kernel-netdev=dewy.ruReferences:
<20261110-zcrx-dma-debug-registration-v1-0-48743ea61631@fastmail.com> <20261110-zcrx-dma-debug-registration-v1-2-48743ea61631@fastmail.com> <CGME20261203173915eucas1p1d54b3770b24cf04e25ef5ce565bbe100@eucas1p1.samsung.com> <41001cf2-6304-45ff-977f-ac1b66ecf559@arm.com> <59325d7b-846e-4e5e-9c82-741f87523397@samsung.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377617-linux-kernel-netdev=dewy.ru
From: juanlu@fastmail.com (Juanlu Herrero)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH 2/3] dma-debug: skip irrelevant buckets for partial syncs
Date: Fri, 4 Dec 2026 12:35:29 -0800
Organization: Usenet Network
Message-ID: <axMjMgp9qQqsuzZl@devvm8761.dkl0.facebook.com>
References: <20261110-zcrx-dma-debug-registration-v1-0-48743ea61631@fastmail.com>
<20261110-zcrx-dma-debug-registration-v1-2-48743ea61631@fastmail.com>
<CGME20261203173915eucas1p1d54b3770b24cf04e25ef5ce565bbe100@eucas1p1.samsung.com>
<41001cf2-6304-45ff-977f-ac1b66ecf559@arm.com>
<59325d7b-846e-4e5e-9c82-741f87523397@samsung.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="2858635"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:een46WyOG1LeHXOMcIychrxMdzo= sha256:52Lgyc/EZ+5e6uQf/eozCHv5dbLqedIM6HF+oSSmCzA=
sha1:bwhIUwmLsYBbmRO8g24IUVbB4c8= sha256:2A6Bv/qVB6wuVw4apfwR/XJTOQxwMAbs65FZXQgxhhk=
Content-Disposition: inline
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 456D9117C79; Fri, 4 Dec 2026 23:36:05 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.296
X-Spam-Status: No, score=-3.296 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001,
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=fastmail.com header.b=LxN6hY6k; dkim=pass (2048-bit key)
header.d=messagingengine.com header.b=y0H91X0E
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 f9G0FAg_IUDV;
Fri, 4 Dec 2026 23:35:58 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-377617-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=fastmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 36979117C8E; Fri, 4 Dec 2026 23:35:43 +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 1060627FC4; Fri, 4 Dec 2026 20:35:41 +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=1796416540;
b=kYltLyynMs+Wqq9Sbw5GZrJRhIG4KyHoQQp79aaf6+q2+KEz23DDYk18QhMT6hiQUdWd
VnRLT8S2n6p2q/qW6lIanN1onBTbzsA7YEP1Do5bwuc0fW/01Oi9nxt1ROryqC8HqPd+R
N02t3wLznnMyx9XWm5Zc9Y6brf4HrsZEWUbExTlrHexfIQu8J1HgpkLMeaKl2n4D6y01i
Viw8Bd/nhvvmI6tJDC+XP9Y5dyRJO26M0U3MIRe/y1g9F4ihbYw8R5nqQIR3Ke3fEk983
b1r/LKo2KZRRdIy3oLwKtqiwgc5rpRw+gPlnDCbDwp1kfJEyjrxVSHpUv939W+ebXpg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796416540;
h=X-Original-To:Received:DMARC-Filter:Received:Received:DKIM-Signature:
DKIM-Signature:X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:
Message-Instance:X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:
X-ME-Proxy:Feedback-ID:Received:Date:From:To:Cc:Subject:Message-ID:
References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
Content-Disposition:Content-Transfer-Encoding:In-Reply-To;
bh=k5h+tAMbd3u89wHMOkh5xreAlZ3zAJtalfdtyOBuwFs=;
b=qLwF6XvSn3RuR7TlMfdSsUg0RhPPSGgtcex2gkAW473crZbilckf4ho1RtCoWsmbyKbS
r2bBUVqbI4wiQI6mMhG0dUR71dbYTJbWGMzzHJImqWOnBcRo7tMLCS6U/XczN+5a4mMZb
bhM7OmOdasfkvkc/AGP1wWAvniUAhkGlGB5X246fmaFubC1yaavD3Ch24C4vEF/xIGS9C
RlpeadDdoUJR9uvr8GgyPMsG573BLAqDsUnWFA9DjpMS5QaY8u64Nn4sl1gqbyb38EC29
M1OTvCfOYsM6u/c5JtUNAcrtlFzRdZ+DCO6N2ycR3z63H13qJ2exib8c1ZvZjGom4Hg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=fastmail.com header.i=@fastmail.com header.a=rsa-sha256 header.s=fm1 header.b=LxN6hY6k;
dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=y0H91X0E;
dmarc=pass header.from=fastmail.com;
spf=pass smtp.mailfrom=fastmail.com;
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 2780D606A33D;
Fri, 4 Dec 2026 20:35:40 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key, unprotected) header.d=fastmail.com header.i=@fastmail.com header.a=rsa-sha256 header.s=fm1 header.b=LxN6hY6k;
dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=y0H91X0E
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=202.12.124.148
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1796416534;
b=eiogbLFu92xEnjlS1nL1OBStI/LH+uvwZMecgf15qLBl87TwQSrvAJig4/CqLDHqbuED
3RzEAWqg8Z0gp3tFIi4OMgODhnRyjZiF47EUnNYBJzlsDoF/m+iHTiEXPv0njqOjRyCRm
prTwFsR/gu089ge1ZRxNk/CLDLBXIPMm8hKetBojXzIDUv9Us/T0DodLZE7b2mScFF7y0
uDxWrP6Y9gZwwLPfegIfa6KWQXE+xZoIBk5pfTTxj4+BIbo9GEFZUnMY0gte+w+rGTxY1
WK9ofDHm8tu7tEFyvx5aqMZ9bNXIsiviBT9poxCC57wt+shT3zypf4/cA6IllctKbcA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796416534;
h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature:
X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:Message-Instance:
X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:
Received:Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
Content-Type:Content-Disposition:Content-Transfer-Encoding:
In-Reply-To;
bh=k5h+tAMbd3u89wHMOkh5xreAlZ3zAJtalfdtyOBuwFs=;
b=HWf+BQSc9n9SlJsnMO4jcC12uIC0fUSFvOZbxlZQ0wMl8xxz0HwOB3OrV/ay5S4DxPg2
wHLf6dXIPCabmf0c9j8yiQZsFmypFtNM/Kl/hT1Lr/ZzOjyISUi0Cay3u9girXGCGmyeX
YV7X6xIec5rQHDB9Q9GVeqoQUHOxUdbGph1wFCSA1qWuMMfZIiyq4ExEcGoVcZ23iepKZ
i0k99oEuk+tyW7Cy6zYiERm6KjGPX3/bK3Dohd2OqdJslcpEElj3uZKlKXtL3dbKmwaiF
ekbqSLIW/o9M0xzsZ+kGyodGDD38SE4LScynpW6sOfCiKRJk8IJ7JRTxoUb08e/N/Aw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=fastmail.com;
spf=pass smtp.mailfrom=fastmail.com;
dkim=pass header.d=fastmail.com header.i=@fastmail.com header.a=rsa-sha256 header.s=fm1 header.b=LxN6hY6k;
dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=y0H91X0E;
arc=none smtp.remote-ip=202.12.124.148
X-Received: from fout-b5-smtp.messagingengine.com (fout-b5-smtp.messagingengine.com [202.12.124.148])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id A06B6606A32C
for <netdev@vger.kernel.org>; Fri, 4 Dec 2026 20:35:33 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A06B6606A32C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastmail.com
X-Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46])
by mailfout.stl.internal (Postfix) with ESMTP id EE7901D00123
for <netdev@vger.kernel.org>; Fri, 4 Dec 2026 15:35:32 -0500 (EST)
X-Received: from phl-frontend-03 ([10.202.2.162])
by phl-compute-06.internal (MEProxy); Fri, 04 Dec 2026 15:35:33 -0500
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h=
cc:cc:content-transfer-encoding:content-type:content-type:date
:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
:references:reply-to:subject:subject:to:to; s=fm1; t=1796416531;
x=1796502931; bh=k5h+tAMbd3u89wHMOkh5xreAlZ3zAJtalfdtyOBuwFs=; b=
LxN6hY6kY4SZcIoURUg+9CV21GU/t1O6mnECOLmLSShowcaER6nFjO+s9ls15gjT
XVhBdUkjwDHO2JGlvbSVDMRJlFrX71dpeFmmHzdriYMLyds8HNuQ8BqueyNBsOAg
tAezoV+I/u/izKD7j9Xy1xv8b/XOE3FHnKoQCjFfYpkwyvMbHuRSKBX8eB7yZ1uF
8xSmqFbObiJBfAe/HsuKv4hEYV6TBkWyycrDPKqocWI3VAnBO9VGZSU1lTI8DlWz
F9qKfAYppgwpiAS+zrEwS9omxnjlTBp37ZcRkVj9VDpH+R3dNZYqjaCw0iNqikSi
4/lBynqH+uLl0J0qb28Pig==
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
messagingengine.com; h=cc:cc:content-transfer-encoding
:content-type:content-type:date:date:feedback-id:feedback-id
:from:from:in-reply-to:in-reply-to:message-id:mime-version
:references:reply-to:subject:subject:to:to:x-me-proxy
:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1796416531; x=
1796502931; bh=k5h+tAMbd3u89wHMOkh5xreAlZ3zAJtalfdtyOBuwFs=; b=y
0H91X0E4YDMk/QIwKRtHcJ0pFyb9Gmv2LA84Txj2V0JmQVmC5qk8c8mXzZ1/Od5a
kbz828B02YX+guBqObBh1lZESunjhLON9pzbu8oevQydCkVT+hZjScv+POKxcZsn
m3/f19DGnpyHF4JeyHlnzSf10+wn0Fk2s57gAlCU27kGVz1hT0aePdA99FRwdPf3
MhczWixkPag2OCRPp747VD7QwsLonQV4HGsIUX5hz+Lra1ILRltwOr7jE7X9RtYN
1NdtefSJeDvlXRu8E7auttek+9GFRa9wwke0DdfppDH729HgLqCectSo4xldx8LJ
R7jgugA3n0sKA3oSIqHKg==
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09;
repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox;
action=sign d=fastmail.com a=rsa-sha256;
X-DKIM2-Signature: i=1; m=1; t=1796416531; d=fastmail.com;
mf=PGp1YW5sdUBmYXN0bWFpbC5jb20+;
rt=PG5ldGRldkB2Z2VyLmtlcm5lbC5vcmc+;
s=fm1:rsa-sha256:Akm5LNqXRUZoMlYuIcusUPtdL0SvO9LvLSxqAo0MAZly+NN
LnKEFPiLiZMRpC07UdmEh0sb23oXRY0Fnfb+cf/8wI4ez8DP5mrmkUgToILcaIPz
1nfuwNHkNxIVn/PU3X2KImTODdnkXYHtQEEf6sZsym8MaRXEzunEkAI762Enj3Du
X7dq0iKy6ORibKsz36WuKrLait9o83Iy2vFS4gzXirOm+rV5cZdmBPpLB8T9HqGv
Ox3xNuS5mHHfJV+DdP4FJGrfaLX6s+jHJh4RvR/9Xij0nfdpYnlGIhBAhtEUpnip
E8vqDB91sQaaKnOnoIZvj7bh2F6pcw6WTznJWkA==;
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09;
repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox;
action=mi-m=1; hc=13;
hn=cc,content-disposition,content-transfer-encoding,
content-type,date,feedback-id,from,in-reply-to,message-id,
mime-version,references,subject,to;
X-Message-Instance: m=1; h=sha256:fzMVG95A9Dqd+B08lgTaoNZrAHg5mAqNMbp2SncoRlk=:o+MwYD6LXLOM7KZiUES98bXq1yuOpK3qo4/lRbpoIDQ=;
X-ME-Sender: <xms:EiQTa01VivWYgPGpJLnCV1YPIyeJB5VxZO3SDYf7TszvEU2-yZAsUQ>
<xme:EiQTa1f-74-4jVoivd407_EI3WgnFAma6Ku82-m4_gfdlET0KawpU2e8SQoAYoao4
euAGM2TmQmgFIzJU1r81xyKUGS--qAjWyY1iAolNrj2SIDWKwbmFx4ZFA>
X-ME-Received: <xmr:EiQTa5KW1U63kqoYJTJKr0aFO6oJVuCFX_bceWGX4IhXVsxS4SM5QNds1lDqzZBtwnDhXb9rIYQQm0wY9GE>
X-ME-Proxy-Cause: dmFkZTEOW5Aj0TJx3AU+NVpawbNZ4BQdmjV35I5J3jjnEcxVTj7Le2nH73V4iyCDV0zK7C
WGobe2bEysTIZAbIhCdZx8KP3c3N9dQ/nUnmNMFRFnSAp9W01i3eeqZPwCW25ywvrytcns
bVcB0xuWnWO2sEsrni/Pcy1DzT7NzGGKIkFn3T+F1tCB3PjkqdUbPnfvSuWvF1txCK7ekK
+joNXZHoJ/HFlOhl258iKJsuQznPq7eaNiKPX0J/C7X6P94LcjK+1D3QYFMl3TRDKRFbeO
07bmMmvKnUyPLHC+3nfKH2zJdxnm0qgQ91DoxGtTKBJEyftmTDGR+pRYGN1mQ0R+BX3FJF
73HJ2NimnxHvsAHchqPpX0j1dLnVGoe6ypXMpfyHOFA5xcV6fX5bVFa3PoPBShxk7qdDw5
mjiwJBu2qPqdpHo/7GCUEQjuiCeZAeiyMPJtIix2npkGNHJHENTMk307qMbMRfeh4scVQY
dMnSIeNJGsc69Dhv2R3e6C0CfEoM84tLtqCRXIL/tWJhDNQA9G8mSjymflF3SDQH3Qu50e
FUi21jLG0hHCmyFVFyo29F+OXE/+/fjim8k/02/1/9hbxbIp+bmoQeXuiHFBSrkgjazM2v
BFNC0E3v7rbHCe1U4zzqeYQCxyyAWIHUkj8Av7Fsyq7/5TxAYtYQUEWQAi1w
X-ME-Proxy: <xmx:EiQTa7rnPUZdLgpOA1QbWoDzhTXh-mXHfPPDQlYIQogUB4xWtoD_Dw>
<xmx:EiQTa_vQ7gqafq6pwKucReOY9Lc7cR6M46UQN-JEkOKfboGuPjvdqg>
<xmx:EiQTa9LIfpZB-yVlfuAv0n487QXk7kRpTz43F5VltIHyUkk299ZYCw>
<xmx:EiQTa2oQ7rOFWKE0fAkjG6rxvPXFhq-7WIXAhVgKR_vHMj0wUoiRUw>
<xmx:EyQTa9cUQoqDlUdziyMRZ3EU8nHtqB3KJyvC6nZoffqOr5YxSJgccBjz>
X-Feedback-ID: i80b64ba7:Fastmail
X-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri,
4 Dec 2026 15:35:29 -0500 (EST)
X-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
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
X-In-Reply-To: <59325d7b-846e-4e5e-9c82-741f87523397@samsung.com>