From nobody Mon Apr 6 19:59:14 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 2C33A374E79; Wed, 18 Mar 2026 08:02:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773820975; cv=none; b=UvuwoJy5YIBtZFIsMyFWJ02HfEEa34CAt5EuoA6xF4+BF8j+127xdaJ6tdc032/8vRXeS7NnIW5WUmjv2XaYwNkT+Nc+OV6j1cBp6q0HY0xpIv5zF/pjhG0czqaxkGruBv+80oFpsrgjLG0oN4O8KgDZaCBZEXgvAHs0bStcECU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773820975; c=relaxed/simple; bh=xaHpebmrRB2OIK7VZx2auwXWsziqIiIFR112IHSUbJ8=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=XM4TN0+80LI47MhBJdZtxIIIplDMUHvnsk8krLXlwguFR4+ttk0lQmzyr/OqiYXDqvJxGFnyLLfe97I1gqBZIjLFuRWjedjCdBQYf0k6AObHLO8ZDbPH/y8flaiOTP5viQX7PNV6pZrw39v5rOYBO+JN3WfJxMj+rzpi6pG7XMg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Eq7TeN01; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=+vBwlywh; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Eq7TeN01"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="+vBwlywh" Date: Wed, 18 Mar 2026 08:02:49 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1773820971; h=from:from:sender:sender:reply-to: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; bh=Ix/hUp1fGjoB0Cj1uJsKf7oFRk1wDBbHel4ww3wecnY=; b=Eq7TeN01nnWmT8nKPj7gODTsOzglxVNp8WcUm/KJZZ571vcIe5E3vWHqp+g78iJOsYyFYp DwvNogBM5o7kELnRHdggV8LGNqiH+Rzk/AHAC6aRsWjV0nn/urdbhgpkMWL0banYgEg78L iKdtFO5eKcrDKcyDAbwrw1bzzkdAxYqtmOoF9o6L03FSLmnqRzaR9z/OjEuLQyhr0dfocz DEKKbYWge7WH2gFTKyW5T0M22+zGYcUcgyRAzXFfPJyq21nGJZHQkXQDUbWlwH9AxTZfQG ko9NE/2v23CGCjFbXUNCzlvrg7ZZr5zUYjDmnRlFMoCpxOXbXeqOa/VChE+3Og== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1773820971; h=from:from:sender:sender:reply-to: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; bh=Ix/hUp1fGjoB0Cj1uJsKf7oFRk1wDBbHel4ww3wecnY=; b=+vBwlywhJV2ZUgFIiXnAcjlpfuTIPOwINAo+t8ZbIGJ+/6ieVa22OwXboB2kh+mpPAJAqg IYEviL5LLOrEw2Dg== From: "tip-bot2 for Mikhail Gavrilov" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/core] lockdep: Raise default stack trace limits when KASAN is enabled Cc: Mikhail Gavrilov , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260313171118.1702954-2-mikhail.v.gavrilov@gmail.com> References: <20260313171118.1702954-2-mikhail.v.gavrilov@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177382096977.1647592.3634220554587523109.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the locking/core branch of tip: Commit-ID: 891626973b2faf468565a253ca55373e0b9675de Gitweb: https://git.kernel.org/tip/891626973b2faf468565a253ca55373e0= b9675de Author: Mikhail Gavrilov AuthorDate: Fri, 13 Mar 2026 22:10:02 +05:00 Committer: Peter Zijlstra CommitterDate: Mon, 16 Mar 2026 13:16:49 +01:00 lockdep: Raise default stack trace limits when KASAN is enabled KASAN-enabled kernels with LOCKDEP and PREEMPT_FULL hit "BUG: MAX_STACK_TRACE_ENTRIES too low!" within 9-23 hours of normal desktop use. The root cause is a feedback loop between KASAN slab tracking and lockdep: every KASAN-tracked slab allocation saves a stack trace via stack_trace_save() -> arch_stack_walk(). The unwinder calls is_bpf_text_address(), which under PREEMPT_FULL can trigger RCU deferred quiescent-state processing -> swake_up_one() -> lock_acquire() -> lockdep validate_chain() -> save_trace(). This means KASAN's own stack captures indirectly generate new lockdep dependency chains, consuming the buffer from both directions. /proc/lockdep_stats at the moment of overflow confirms that stack-trace entries is the sole exhausted resource: stack-trace entries: 524288 [max: 524288] <- 100% full number of stack traces: 22080 <- unique after dedup dependency chains: 164665 [max: 524288] <- only 31% used direct dependencies: 45270 [max: 65536] <- 69% lock-classes: 2811 [max: 8192] <- 34% 22080 genuinely unique traces averaging ~24 frames each fill the buffer in under a day. The hash-based deduplication (12593b7467f9) is working correctly -- the traces are simply all different due to the deep and varied call stacks from GPU + filesystem + Wine/Proton + KASAN instrumentation. Raise the LOCKDEP_STACK_TRACE_BITS default from 19 to 21 when KASAN is enabled (2M entries, +12MB). This is negligible compared to KASAN's own shadow memory overhead (~12.5% of total RAM). Scale LOCKDEP_STACK_TRACE_HASH_BITS accordingly to maintain dedup efficiency. Signed-off-by: Mikhail Gavrilov Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/20260313171118.1702954-2-mikhail.v.gavrilov@= gmail.com --- lib/Kconfig.debug | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 4e2dfbb..e51e3c5 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1617,14 +1617,22 @@ config LOCKDEP_STACK_TRACE_BITS int "Size for MAX_STACK_TRACE_ENTRIES (as Nth power of 2)" depends on LOCKDEP && !LOCKDEP_SMALL range 10 26 + default 21 if KASAN default 19 help Try increasing this value if you hit "BUG: MAX_STACK_TRACE_ENTRIES too = low!" message. =20 + KASAN significantly increases stack trace consumption because its + slab tracking interacts with lockdep's dependency validation under + PREEMPT_FULL, creating a feedback loop. The higher default when + KASAN is enabled costs ~12MB extra, which is negligible compared to + KASAN's own shadow memory overhead. + config LOCKDEP_STACK_TRACE_HASH_BITS int "Size for STACK_TRACE_HASH_SIZE (as Nth power of 2)" depends on LOCKDEP && !LOCKDEP_SMALL range 10 26 + default 16 if KASAN default 14 help Try increasing this value if you need large STACK_TRACE_HASH_SIZE.