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 0AE991B4223; Sun, 26 Jan 2025 14:50:24 +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=1737903024; cv=none; b=cOloMIceEV9uOLglLzc6mNe6XPwvby39uIZJTaanpBSCO24aS+EwdV1Wd9Jk2TOW8v1QKbSYxa9WvtD/nM/4r+UWftPCeN+/9A3L1K/mlyucFZBF68AcOPsOsKW9XdlPUkVinHK6t6RKLKU35dz5075UKk/qvdXAdb6TW/HBS8A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737903024; c=relaxed/simple; bh=YTJnhxnYDDoV5RjZ8CqISL67zB4gqGQgec2oce1dExs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PT0G5rgRMJoZWw1O9tAClrGjOKNlVzPBdmYYbzGZNu81TRlm7c4DZw3ZQI++dflSUI3UsVv1mH2OYsnOnnT4h3DrU/oYSxZ3pARPBt8AJWmvE4w4ADNT4yALUwVgVkWpHciI+QRAZk+rW1qeLiUXg2UxtC/9L5+Rsz0KALODmb8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uJcJfWAF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uJcJfWAF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6D56C4CEE6; Sun, 26 Jan 2025 14:50:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737903023; bh=YTJnhxnYDDoV5RjZ8CqISL67zB4gqGQgec2oce1dExs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uJcJfWAF349+dO62Y9WflpM6bXK4yI0Q7idoc8STH99EVLFRZUZ9iYKojpzgAz4AG ILflNDTEOk7xm/2DeNkSuG5OrV+Uc3eXelahzxG4+93AZ3NBrRxAfr0PC9/IrZZQ6P 2GznZ7EIi3wh3ir9IOUh/XZ8VpAzi+fxtV2diZ71LPvHaoazq38IhqM5cFCJpWOZUg 3PddT4PJmYIgURfTst5Ntsn6ivdpNLOGEVpUmFWuFwuvpLATNF0ekDlh00Hy9KfSMX +UVrnmx7oz10NUTPCg367tP3kkcJCHapnv/6HLydFxg7nXrVHhQvLBzOeHtKES0Jpl nx4bulI98VinQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Carlos Llamas , "J . R . Okajima" , Peter Zijlstra , Boqun Feng , Ingo Molnar , Waiman Long , Will Deacon , Sasha Levin Subject: [PATCH AUTOSEL 6.13 6/7] lockdep: Fix upper limit for LOCKDEP_*_BITS configs Date: Sun, 26 Jan 2025 09:50:09 -0500 Message-Id: <20250126145011.925720-6-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250126145011.925720-1-sashal@kernel.org> References: <20250126145011.925720-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.13 Content-Transfer-Encoding: 8bit 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 f3d7237058793..bc725add84f46 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1504,7 +1504,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. @@ -1520,7 +1520,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. @@ -1528,7 +1528,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 STACK_TRACE_HASH_SIZE. @@ -1536,7 +1536,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