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=eiogbLFu92xEnjlS1nL1OBStI/LH+uvwZMecgf15qLBl87TwQSrvAJig4/CqLDHqbuED 3RzEAWqg8Z0gp3tFIi4OMgODhnRyjZiF47EUnNYBJzlsDoF/m+iHTiEXPv0njqOjRyCRm prTwFsR/gu089ge1ZRxNk/CLDLBXIPMm8hKetBojXzIDUv9Us/T0DodLZE7b2mScFF7y0 uDxWrP6Y9gZwwLPfegIfa6KWQXE+xZoIBk5pfTTxj4+BIbo9GEFZUnMY0gte+w+rGTxY1 WK9ofDHm8tu7tEFyvx5aqMZ9bNXIsiviBT9poxCC57wt+shT3zypf4/cA6IllctKbcA== 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== 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 A06B6606A32C for ; Fri, 4 Dec 2026 20:35:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A06B6606A32C 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 EE7901D00123 for ; Fri, 4 Dec 2026 15:35:32 -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=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; 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: netdev@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