[GIT,pull] core/debugobjects for v6.5-rc1

Message ID 168778150975.3634408.5562070824299155127.tglx@vps.praguecc.cz
State New
Headers
Series [GIT,pull] core/debugobjects for v6.5-rc1 |

Commit Message

Thomas Gleixner June 26, 2023, 12:13 p.m. UTC
  Linus,

please pull the latest core/debugobjects branch from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core-debugobjects-2023-06-26

up to:  8b64d420fe24: debugobjects: Recheck debug_objects_enabled before reporting


A single update for debug objects:

  - Recheck whether debug objects is enabled before reporting a problem to
    avoid spamming the logs with messages which are caused by a concurrent
    OOM.

Thanks,

	tglx

------------------>
Tetsuo Handa (1):
      debugobjects: Recheck debug_objects_enabled before reporting


 lib/debugobjects.c | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Comments

pr-tracker-bot@kernel.org June 26, 2023, 10:06 p.m. UTC | #1
The pull request you sent on Mon, 26 Jun 2023 14:13:47 +0200 (CEST):

> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core-debugobjects-2023-06-26

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/cef2dd76531fda106fa698b6b7ee3e87b1622c08

Thank you!
  

Patch

diff --git a/lib/debugobjects.c b/lib/debugobjects.c
index 984985c39c9b..a517256a270b 100644
--- a/lib/debugobjects.c
+++ b/lib/debugobjects.c
@@ -498,6 +498,15 @@  static void debug_print_object(struct debug_obj *obj, char *msg)
 	const struct debug_obj_descr *descr = obj->descr;
 	static int limit;
 
+	/*
+	 * Don't report if lookup_object_or_alloc() by the current thread
+	 * failed because lookup_object_or_alloc()/debug_objects_oom() by a
+	 * concurrent thread turned off debug_objects_enabled and cleared
+	 * the hash buckets.
+	 */
+	if (!debug_objects_enabled)
+		return;
+
 	if (limit < 5 && descr != descr_test) {
 		void *hint = descr->debug_hint ?
 			descr->debug_hint(obj->object) : NULL;