πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26997

Re: [PATCH 2/3] dma-debug: skip irrelevant buckets for partial syncs

#26997
From: Marek Szyprowski
Date: Fri, 04 Dec 2026 15:16
30 lines
11055 bytes
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
Technical Details
Message-ID: <59325d7b-846e-4e5e-9c82-741f87523397@samsung.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-377434-linux-kernel-netdev=dewy.ru
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>

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-377434-linux-kernel-netdev=dewy.ru
From: m.szyprowski@samsung.com (Marek Szyprowski)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH 2/3] dma-debug: skip irrelevant buckets for partial
 syncs
Date: Fri, 4 Dec 2026 16:16:48 +0100
Organization: Usenet Network
Message-ID: <59325d7b-846e-4e5e-9c82-741f87523397@samsung.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>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2792779"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:wLBrbwWzFztorzquByiWWxxxFDo= sha256:I0PA9elsg7HEYc//U9SVLveIEQQUkOW6yC1qh4xhP4k=
	sha1:qSHy4v6r5xEOkgvHhf2KtnDQRLI= sha256:/5xjFdiLo2Jn3+spU5TXg0TauArSXxFN2B1SJunqpBo=
Content-Language: en-US
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 DE5A3117C46; Fri,  4 Dec 2026 18:17:28 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.44
X-Spam-Status: No, score=-3.44 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.142, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	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 (1024-bit key)
	header.d=samsung.com
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 AQhh-ScVy0Tt;
	Fri,  4 Dec 2026 18:17:25 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-377434-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=samsung.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id E175D117BFA; Fri,  4 Dec 2026 18:17:15 +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 6907B65795; Fri,  4 Dec 2026 15:17:14 +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=1796397434;
	b=mITS9Pzelg+xR0HGy0u67cKCBDmOc3lCyPLODbH6obP0hffQFUtgwN936btdMAeNi5+i
	 4Zb2RnMapKKtbAG6/MarXpiLgw2N1xvwKzJ6VHjHSmrWaDKswxpo3mCShKHLO/5jgx2bm
	 AZDQUgi7KercIyrYYWnMYKTxfb2FKBnXwxi6/gly367d8zi/LU02S0xVloxOl+EDL+1Cu
	 l6keMykj38KEknJJ+KWSSXuS94aKQPJP3yWyPZ7aLnUrsEfHU6e8DIBU45F6vUUFlPVRX
	 n7rfaFMF763HmFmDd0AdutEg3jMgdVbjSg4DlFtLNMksojwT5zr30EulRmLHSEdIcXw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796397434;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Filter:
	 DKIM-Signature:Received:Received:Message-ID:Date:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:User-Agent:Subject:To:Cc:
	 Content-Language:From:In-Reply-To:Content-Transfer-Encoding:
	 X-CMS-MailID:X-Msg-Generator:Content-Type:X-RootMTR:X-EPHeader:
	 X-CMS-RootMailID:References;
	bh=BVUbRcBQ4X66TTikOJIGKoXwJ92AZDbuZFAZqc64Zwg=;
	b=nBBB4034R9UVkEUKCz4biOv2prrI3+94Y8RZvMHGykMw+LaV7alp8Wr8GpJPGuwUBCSi
	 368bTj0sHOk7xGah33lIdZb0dXsK/ffzozjp42Bn9DYeNFRQC2WPtYtQG1ZC+dRYp8chb
	 qgB/4sle/cxWlIh4H3hTNRDzIk6cNhI3DCnxe4nc+Iug7yO0nB2bbZf0M9GIsLDzKR3Rg
	 jQZxMRzG/41UwQixfN1EhAknM3TYnRzTBsfaZ9x2a40ntWUAHHzAc6DFdJa32kK1D7kqV
	 y4+lVbhhyn0jYM/W5RSIu0YBsvNkEpO+Iqph66wy0Y99p3IH3r2xyGG3bFMzaZYChug==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=samsung.com header.i=@samsung.com header.a=rsa-sha256 header.s=mail20170921 header.b=jXsiL2UJ;
	dmarc=pass header.from=samsung.com;
	spf=pass smtp.mailfrom=samsung.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 419A6606A32F;
	Fri,  4 Dec 2026 15:17:14 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.a=rsa-sha256 header.s=mail20170921 header.b=jXsiL2UJ
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=210.118.77.12
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796397428;
	b=mU9xvGnoJEEy+oXGG3uZbAmiH93gxaiM+yHiqsNRoBwGdpLHeDyl71FJistEX1ebPaRF
	 L85U1PwYuiYolGnCLlonbQgqEOHbiNw2De7Hg3qUXMFaS4XCYPhvxw4p7Z8DTw2FYVjnY
	 JzG3k7Z7YJGV1jK+M4IGNZPYZ3J4S1PnLvMdUpOv3Zh5JyBkWoEYPbfE4TShp1Ox+9l8r
	 te8xWf01g79cnFEAtWFcFd+BNPIWe4Lton2TNSJQjy2mzQadpfmoek7krv0gYKvjp+Jdd
	 kKVgP3XxSwOwBT0g5+vdwnKtMtC/wzRXDge7j9s8Wzh/jc2TcHPwnmqrRVEZN32wRpw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796397428;
	h=DMARC-Filter:Received:DKIM-Filter:DKIM-Signature:Received:Received:
	 Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:
	 Content-Language:From:In-Reply-To:Content-Transfer-Encoding:
	 X-CMS-MailID:X-Msg-Generator:Content-Type:X-RootMTR:X-EPHeader:
	 X-CMS-RootMailID:References;
	bh=BVUbRcBQ4X66TTikOJIGKoXwJ92AZDbuZFAZqc64Zwg=;
	b=EPPaHcYzGrpDwvdwOXSLVQz8EN/JaOQ/kl2VHB2H0KxmoH6HeDBC0MVU9gjvprvEJIX0
	 bh28aPjOqyVen5sJV8G6jm5pTRzd4IN4zd/YszhBmcIDn8GDTWX+VEMxLmhHbvcRE0myE
	 JpnStpZBlsJGCCregIdoeABnpEfAPa9P1810+K0Es9HLZSXnSr8SvfD9q+GhCRhsxwiSz
	 DprRb6DUGgEhaIQOgfszNidQMRr/dVPA6azsjRYZi0sUO/RynsjphQAaDu2fVX49mRDaN
	 QPF0P4dff/FdTcdiQI3Txbz2cLLvSHuu/3QNH+jSW0oCYzuRBeWygOp38Y5Nd1bAf0g==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=samsung.com;
	spf=pass smtp.mailfrom=samsung.com;
	arc=none smtp.remote-ip=210.118.77.12
X-Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12])
	(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E0EC606A322
	for <netdev@vger.kernel.org>; Fri,  4 Dec 2026 15:16:57 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8E0EC606A322
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com
X-Received: from eucas1p2.samsung.com (unknown [182.198.249.207])
	by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20261204151650euoutp02acbb8c5c95aebb982c442b1884bdddbe~uFe1KqU8b3096130961euoutp02B
	for <netdev@vger.kernel.org>; Fri,  4 Dec 2026 15:16:50 +0000 (GMT)
X-DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20261204151650euoutp02acbb8c5c95aebb982c442b1884bdddbe~uFe1KqU8b3096130961euoutp02B
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com;
	s=mail20170921; t=1796397410;
	bh=BVUbRcBQ4X66TTikOJIGKoXwJ92AZDbuZFAZqc64Zwg=;
	h=Date:Subject:To:Cc:From:In-Reply-To:References:From;
	b=jXsiL2UJxnuZBp18GAK/UW0y0V//+aJCp1YoVXo+EpLvGS097u5iTq3yWP+DgSL6c
	 4Il4m4FqfkFyr3pt5KjTohzMsbnvOwbb/dgi36c5bJSTXsUFHW4RnOMR+isjITaf0o
	 gxD8LuCpSPTwnskv2vdybDhrIYETQgYsEsNDaEXk=
X-Received: from eusmtip2.samsung.com (unknown [203.254.199.222]) by
	eucas1p1.samsung.com (KnoxPortal) with ESMTPA id
	20261204151650eucas1p13d643d9f7317813896e0ef29683a54b7~uFe06gSXH0656406564eucas1p1b;
	Fri,  4 Dec 2026 15:16:49 +0000 (GMT)
X-Received: from [106.210.134.192] (unknown [106.210.134.192]) by
	eusmtip2.samsung.com (KnoxPortal) with ESMTPA id
	20261204151648eusmtip2d9b806f94220bd0679febfa5c7d594b6~uFez4IK_01762217622eusmtip2M;
	Fri,  4 Dec 2026 15:16:48 +0000 (GMT)
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-User-Agent: Betterbird (Windows)
X-Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org, iommu@lists.linux.dev
X-In-Reply-To: <41001cf2-6304-45ff-977f-ac1b66ecf559@arm.com>
X-CMS-MailID: 20261204151650eucas1p13d643d9f7317813896e0ef29683a54b7
X-Msg-Generator: CA
X-RootMTR: 20261203173915eucas1p1d54b3770b24cf04e25ef5ce565bbe100
X-EPHeader: CA
X-CMS-RootMailID: 20261203173915eucas1p1d54b3770b24cf04e25ef5ce565bbe100