From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=202.12.124.148 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796416534; b=n8ozjSXsvFO2mijpDqvtKRMi1IePpmCWDnnSdEOyvOzyjBDW5cBv1bTQYf9e5hb899El cOADU318JGz+qVyBt1piD8cj01n17iICHaTyW6H2N/EI5Ci4ZwLLQ7PrUp6n8jVFlyCyB FEaGnG2ZejOJLtNktN1gAXkM6hxAHYcTpzktlc447ZP2RD3egIJXYaawQn9Zsf/AmJX8z ScgtMTw6hcDoXoAdiIqKiNy150qCh1jn2I8jx9UC6Gwia3xDTgmo5CHwhu3httQg3YnW2 XSopn3Q5JH5R2iZerNW0lOnmTOyLPA4SuFhi4qWRwhzmT1JkDAGbHa/PoxFO1JWoXcQ== 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=B/6dg5PGPatNTlnYGmc5FA4plfCAzIzQSVLDyt+mZHwRoGixT5UqZJ/AyD+8YvoACdS9 R4cEkbISPfWhpMnTjVivz2dU3TZw3MDxmhBuh6BRUKDFJ2e4F4B6MBKA0ZPB9b77FG+9f aHl/CZJ3VIlcEaa7QygWu3FQpttJPDljNGPNeAOY7A5Eyy0JWqObTPl230wZSy+URRp+Q J8XtW56BzCW74m1b3Lai6TDiFHCWCHpNNZpMXTZJhIY1L5ZjKukK8AiCJXZ0pJmnzmiyH C74YMIVgXUzgyH426l2k/N4S9rl3HqyGs+KuBBH572+YEOT/cVIcZwbwbgflhXkklxQ== 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 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 A0695606A322 for ; Fri, 4 Dec 2026 20:35:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A0695606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastmail.com 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 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id 1F9A41D0010B for ; Fri, 4 Dec 2026 15:35:33 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Fri, 04 Dec 2026 15:35:33 -0500 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== 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; DKIM2-Signature: i=1; m=1; t=1796416531; d=fastmail.com; mf=PGp1YW5sdUBmYXN0bWFpbC5jb20+; rt=PGxpbnV4LWtzZWxmdGVzdEB2Z2VyLmtlcm5lbC5vcmc+; s=fm1:rsa-sha256:XWyQbCV/ZQtDz5Xw4m48tmdD5rRZ6gZMCNmRvgBp/IV/V5T L18TkRCocKL+n9BzBpulPjbPLZReoAnS/xakJdIoVKGiZkBmIQ7bkhlGzuVeVMNr mM31yR6zHCfX4lhKeRY/FHj/rK0n8fMny0O1HhsDizjkzZZSUUSM1U53dAVv0QaX Zb8SW4EiuHDzNwG/+Q1xx55xKwezsSXHKiQYi6CklCYwGPOUs32w0ig4jAtSoQM7 WkYCbOa5SbwxwLxJGUxZALzVvbs8kz4uN/uxwO66eT+t0Twd0DeQQiRnkt4DBF8b Rwp7rUIYLxwRTruhB8XYNqKUoSKpZpSEwR1OqoA==; 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; Message-Instance: m=1; h=sha256:fzMVG95A9Dqd+B08lgTaoNZrAHg5mAqNMbp2SncoRlk=:o+MwYD6LXLOM7KZiUES98bXq1yuOpK3qo4/lRbpoIDQ=; X-ME-Sender: X-ME-Received: 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: Feedback-ID: i80b64ba7:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 4 Dec 2026 15:35:29 -0500 (EST) Date: Fri, 4 Dec 2026 12:35:29 -0800 From: Juanlu Herrero To: Marek Szyprowski Cc: Robin Murphy , Andrew Lunn , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Shuah Khan , Eric Dumazet , 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 Message-ID: References: <20261110-zcrx-dma-debug-registration-v1-0-48743ea61631@fastmail.com> <20261110-zcrx-dma-debug-registration-v1-2-48743ea61631@fastmail.com> <41001cf2-6304-45ff-977f-ac1b66ecf559@arm.com> <59325d7b-846e-4e5e-9c82-741f87523397@samsung.com> X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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