From patchwork Thu Aug 22 19:13:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13776867 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 7BC8EC5320E for ; Sun, 25 Aug 2024 18:31:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 069658D0028; Sun, 25 Aug 2024 14:31:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 01B3B8D0022; Sun, 25 Aug 2024 14:31:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B635C8D0029; Sun, 25 Aug 2024 14:31:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 782BF8D0029 for ; Sun, 25 Aug 2024 14:31:49 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 2AF2AC07A3 for ; Sun, 25 Aug 2024 18:31:49 +0000 (UTC) X-FDA: 82491611538.18.B7881FF Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf28.hostedemail.com (Postfix) with ESMTP id 78954C000D for ; Sun, 25 Aug 2024 18:31:47 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="HCX26eM/"; spf=pass (imf28.hostedemail.com: domain of broonie@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=broonie@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724610664; a=rsa-sha256; cv=none; b=TZjSR7TvfGRF0iitfqhOh+n2aE/9WKXLraVn+2ifTVn0nCsxWjM+3KLrOcGs8KGMxz97gN TyYA+owM0xWB1UPtMJvUrUvbZKwwYAYwe0RQcsUfdXwcO0Zr5Zt0HI/5o4k+r1UlhhQz4x Wh9q9Qdc77dRRjsJTeOr2BD9BGCuvv4= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="HCX26eM/"; spf=pass (imf28.hostedemail.com: domain of broonie@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=broonie@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724610664; 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: references:dkim-signature; bh=tsL1xGTlShHhY3B2aJjvDL5B3AijVBWOM5HpvUybWWQ=; b=6QLlfzagtwOYlw/WilkjvGhMd+120fY1S6/acO+jotID8tf152Omc2DnzWpR3wE27oZlkl htwmjoi1Hmf3Zdk7BFvvdOPSlY9Soj0T3dyf33KAyvbpqgkKVxKuhHuePq670AJpnEebDc yCsJdinhqyxqh4LeW1HC9mZyER4kh7w= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 8EE95A4136B; Thu, 22 Aug 2024 19:15:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55D8BC32782; Thu, 22 Aug 2024 19:15:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724354139; bh=iHV8J9Zsq73NG/UgN8gpCP+unnbp42Lw8cYPkBOeKyg=; h=From:Subject:Date:To:Cc:From; b=HCX26eM/OW9tFCJGQczIpkiPMY3yQxmKP9lecHNTjvMev/4t9wvCmdOOLHaP5rjJ4 gY38s7N2q99XOo4OZcRNvOg+38c5/RlDlpxaUm4Eu4naPnh64Ff1yik+4MHM47hdkx cLDyestAcG77huKvhRWhIzwsZnVbYqJ2Hz1ClwyBl7hfrw+cHEBwV2IVv2Drl55eC9 H+alzwxs/XKiNURcHqEOYdAwnRwRG15qOG2lEcx7kLSL10V1/05EqpD/b7QKqv45Mn zWYqTSecsnMuUdCDwblaH4j5sI9dTXIcQhVOM+5mcXU75fja7u+O8i0M+F+MFjcgp6 bBVAMmkpf6Zzw== From: Mark Brown Subject: [PATCH 0/5] regmap: Improve lock handling with maple tree Date: Thu, 22 Aug 2024 20:13:34 +0100 Message-Id: <20240822-b4-regmap-maple-nolock-v1-0-d5e6dbae3396@kernel.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAN6Nx2YC/x2MQQqAMAwEvyI5G2hKD+JXxIPaWIO1lRZEEP9u8 DCHYdh9oHIRrtA3DxS+pEpOKtQ2sGxTCozi1cEa60xHDmeHhcMxnahExpRjXnYk0uytN94R6Pg svMr9Hw/j+37JUZkqaAAAAA== 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=1391; i=broonie@kernel.org; h=from:subject:message-id; bh=iHV8J9Zsq73NG/UgN8gpCP+unnbp42Lw8cYPkBOeKyg=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBmx45VKWNSD4iZpnAfqdbBrTIOLwI1wRoaeLLbq +twGrzL8FKJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZseOVQAKCRAk1otyXVSH 0Mz2B/9XOF/nJGdxDZPnJSRLE3shPds8kL5j8u8s+wPVjfkPkupRUKaALUZeO1AjkGugzqENUUw RESzItsSCVHT9qU11EgxBTMkztAKynrVKwISpIon5ohoe2rUaglYXu85V2+C/osphUz9fsWnHiY 5rWGH4QAjl4Iju55ehIQKJHP6kMNDdG/dRM1rCvYffOYbGhXcaN1e7CgVv3byruBvf3707JZYsb m8Fqaa//fSJ8tJhPuMYqw587uKKvIdBgV0yAWsA+J8EhLqoPWlj7aq3aJVXpBASMIj1RqxHNGf7 CqE4/aSqbiRos6BtWVwuOSOlynb2Mbh790XLcLOXWURhZb1d X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Stat-Signature: 943358f5kuhr7c1qyih9jpza4rtxw564 X-Rspamd-Queue-Id: 78954C000D X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1724610707-793726 X-HE-Meta: U2FsdGVkX1/zLU5HJdQ55mbUh1L8cixnZJ7w1giERvacNnb/znnY1xQXDaWgIG5lGNCpkVyFejRcHfI3WqfeHb+reGb4p/3dChwd9tgqdKWGAQXhF84QkSL0xFzCIJPJwAd4Ee+vFTBlcIUfJIh4N8qj3YUC7rjV5iFRaHwxWxtx8scdH8+0ey5tRQBer4RXl1ZHNVLlCm3Qkz4GNgeVjDPdOOXJDiPil+ymkbKir0f2QST+FZilOXbJNIwzc/o6wf0DjKBIR8/yCxbBl8et1rrRCg/Cvi12H4AFhGjf6zt/CEQx/prvq7uB13yFAbbi1V0lxUijaXvXxWpsp3qRIigs5WHOvYrAFYTv9py4VdggQJJWOSEDF1nRQiF6RTicRHMM7dopOFY914vWhhpOMDtC5PtvKNk5n3bDHMUBLCSqvN6IeUTMlqeKWvFE1YxJIb26ptKE8VnqVkjji98RK+XUQZy22wrPmgiVt4if0wSNo4iwHmgk0TtgsIFU8dOcDPE/xJenRw1/Szhn3NoifrA+K6GL2QlBSXSxbgJ/z/ric5l8iMDWVcLSEY2nlfMWG4elu41f2qqz/MN5k/yiAoZj6jRsdnyC8m01AwQaO2WzWhkO8ertc47AhYrxkuNZRPqBNxOD3n524jFzL/np2lXcCFnzPrNdd9t4Kbmf2LCMICsSc+xHyd/gY6lMeB+1C7RLqAenpuf/bIh1pDAHrLZCNRhS8GbQYKoJdUTNAscpSg9I5Ua5nSR/n3m3VUe/FKSGI/QicKpp/pFHTl0Vjqrd9Hp1pz2+XcMny9QPVwcE3B6TQgjwHl5MrnLbfcAQ3eTWuM2W+OhiGAQfTIruKlpBJRxshbLuA4t40OPhu52gIkLco/TZqOaHv8U0u5692wd6cYstQrMy89X2WwwBKm7NMm6ztVPbIjJdO+A++aVR10jizwEowuaZ+Y3v1UQb0DssRb7ijUfw/Lhr/cN 2dRbYHyR /0se4mBjfWcQ98zXLnvWe80pZmknTmWPeTUQYpVYM+4TyjHeZHuHD3zDDeRF2ULcIDkGrmxWBjHTtkwirR6HxfIYTMaKyXf1oOUquT9zNPX5gxTNmJAo/XJ43ige6cvTZ6DFRakuWi43VetUkOFhwPpFjaZgsnuZ+ROYICKMf+HXBQheK/grbc8eaef3B6WKJDkGOXO3ZZhFw5e8bCZvrLwDbtsG5Tt/MjbfW+1EM6zZvgJEjCSYQULfx8ITKFJfFZgw0f9XEYaCIa+flvPZJ/bIH24fARkFQwVyJ 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: The lockdep asserts in the maple tree code and the double locking that we're doing continue to cause issues, most recently some warnings reported by Cristian Ciocaltea due to dynamic cache allocations in interrupt context (which are an issue in themselves, but still). Let's start trying to improve the situation by configuring the regmap lock as an external lock for maple tree, allowing it to do it's asserts without having a separate lock. Signed-off-by: Mark Brown --- Mark Brown (5): maple_tree: Allow external locks to be configured with their map regmap: Hold the regmap lock when allocating and freeing the cache regmap: Use locking during kunit tests regmap: Wrap maple tree locking regmap: Don't double lock maple cache when using a regmap provided lock drivers/base/regmap/internal.h | 12 +++++++++++ drivers/base/regmap/regcache-maple.c | 41 +++++++++++++++++++++++++++--------- drivers/base/regmap/regcache.c | 4 ++++ drivers/base/regmap/regmap-kunit.c | 2 -- drivers/base/regmap/regmap.c | 5 +++++ include/linux/maple_tree.h | 3 +++ 6 files changed, 55 insertions(+), 12 deletions(-) --- base-commit: 7c626ce4bae1ac14f60076d00eafe71af30450ba change-id: 20240814-b4-regmap-maple-nolock-11408d2d0d41 Best regards,