From nobody Mon Nov 25 19:53:10 2024 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D16631FC7D9 for ; Thu, 24 Oct 2024 18:36:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729794999; cv=none; b=HRpex9qMr8hZHszcZCJUgG2gxohf1ziGxNMFpeRpAQovLSKtN700x1uzMrFSuVMLhaSJM7XMpc/XfJwcDOU4Cfcy1icmaOHfxVFchNXWoDYEAV1vVQ4e7fgWR+B5WI9y9OFAXfL9r8mUPI2kQzAiSahD/3ISNZM0PXZKBXnnGxg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729794999; c=relaxed/simple; bh=PNTMHRt6ByKcjKIJl2jtbIlsRynQyb3CB/m9cIDWCq8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=oNh6Sr2t6BHcxTBP5bjZ0d5nnOQQKqw9ZqnGPsqBrD0eRRhVYz/FlUS4jZ/TyWKG3ljKdur1eO8sJiGk5oXd+A/glXtSvBbhHLzfu3yKf7mYYL0sXewWYo0BnpJ4NcpPTusMlJtGP79j7AMi1X6lf/V7wu0wqipnJdJJIEQzGEc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--cmllamas.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=JzApEMKR; arc=none smtp.client-ip=209.85.216.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--cmllamas.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="JzApEMKR" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-2e2bb354e91so1220663a91.2 for ; Thu, 24 Oct 2024 11:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729794997; x=1730399797; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=UdbkpJvAL1p2GEPxPaAzYqCJ87IuKyW29MlAkszxMbs=; b=JzApEMKRYhPA5jB3gOctUs4k+1BYiSmmlN6TJweD+f1yHB3zuiM+05fgGDBnzXhQeC 86h89DeimH7tTN96cevh9Vu+nm4HN2STg4YKW3rko24KXSqwJHV8zbKUO2smJo52Xy/z FTzeDkUKVMsmKuFtjyzD5gYswBq+WBrFfkpxtIW0nD+9VqeSA+ydGZ/A9EdG/Q0MfHDK 173kHilXFh5e1GkDmCfVnfhoji0EAPRqzC+vu9vWd39taL/Aq9lJvln96EVzQG0ND4vP 1Ytz8Wx1dsgXni4mrjRxHdF9DaURokyBEUXezVivpJlSDBWAeLeRl7fREe16WWW4s/bs 523g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729794997; x=1730399797; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UdbkpJvAL1p2GEPxPaAzYqCJ87IuKyW29MlAkszxMbs=; b=Y2zIB2WyWZgo6Qp4c10TgFWCTM2+NXkRyArHZgeI9pC//uyMO0GmbuOmm6zTZ1pa6B OhtOj0AFcHGezVgqspOc/tTjVi83Q/WjpbJ4cG3j7r8+w5w1c027r/9ag2nN5Oev395W nmZOqZpgmBjC6L78bvS6WCVrJQSu9lJH7TUbwpLwVzFe33Fb0V8/rNlgbGGzppOlw8Fn wxUVP70z9u24GU4O4OrzNaUIlV9LiVUj41V2yUpw08TMTpZwRJdwtgII1wp4gA/VfBy+ 5IUhOIPsQYGB+GE3I/H4AvRLubZLCPEcuc7gfLwN4vT8WilFRdBJp/4+ONnKdRxHU0oG k7og== X-Gm-Message-State: AOJu0YwWXJa0Uv5CqGtNAUVH2FiDvCwnWBHferorfRKEivvueVRwZHjV iyjroeFVHxjDMTtQAWGP6V6nebxfEeYff1xu3K1O9aDbuRd55NAw16C295xcTUCWWQElKCSVbzj D1BsOFs66zg== X-Google-Smtp-Source: AGHT+IGIsAttalNdDXgr6ZXXOhsJq8ofymYMLw0IYhDa4tt6JeDi2EnLEW3K9zvwL/sEhDRO6/3Uo6f+C/qBqw== X-Received: from xllamas.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5070]) (user=cmllamas job=sendgmr) by 2002:a17:90a:560c:b0:2d8:8f24:bd8c with SMTP id 98e67ed59e1d1-2e77ecbd9e6mr6269a91.0.1729794996781; Thu, 24 Oct 2024 11:36:36 -0700 (PDT) Date: Thu, 24 Oct 2024 18:36:26 +0000 In-Reply-To: <20241024183631.643450-1-cmllamas@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241024183631.643450-1-cmllamas@google.com> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog Message-ID: <20241024183631.643450-2-cmllamas@google.com> Subject: [PATCH v3 1/3] lockdep: fix upper limit for LOCKDEP_*_BITS configs From: Carlos Llamas To: Boqun Feng , Andrew Morton Cc: linux-kernel@vger.kernel.org, kernel-team@android.com, Carlos Llamas , "J. R. Okajima" , Peter Zijlstra , Ingo Molnar , Waiman Long , Will Deacon Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 --- lib/Kconfig.debug | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 7312ae7c3cc5..c8b1db37abe6 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1524,7 +1524,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. @@ -1540,7 +1540,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. @@ -1548,7 +1548,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. @@ -1556,7 +1556,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. --=20 2.47.0.163.g1226f6d8fa-goog From nobody Mon Nov 25 19:53:10 2024 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 297E4201013 for ; Thu, 24 Oct 2024 18:36:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729795003; cv=none; b=I3uGOXVxBun6iG0scB5aAwDWxZg0lsthte5yQqSXghE51uVIxREZ3zL2vmM41ArsgBjLtpVjaTj9uBSvj5byckqdnp4LSYi3kCT3gs/xlfYrLigu/45vqqT3ebgsMvrn7O+2VS9G02cUezpYKOSYmD34roMj5CGYB3DwBE4zRsc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729795003; c=relaxed/simple; bh=/y6OxllrUT1nN0LgLmw3lPkqW4Tw1P93wwYxo4f1gmI=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=gy6biLsujUZ1BCaNAb35DK3tlpwiQK8fIucaJVgfaRiTAitTmHBHImwtaHvjH4f/Q0vKrWO4//bxt2jZsxpAoIMBxLoTnDpkm74mHO0pOD6U54LhFxToULqSjUXny8pM9BDUTe5lbjKw+0axzYqHMAtc6/H+m2b/plmML25+WOE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--cmllamas.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=jO59gRw+; arc=none smtp.client-ip=209.85.219.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--cmllamas.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="jO59gRw+" Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-e2e3321aae0so2326294276.1 for ; Thu, 24 Oct 2024 11:36:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729795000; x=1730399800; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=z5wH8AnQS7+BaI6kmGVBGOrDe1FUvidsmVrFSdWsbto=; b=jO59gRw+z2z4+gidlBFQa54CvElBOouGNJKhFNtvHJNCfPl3baPcGmUeAgnQMCknjl BhBju2WC8/m//fV+Mf5r3gCbgFWbmacS6CUK0TWIaDf/AxPX8aER9I3ydLqdGDzKbAj1 Sqj1OkuBzYOzKNMmyV9ps+cST19FTrkjk9wss0jEJyXWzY4pqbVZQ8Ole31vWqgDelqY 8G+RXqB/O+B4i1moy7+ssx7afBSFYcevooVEj/4UUfQQTOPrYGjmUz1sTs94+TbLXLDX W/vJjAUBr0T/eijrSjRRah3DrYyDdPQMXinqiTSEe0j3ij2iHpg/mftAGLTNT8QLWtxq Q50A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729795000; x=1730399800; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=z5wH8AnQS7+BaI6kmGVBGOrDe1FUvidsmVrFSdWsbto=; b=vkLjOKoiL+/CL/QAxb9b5+hnoxqrGGU3pUV+/CogB1P0pikL+kOLP28Ki9gdpW4SPO WCowtuXbX3dRg7Ej0Tyg6BW8NfWRBl1QCMqBtlh368s+YFyujocKmuSO3yX4CI9pyllE 4tlj51PjFp3k/MLqTlCYSgpKrSaAxDaKJYPUK8cQdYT1bPOkFwKrtS0/yocS8wyolSXd k/1JqfC6Fy91rY62osoJYCDst4bFrR74hiOvNvIeDrMZMv6Sjv5WvOqUn6vbfyyW69ez yOmXFIlUJT9R+/IRe1VuP9b/i7t0OISNecFs9sqo7csgV/R4U358/5kGkiF1KRNrtPpz SDjw== X-Gm-Message-State: AOJu0YwNA0Yl+kEQUdtsxoSOdVd8zOcpSOZv7UlJLEU2o3FvWy3pBBYH aqoDNJSTodUSpR5nh4JHRJZG7aDwlvP/82u3RtHrxs+IJ22ckDFxxXFGCFzuYwMl9cSITpEvt9J f5IodpcqAyA== X-Google-Smtp-Source: AGHT+IGkKVPnTjJs6U5A2GreOrOdPMRV2LTjYukXzULIzZf1LKre3y7W/hjlkjFOS0EB6yCjYAW8oAnmRkYqBg== X-Received: from xllamas.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5070]) (user=cmllamas job=sendgmr) by 2002:a25:ad5c:0:b0:e2e:2c0c:d02b with SMTP id 3f1490d57ef6-e2f2fc2730amr1372276.11.1729794999539; Thu, 24 Oct 2024 11:36:39 -0700 (PDT) Date: Thu, 24 Oct 2024 18:36:27 +0000 In-Reply-To: <20241024183631.643450-1-cmllamas@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241024183631.643450-1-cmllamas@google.com> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog Message-ID: <20241024183631.643450-3-cmllamas@google.com> Subject: [PATCH v3 2/3] lockdep: clarify size for LOCKDEP_*_BITS configs From: Carlos Llamas To: Boqun Feng , Andrew Morton Cc: linux-kernel@vger.kernel.org, kernel-team@android.com, Carlos Llamas , Peter Zijlstra , Ingo Molnar , Waiman Long , Will Deacon Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The LOCKDEP_*_BITS configs control the size of internal structures used by lockdep. The size is calculated as a power of two of the configured value (e.g. 16 =3D> 64KB). Update these descriptions to more accurately reflect this, as "Bitsize" can be misleading. Suggested-by: Andrew Morton Cc: Peter Zijlstra Cc: Boqun Feng Cc: Ingo Molnar Cc: Waiman Long Cc: Will Deacon Signed-off-by: Carlos Llamas Acked-by: Waiman Long --- lib/Kconfig.debug | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index c8b1db37abe6..5a769cbf4bb2 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1522,7 +1522,7 @@ config LOCKDEP_SMALL bool =20 config LOCKDEP_BITS - int "Bitsize for MAX_LOCKDEP_ENTRIES" + int "Size for MAX_LOCKDEP_ENTRIES (as Nth power of 2)" depends on LOCKDEP && !LOCKDEP_SMALL range 10 24 default 15 @@ -1530,7 +1530,7 @@ config LOCKDEP_BITS Try increasing this value if you hit "BUG: MAX_LOCKDEP_ENTRIES too low!= " message. =20 config LOCKDEP_CHAINS_BITS - int "Bitsize for MAX_LOCKDEP_CHAINS" + int "Size for MAX_LOCKDEP_CHAINS (as Nth power of 2)" depends on LOCKDEP && !LOCKDEP_SMALL range 10 21 default 16 @@ -1538,7 +1538,7 @@ config LOCKDEP_CHAINS_BITS Try increasing this value if you hit "BUG: MAX_LOCKDEP_CHAINS too low!"= message. =20 config LOCKDEP_STACK_TRACE_BITS - int "Bitsize for MAX_STACK_TRACE_ENTRIES" + int "Size for MAX_STACK_TRACE_ENTRIES (as Nth power of 2)" depends on LOCKDEP && !LOCKDEP_SMALL range 10 26 default 19 @@ -1546,7 +1546,7 @@ config LOCKDEP_STACK_TRACE_BITS Try increasing this value if you hit "BUG: MAX_STACK_TRACE_ENTRIES too = low!" message. =20 config LOCKDEP_STACK_TRACE_HASH_BITS - int "Bitsize for STACK_TRACE_HASH_SIZE" + int "Size for STACK_TRACE_HASH_SIZE (as Nth power of 2)" depends on LOCKDEP && !LOCKDEP_SMALL range 10 26 default 14 @@ -1554,7 +1554,7 @@ config LOCKDEP_STACK_TRACE_HASH_BITS Try increasing this value if you need large STACK_TRACE_HASH_SIZE. =20 config LOCKDEP_CIRCULAR_QUEUE_BITS - int "Bitsize for elements in circular_queue struct" + int "Size for elements in circular_queue struct (as Nth power of 2)" depends on LOCKDEP range 10 26 default 12 --=20 2.47.0.163.g1226f6d8fa-goog From nobody Mon Nov 25 19:53:10 2024 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 574D41FC7D9 for ; Thu, 24 Oct 2024 18:36:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729795005; cv=none; b=uTxAzZz3i4M6WGUN7Nh49cCx4F+nTXj5xuhq0CpAiHavLHc7j3chsDL3U38tIxx7yEm2gQ8BtXpK8SV/FWJu3jRdMw/6ByvSNlndOHVxhaHVtbthIs1GRkls22RS4Zh7uKmmmMxFGlyxV6EEVhFPRkFc2FClsg1LIAQeUlPjnsQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729795005; c=relaxed/simple; bh=3kiHpo0x4JoZC6Rs7bU0fkNLNXIKhCfPNpg1vpNlwkc=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Td4jOgJ8prKGUGVYBWZUX3tCfQ9mPnOsSh0K5doeFjjpHbMk4wE0gqj1OT2FOLj08RVPCiGfMSQfOpj8YA+RL3KLt3ktQCQeYpLsLZZwx6OKHHJRCDRXCJ56UNcUbl/Ftjbp6DKgGeI+u7RrD5B6Ad0GuSlGNL9IeW2/byW/x9I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--cmllamas.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=21OcgwGX; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--cmllamas.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="21OcgwGX" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-6e35d1d8c82so22017167b3.3 for ; Thu, 24 Oct 2024 11:36:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729795002; x=1730399802; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Av5TcrKQ0emSnE/TneH2xzU4DKf3Pe9BcgJTocLWv6k=; b=21OcgwGXozWmG9BEw6we1s0wrdwVYmi69Mvg/eXGvVFibHJTaot3tnidhFQB0DXroH tQhnQi/DEmrmQb3YoTRxMtRMQwvvx8AtG0oa0HnAQMMArqGZr4HsGXRx8Nr5+TzpwKw5 NPsHYz/OORCasYaKAX5Pwzo2AJXZ2lETE+qxzHqfCD650lXOaOlJavEmDbIUOTN1gGJa Rh1BcLwoaiBk7PY0Zxg6G6yh3cCS3bB4Xkv/j4RctS560jwFtVVs6nThcoRtzQ43eHgr cbKpz4pDVEvI6Zi7slfpMH7QoqbpBcg59FAXalWjbLlcY3WDt55kpnEDErXeAxDqCcix EoUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729795002; x=1730399802; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Av5TcrKQ0emSnE/TneH2xzU4DKf3Pe9BcgJTocLWv6k=; b=HrcVtYi0RpGT21n3Ykn36lKksutwDwU5/lf+7fIKYmahdGs2mZ6OE3Aw2bGaVm/KBN 7NVAzY2dop8QrrVwKZNS0Bpxs7VaM5arXKzSGCqTqNY+K4anfXQvTddjH8sSK41kXERZ dhDFNGp8tR6563p0k0yuJ0Yh6x0FDg0EZSuv4pnBuH1CEjzHFQnbrl2HkSzFDDsOkBb2 KNfGY+YsRad+XODTGoJT9YkaWX/A6zwtKh9v4+iPERXc5yTDojedu79cd2B+XBsU7BZ7 N6TD47dcxMTuZPYuilc6QSJsMuGT0h2DSzIpp9vs/6fnTstn56H7abYcwyFaMl7f0ZK/ Pn8A== X-Gm-Message-State: AOJu0YyMiWlz8+pz1Tna9H0bSjWjtd3U1haZa9RzPhR8lcnJC6aExp9K bDXcrFYPzNGFBd4Awmg8KGbK1P06NCrT42sJAmY8r4pVkYxOeXXKY88OGpEsGf2tliTdL/S/F3s YItftjH6yGQ== X-Google-Smtp-Source: AGHT+IEaHfj7A1f4KlpGTBNrwNkb5CcfS6KTqWpzwjm4zW82/1tDEVQPsR6Fed1wLSSEGkjI2tU6GGymXjdVhA== X-Received: from xllamas.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5070]) (user=cmllamas job=sendgmr) by 2002:a05:690c:7449:b0:6e2:12e5:356f with SMTP id 00721157ae682-6e86637045dmr1541677b3.3.1729795002388; Thu, 24 Oct 2024 11:36:42 -0700 (PDT) Date: Thu, 24 Oct 2024 18:36:28 +0000 In-Reply-To: <20241024183631.643450-1-cmllamas@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241024183631.643450-1-cmllamas@google.com> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog Message-ID: <20241024183631.643450-4-cmllamas@google.com> Subject: [PATCH v3 3/3] lockdep: document MAX_LOCKDEP_CHAIN_HLOCKS calculation From: Carlos Llamas To: Boqun Feng , Andrew Morton , Peter Zijlstra , Ingo Molnar , Will Deacon Cc: linux-kernel@vger.kernel.org, kernel-team@android.com, Carlos Llamas , Waiman Long , Huang Ying , "J. R. Okajima" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Define a macro AVG_LOCKDEP_CHAIN_DEPTH to document the magic number '5' used in the calculation of MAX_LOCKDEP_CHAIN_HLOCKS. The number represents the estimated average depth (number of locks held) of a lock chain. The calculation of MAX_LOCKDEP_CHAIN_HLOCKS was first added in commit 443cd507ce7f ("lockdep: add lock_class information to lock_chain and output it"). Suggested-by: Waiman Long Cc: Huang Ying Cc: J. R. Okajima Cc: Peter Zijlstra Cc: Boqun Feng Cc: Ingo Molnar Cc: Will Deacon Acked-by: Waiman Long Signed-off-by: Carlos Llamas Acked-by: "Huang, Ying" --- v3: collect tags v2: switched the comment for a macro as suggested by Waiman Long. kernel/locking/lockdep_internals.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/locking/lockdep_internals.h b/kernel/locking/lockdep_in= ternals.h index bbe9000260d0..20f9ef58d3d0 100644 --- a/kernel/locking/lockdep_internals.h +++ b/kernel/locking/lockdep_internals.h @@ -119,7 +119,8 @@ static const unsigned long LOCKF_USED_IN_IRQ_READ =3D =20 #define MAX_LOCKDEP_CHAINS (1UL << MAX_LOCKDEP_CHAINS_BITS) =20 -#define MAX_LOCKDEP_CHAIN_HLOCKS (MAX_LOCKDEP_CHAINS*5) +#define AVG_LOCKDEP_CHAIN_DEPTH 5 +#define MAX_LOCKDEP_CHAIN_HLOCKS (MAX_LOCKDEP_CHAINS * AVG_LOCKDEP_CHAIN_D= EPTH) =20 extern struct lock_chain lock_chains[]; =20 --=20 2.47.0.163.g1226f6d8fa-goog