From patchwork Thu Aug 22 19:13:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13774107 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B15BC52D7C for ; Thu, 22 Aug 2024 19:15:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B68086B0291; Thu, 22 Aug 2024 15:15:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AEF5C6B0296; Thu, 22 Aug 2024 15:15:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 96A876B0293; Thu, 22 Aug 2024 15:15:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 6FBC780049 for ; Thu, 22 Aug 2024 15:15:49 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id D8B2616193E for ; Thu, 22 Aug 2024 19:15:48 +0000 (UTC) X-FDA: 82480835976.18.F87CF53 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf11.hostedemail.com (Postfix) with ESMTP id A7E2640021 for ; Thu, 22 Aug 2024 19:15:45 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=kPW2vXZ6; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf11.hostedemail.com: domain of broonie@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=broonie@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724354055; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=cGETG2RaQVscMgcFw3YXYL/FYRARYQdM9V5nkXie6Ec=; b=DfPDkSMH2EXv9xC3E2MRsnPnb2KkLuNgU4vcJKqCTdwipPAjVNcNBFEqRG5PcDf1e6LV0b cc8D3YdvIoZcW+cyjcNNQFzQ5J68gigO+dEVDhMgWg6jw+eS0z3sb1AYHOAoBaAovwzuFu 6Ycgz1Gr/5d0/LShDYmkgdMmRUQnPIQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724354055; a=rsa-sha256; cv=none; b=Hpg/3rRWK6r34v4oXQWT+jiuQNrT3OtsOD3cswa+SuGSeXvAvBIwYJfodk/vgxDAciAxjF XN+q0Kdduay7eYc9g/2Us05LUHwLtHPC94l7/WYx4i+McSxNWH1xgnnJNvLGwf0WlWcKc0 mvEaVHx3JRVr3Rrne4WPWQ1s/yBLFWc= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=kPW2vXZ6; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf11.hostedemail.com: domain of broonie@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=broonie@kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 5A5E2CE1044; Thu, 22 Aug 2024 19:15:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A8F0C4AF0B; Thu, 22 Aug 2024 19:15:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724354141; bh=Gqu8IKz5ZDmSH1qLlC/PQjAsOLa/MoeoFtoKJgAk1OU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=kPW2vXZ6T4WX6SqcSVvQ87sShPfOSoI3xRmeRX74DLMs9qD3/ERN716bUlNvLJbLr keuF0jio2tPcQXDawasMd4lbqUVeiojs2KnNGabvua3cBVUH89haltHTNbBamjRnms rx6sCuG0bGgV2774klnzMYZ1H6LhEgI1RBvRxVUzR15XOmAn0/vnPRXabJCcyvWqwz gPl1bix1AkeNi8qPG/yQIZxnw1rkRSPprIaXrklH8n+rLYbrSKWh0u00P1N4xtzZlN symNkSXDWJ0bWyVo5H1AxcxrTKW7fInileEOZ9eVq8l8ZHlpyoD4fHirU08zLT6s2L SCKB7rYyHT4Vg== From: Mark Brown Date: Thu, 22 Aug 2024 20:13:35 +0100 Subject: [PATCH 1/5] maple_tree: Allow external locks to be configured with their map MIME-Version: 1.0 Message-Id: <20240822-b4-regmap-maple-nolock-v1-1-d5e6dbae3396@kernel.org> References: <20240822-b4-regmap-maple-nolock-v1-0-d5e6dbae3396@kernel.org> In-Reply-To: <20240822-b4-regmap-maple-nolock-v1-0-d5e6dbae3396@kernel.org> To: "Liam R. Howlett" Cc: Cristian Ciocaltea , maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mark Brown X-Mailer: b4 0.15-dev-37811 X-Developer-Signature: v=1; a=openpgp-sha256; l=1230; i=broonie@kernel.org; h=from:subject:message-id; bh=Gqu8IKz5ZDmSH1qLlC/PQjAsOLa/MoeoFtoKJgAk1OU=; b=owGbwMvMwMWocq27KDak/QLjabUkhrTjfWFP1/QxPVx18BDrR8NLM3vXH4uPO2je4NJyyy9G1 9nlG7tEJ6MRCwMjF4OsmCLL2mcZq9LDJbbOfzT/FcwgViaQKQxcnAIwkXvK7J/ZbVd+TOs9tNrn NYuW9dq1MxNdTXtOagm7KpxbXsdbK3ju2pKreZsUWSVjitr/hWlPsQ+2XPS5iSuz3uBasud3c9l 1D60lzV9/2mWzTETFxnnR1lU1Yt+s0iNjuPdE8G04WqI+4ZhmxW62HzLrZe/7RV2yYqy4V/Cg/K W9/88TGvy9mkd+qQvwRu7pKC1k6rtTva0iPdV7w1mHn5NOyk6NTlbpnRbgIX7FN1hQgo+TU+aqy calQrVf2ebdWyqr0nBrYQQXT8MWj2kG7ofXWXwpkOw4xec/R3PXPLZAhS38bDKBhQVPf9Qmsp7l 01WYIO46PU9jp9rZ4lIWjxfOHQs6KhhV9VTuCMw6dRgA X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: A7E2640021 X-Stat-Signature: 5m7iueugb957196bcc6phkk3ox4p5p49 X-Rspam-User: X-HE-Tag: 1724354145-183086 X-HE-Meta: U2FsdGVkX1+4F3YXjK4YRQsAeZg+GfK4ZgS7Nl9wp7BbCJ0+VPYFDyhcNprbi/m1tRxo0BTNiJhWbaDNxgikWKIG2Ol29dD/YiH5CTmnHockXEndqTjy9/TNFOqqQaQUopgcLsWgvKY1eNrvciYRZ+hY2gwTX5GItbAT5HwwsrRWEXgWGY83scJmI9wLGhSM3i+CiU+WG5Oq/ajFoGNvreB80iforiEyioBa/APBme81/h25MWwdZ2fG7p21D7FRlHrzKRa3k47t1L8MKrdnrZolgjEwCfDnCuQgyzOpM0om8bGWHM5EIQG5k9Fw9yprM0ffMa4r+KUdCBxrTPLxv99ZNpDLfVikeExyNfsPotQjvFXlfdf0m7OnRpBM6ut9mqpcCjPCXTrwOi6X6S4Pb+JIzQT3K1/wTHiuDRQc9kwUl4qoGaBCcGC/gutvdtVzV1u5VXcNOGOOs42AcsuqRyMKH7g8LRmpQRhs8fXjsgf5Qb7yMuslUA69yzQMTFsHsEGTM1LOJM2IGg5WaEid/EGjo5wDFsFYEPJSDCROY6QwMOxIECwHTtBOISFrbTYHRjyDmtETzYJ8eHtARN7d5t/BSp01+M4QnNjUf/4VaxkrdZVzjidXc1nI0NG6kE0hDNJcoVicaBi2w30auSAwktKuhnLOqs7A0KYakmAEDWYqRU8ytL/141TICPfMrIm8toB5KpqL5lYa7VQx9RSg4NH9X6eaexWkqUCujYlqXK/uomOP5XEapHkZ9dHqwvKXmZyY/sIJIkYyesQ/XQPPlchi0vQorBCw99KTA1xQoAVMyKe16MemGHvowGSx9eB5mgZSOb/xMwI6qWY0BaD5D5L95TW7lMKJyDDMh435AwfMKQWclJs45DRR8ox5lSQNtajtJvQTWXX+KYX+q4xukkb0LVM45O271vJn4Gkdl4m1YyxvhXzWQOx2AfGdG8rmc3NcE5w5nBfqZ8AZb+u ObFHhq5V ynv+kN44TUleQT2UPdEppyMQMzf+hmV8tFDP5nz3EkxO4C+K1TEqkL/FJ8Rh6MO4ErMQPvHbSKJvhPHi5eaaWLjzsUWnU5TBXoN4wvGcvmZyZW1Vux8QhCV4ulTaWnHsWpjxQxxmy+zonb3c0tPi+SyHK0ggKg7WadP0iEHig7tA4xUhFM/C9i3SyycUo+sYioA3yPn7+OZqi3D5cl55d91/wTsIPfgum+3YdeHVo1164RCtQtMwa3B2FAUqmJmwqu6Y1IF229MABl7Mf9qXiwE0H3IB+S0T3cIA/ZQLy6/QfNeY= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Currently the maple tree code allows external locks to be configured by passing the lock itself. This is generally helpful and convenient but is not ideal for situations like the regmap maple tree cache where we support configurable locking at the regmap level and don't have the lock type when we are configuring the maple tree. Add a helper that allows us to pass the dep map directly to help with these situations. Since such code is already peering at the lockdep internals enough to be looking at the map no stub is provided. Signed-off-by: Mark Brown --- include/linux/maple_tree.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index a53ad4dabd7e..bdc6b133abdc 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -193,6 +193,9 @@ typedef struct lockdep_map *lockdep_map_p; #define mt_set_external_lock(mt, lock) \ (mt)->ma_external_lock = &(lock)->dep_map +#define mt_set_external_lock_dep_map(mt, dep_map) \ + (mt)->ma_external_lock = dep_map + #define mt_on_stack(mt) (mt).ma_external_lock = NULL #else typedef struct { /* nothing */ } lockdep_map_p;