From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E90E741B8CA for ; Thu, 30 Jul 2026 11:48:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785412120; cv=none; b=nbNFCK8ql+DLxH9Jt5tq0H1Lf2n1LnVUU/z+n4uZl3Yy3Z0+LnR0jQOr9Mt+hb3CQJkeZ2/rmN7A1Q7UnDuSM3b/9p4mLRz08IYl9sJa8uSUF2OAdoZ2h0MZ6NHGAAMEjow874snYTTS65PavdS+bNpJ6j4bieWreqRqdkUNrkc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785412120; c=relaxed/simple; bh=VAbn9XHg0fwc/51aur+HTIDorepaV049AR1abOeJ83w=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=AnPHearey4NhGEh9dKKHS9AA4L/BzGPwCzOMS0sMph1QGXgkFcFthCoeB12YbM7SDx5x4Js5cJZFHplEBk5e5912nBFWuTT0c+tE9/ZW2RUBTB3thfW9U3FVV4UJvEDWjYlD/sfytkykAueziHmIWpVGyoLH6G6PpL429B/E6hI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KKR4hC0h; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KKR4hC0h" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B66A1F000E9; Thu, 30 Jul 2026 11:48:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785412119; bh=XmU45OCNuFOiwGfrBinV6WwQ/rNggasBHJ+eyOZDXdo=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=KKR4hC0hisUM68EidQUezR8zfwNy0414zRBBLqO65Nl+SsArL+flSO5eWsVfIE24o AfQQNHa8nvQ8Ri2p8ghrcZ86orQfPeVsaquEYI1xm2CjqTrS20K4EaLnyLcsjs25Si ZQw1C7ANRR92SQPXctO2KqWJn8WCnWNLp77U3sUr18v36L1X6JvXKboeYtNJ1IPo6h caQ8FAjONcV87XXUOa1zCIiGRQpzpxm/uEb1aiRQ95h1HEb+tC9YrFxX5QOHKApn44 gEuifJKyeNAmxwe2LQJcCo+KD7XF5DbGRKwao4yLlKXTDPVm37hmehQpfQbgtEoyfo +DGmTfWAh/G3w== From: Pratyush Yadav To: Mike Rapoport Cc: Pratyush Yadav , Pasha Tatashin , Alexander Graf , Muchun Song , Oscar Salvador , David Hildenbrand , Andrew Morton , Jason Miu , Jork Loeser , kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 18/22] kho: extend scratch In-Reply-To: <178540063445.2151126.14089645580528118019.b4-review@b4> (Mike Rapoport's message of "Thu, 30 Jul 2026 11:37:14 +0300") References: <20260729145610.2827231-1-pratyush@kernel.org> <20260729145610.2827231-19-pratyush@kernel.org> <178540063445.2151126.14089645580528118019.b4-review@b4> Date: Thu, 30 Jul 2026 13:48:36 +0200 Message-ID: <2vxzqzkk7l63.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Thu, Jul 30 2026, Mike Rapoport wrote: >> +static void __init kho_extend_scratch(void) >> +{ >> + const struct kho_radix_walk_cb kho_cb = { >> + .leaf = kho_ext_walk_leaf, >> + .node = kho_ext_walk_node, >> + }; >> + const struct kho_radix_walk_cb ext_cb = { >> + .leaf = kho_ext_mark_scratch, >> + }; >> + struct kho_radix_tree radix; >> + phys_addr_t prev_end = 0; >> + int err = 0; >> + >> + err = kho_radix_init_tree(&radix, NULL); >> + if (err) >> + goto print; >> + >> + /* Walk the KHO radix tree to find busy blocks. */ >> + err = kho_radix_walk_tree(&kho_in.radix_tree, &kho_cb, &radix); > > sashiko: Will this trigger a lockdep recursive locking warning? > > I think it will. It does indeed, but that's a false positive. These are different trees and so they have different mutexes. So I ignored this when sending the v5. But now that you also point it out, I went and did some digging. And I think I know how to fix this. Setting a different lockdep class for the local tree makes the warning go away. And from my sampling of other users of lockdep_set_class(), this does seem to be right right usage of the API, though I can't find much documentation on it. While trying to explain in a comment why this is needed, I also realized "radix" is not a descriptive name at all, and I renamed it to "busy_blocks". I'll send a v6 shortly with these changes. -- Regards, Pratyush Yadav