From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 4645D22AE7C; Mon, 10 Mar 2025 17:53:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741629181; cv=none; b=gNH5w0xGWwh48+nwTy/aR4rwhxDdPotylS1Z0pe1uPuZonzlIR9Pz2NIhEb5HTtxvILB2U9g5Gfy1SZyd80sicAjj29RBslAu0JkiMeAfT391zIWhHjS9FCtXWABT0HU8cTLgKhixkLsufo/xl6Y0Q7TZfLcYz0fXHNllFZrygE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741629181; c=relaxed/simple; bh=NnKygoMKaIvmKXUpZvc9uPwxJPP9upH+VZOasxY0lk0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SGALDkPKnvxjyAMSdLQtZrWcr+qSYt3W7eVHiv35ayabuxbbFyt+HHuW7ld59COS74l07VgQUO1IVWJ9sFfdZ4fXMSuM/N7Eb4/vfHjtIgbwpQvGTNZYYfTZF/KGJpseW340ZP1MGrz+bPdPfGPWm6tSuvT1GOZ7g4QXnEH3BvA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CTjipHAI; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="CTjipHAI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C187FC4CEE5; Mon, 10 Mar 2025 17:53:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1741629181; bh=NnKygoMKaIvmKXUpZvc9uPwxJPP9upH+VZOasxY0lk0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CTjipHAINOe6B8x+iT09wmtKaKGOFsiy2Rssiyp9tewg5rNM6JawUqPIRLU4OaPFJ UWZYA+UGXOaAwVTWVfi20mbaJLtp93yoH5NC1sMdZpg9ym0s8vM5/rfNFtNlyr0FkG gTnRxsaJ0HiZWuFsSlbUCdwWUb5W0tG5BJ8nI2kU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "J. R. Okajima" , Peter Zijlstra , Boqun Feng , Ingo Molnar , Waiman Long , Will Deacon , Carlos Llamas , Sasha Levin Subject: [PATCH 5.15 205/620] lockdep: Fix upper limit for LOCKDEP_*_BITS configs Date: Mon, 10 Mar 2025 18:00:51 +0100 Message-ID: <20250310170553.719834581@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250310170545.553361750@linuxfoundation.org> References: <20250310170545.553361750@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Carlos Llamas [ Upstream commit e638072e61726cae363d48812815197a2a0e097f ] Lockdep has a set of configs used to determine the size of the static arrays that it uses. However, the upper limit that was initially setup for these configs is too high (30 bit shift). This equates to several GiB of static memory for individual symbols. Using such high values leads to linker errors: $ make defconfig $ ./scripts/config -e PROVE_LOCKING --set-val LOCKDEP_BITS 30 $ make olddefconfig all [...] ld: kernel image bigger than KERNEL_IMAGE_SIZE ld: section .bss VMA wraps around address space Adjust the upper limits to the maximum values that avoid these issues. The need for anything more, likely points to a problem elsewhere. Note that LOCKDEP_CHAINS_BITS was intentionally left out as its upper limit had a different symptom and has already been fixed [1]. Reported-by: J. R. Okajima Closes: https://lore.kernel.org/all/30795.1620913191@jrobl/ [1] Cc: Peter Zijlstra Cc: Boqun Feng Cc: Ingo Molnar Cc: Waiman Long Cc: Will Deacon Acked-by: Waiman Long Signed-off-by: Carlos Llamas Signed-off-by: Boqun Feng Link: https://lore.kernel.org/r/20241024183631.643450-2-cmllamas@google.com Signed-off-by: Sasha Levin --- lib/Kconfig.debug | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 2025b624fbb67..db4f8ac489d41 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1408,7 +1408,7 @@ config LOCKDEP_SMALL config LOCKDEP_BITS int "Bitsize for MAX_LOCKDEP_ENTRIES" depends on LOCKDEP && !LOCKDEP_SMALL - range 10 30 + range 10 24 default 15 help Try increasing this value if you hit "BUG: MAX_LOCKDEP_ENTRIES too low!" message. @@ -1424,7 +1424,7 @@ config LOCKDEP_CHAINS_BITS config LOCKDEP_STACK_TRACE_BITS int "Bitsize for MAX_STACK_TRACE_ENTRIES" depends on LOCKDEP && !LOCKDEP_SMALL - range 10 30 + range 10 26 default 19 help Try increasing this value if you hit "BUG: MAX_STACK_TRACE_ENTRIES too low!" message. @@ -1432,7 +1432,7 @@ config LOCKDEP_STACK_TRACE_BITS config LOCKDEP_STACK_TRACE_HASH_BITS int "Bitsize for STACK_TRACE_HASH_SIZE" depends on LOCKDEP && !LOCKDEP_SMALL - range 10 30 + range 10 26 default 14 help Try increasing this value if you need large MAX_STACK_TRACE_ENTRIES. @@ -1440,7 +1440,7 @@ config LOCKDEP_STACK_TRACE_HASH_BITS config LOCKDEP_CIRCULAR_QUEUE_BITS int "Bitsize for elements in circular_queue struct" depends on LOCKDEP - range 10 30 + range 10 26 default 12 help Try increasing this value if you hit "lockdep bfs error:-1" warning due to __cq_enqueue() failure. -- 2.39.5