mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Yang Shi <yang.s@alibaba-inc.com>
Cc: longman@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2 v3] lib: debugobjects: touch watchdog to avoid softlockup when !CONFIG_PREEMPT
Date: Wed, 17 Jan 2018 13:21:45 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1801171315230.1777@nanos> (raw)
In-Reply-To: <1515023802-54196-2-git-send-email-yang.s@alibaba-inc.com>

On Thu, 4 Jan 2018, Yang Shi wrote:

> There are nested loops on debug objects free path, sometimes it may take
> over hundred thousands of loops, then cause soft lockup with !CONFIG_PREEMPT
> occasionally, like below:

Please trim back traces. The whole module info and whatever is completely
irrelevant.

> @@ -768,6 +771,10 @@ static void __debug_check_no_obj_freed(const void *address, unsigned long size)
>  			debug_objects_maxchain = cnt;
>  
>  		max_loops += cnt;
> +
> +		if (max_loops > 10000 && ((max_loops % 10000) == 0)
> +		    && suppress_lockup != 0)
> +			touch_softlockup_watchdog();

This is voodoo programming.

There are two things which can be done here:

 1) The collected objects can be put on a global free list and work
    scheduled to free them piecewise.

 2) We can do a cond_resched() if not in atomic context and interrupts are
    enabled.

I rather prefer to make that stuff robust than having crystal ball
constants and magic debugfs knobs.

Thanks,

	tglx

  reply	other threads:[~2018-01-17 12:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-03 23:56 [PATCH 1/2 v3] lib: debugobjects: export max loops counter Yang Shi
2018-01-03 23:56 ` [PATCH 2/2 v3] lib: debugobjects: touch watchdog to avoid softlockup when !CONFIG_PREEMPT Yang Shi
2018-01-17 12:21   ` Thomas Gleixner [this message]
2018-01-18  1:41     ` Yang Shi
2018-01-18  9:02       ` Thomas Gleixner
2018-01-18 15:05         ` Peter Zijlstra
2018-01-18 15:15           ` Thomas Gleixner
2018-01-20  0:06         ` Yang Shi
  -- strict thread matches above, loose matches on Subject: below --
2017-11-28 19:45 Yang Shi
2017-11-28 20:24 ` Waiman Long
2017-12-07 19:16   ` Yang Shi
2017-12-28 15:36     ` Thomas Gleixner
2018-01-03 23:54       ` Yang Shi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1801171315230.1777@nanos \
    --to=tglx@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=yang.s@alibaba-inc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®