linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>, Tejun Heo <tj@kernel.org>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Dmitry Vyukov <dvyukov@google.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] sched/debug: Use terse backtrace for idly sleeping threads.
Date: Fri, 20 Jul 2018 22:27:17 +0900	[thread overview]
Message-ID: <54fc7ab8-2995-e864-7f74-c4434d23622c@i-love.sakura.ne.jp> (raw)
In-Reply-To: <20180719134653.GH2476@hirez.programming.kicks-ass.net>

On 2018/07/19 22:46, Peter Zijlstra wrote:
> On Thu, Jul 19, 2018 at 10:37:23PM +0900, Tetsuo Handa wrote:
>> This patch can be applied before proposing abovementioned changes.
>> Since there are many kernel threads whose backtrace is boring due to idly
>> waiting for an event inside the main loop, this patch introduces a kernel
>> config option (which allows SysRq-t to use one-liner backtrace for threads
>> idly waiting for an event) and simple helpers (which allow current thread
>> to declare that current thread is about to start/end idly waiting).
> 
>> diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
>> index f776807..6b8c8bd 100644
>> --- a/drivers/base/devtmpfs.c
>> +++ b/drivers/base/devtmpfs.c
>> @@ -406,7 +406,9 @@ static int devtmpfsd(void *p)
>>  		}
>>  		__set_current_state(TASK_INTERRUPTIBLE);
>>  		spin_unlock(&req_lock);
>> +		start_idle_sleeping();
>>  		schedule();
>> +		end_idle_sleeping();
>>  	}
>>  	return 0;
>>  out:
> 
> So I _really_ hate the idea of sprinking that all around the kernel like
> this.
> 

Does that comment mean the idea of "using one-liner backtrace for threads
idly waiting for an event" itself is OK?

Since there already is schedule_idle() function, introducing idly_schedule()
etc. is very confusing. What I'm trying to do is to tell debug function that
"I'm currently in neutral situation and hence dumping my backtrace will not
give you interesting result". Since such section needs to be carefully
annotated with comments, I think that lockdep-like annotation fits better
than introducing wrapped functions.


  reply	other threads:[~2018-07-20 13:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-19 13:37 [RFC PATCH] sched/debug: Use terse backtrace for idly sleeping threads Tetsuo Handa
2018-07-19 13:46 ` Peter Zijlstra
2018-07-20 13:27   ` Tetsuo Handa [this message]
2018-07-20 14:04     ` David Laight
2018-07-21 11:31       ` Tetsuo Handa

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=54fc7ab8-2995-e864-7f74-c4434d23622c@i-love.sakura.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=akpm@linux-foundation.org \
    --cc=dvyukov@google.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mingo@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).