Skip to content

Commit

Permalink
Merge tag 'core-debugobjects-2023-06-26' of ssh://gitolite.kernel.org…
Browse files Browse the repository at this point in the history
…/pub/scm/linux/kernel/git/tip/tip

Pull debugobjects update from Thomas Gleixner:
 "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"

* tag 'core-debugobjects-2023-06-26' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  debugobjects: Recheck debug_objects_enabled before reporting
  • Loading branch information
torvalds committed Jun 26, 2023
2 parents a0433f8 + 8b64d42 commit cef2dd7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/debugobjects.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit cef2dd7

Please sign in to comment.