public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: Yafang Shao <laoar.shao@gmail.com>
To: mgorman@suse.de, mingo@redhat.com, peterz@infradead.org,
	juri.lelli@redhat.com, vincent.guittot@linaro.org,
	dietmar.eggemann@arm.com, rostedt@goodmis.org,
	bsegall@google.com, bristot@redhat.com
Cc: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org,
	Yafang Shao <laoar.shao@gmail.com>
Subject: [RFC PATCH v2 0/5] sched: support schedstat for RT sched class
Date: Mon, 23 Nov 2020 20:58:03 +0800	[thread overview]
Message-ID: <20201123125808.50896-1-laoar.shao@gmail.com> (raw)

We want to measure the latency of RT tasks in our production
environment with schedstat facility, but currently schedstat is only
supported for fair sched class. This patchset enable it for RT sched class
as well.

The schedstat statistics are defined in struct sched_entity, which is a
member of struct task_struct, so we can resue it for RT sched class.

The schedstat usage in RT sched class is similar with fair sched class,
for example,
                fair                            RT
enqueue         update_stats_enqueue_fair       update_stats_enqueue_rt
dequeue         update_stats_dequeue_fair       update_stats_dequeue_rt
put_prev_task   update_stats_wait_start         update_stats_wait_start
set_next_task   update_stats_wait_end           update_stats_wait_end
show            /proc/[pid]/sched               /proc/[pid]/sched

The sched:sched_stats_* tracepoints can be used to trace RT tasks as
well after that patchset.

PATCH #1 ~ #4 are the preparation of PATCH #5.

- v2:
keep the schedstats functions inline, per Mel.

Yafang Shao (5):
  sched: don't include stats.h in sched.h
  sched: define task_of() as a common helper
  sched: make schedstats helper independent of cfs_rq
  sched: define update_stats_curr_start() as a common helper
  sched, rt: support schedstat for RT sched class

 kernel/sched/core.c      |   1 +
 kernel/sched/deadline.c  |   1 +
 kernel/sched/debug.c     |   1 +
 kernel/sched/fair.c      | 174 ++-------------------------------------
 kernel/sched/idle.c      |   1 +
 kernel/sched/rt.c        |  94 ++++++++++++++++++++-
 kernel/sched/sched.h     |  30 ++++++-
 kernel/sched/stats.c     |   1 +
 kernel/sched/stats.h     | 146 ++++++++++++++++++++++++++++++++
 kernel/sched/stop_task.c |   1 +
 10 files changed, 280 insertions(+), 170 deletions(-)

-- 
2.18.4


             reply	other threads:[~2020-11-23 12:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-23 12:58 Yafang Shao [this message]
2020-11-23 12:58 ` [RFC PATCH v2 1/5] sched: don't include stats.h in sched.h Yafang Shao
2020-11-23 12:58 ` [RFC PATCH v2 2/5] sched: define task_of() as a common helper Yafang Shao
2020-11-23 12:58 ` [RFC PATCH v2 3/5] sched: make schedstats helper independent of cfs_rq Yafang Shao
2020-11-24 11:40   ` Mel Gorman
2020-11-24 13:08     ` Yafang Shao
2020-11-23 12:58 ` [RFC PATCH v2 4/5] sched: define update_stats_curr_start() as a common helper Yafang Shao
2020-11-23 12:58 ` [RFC PATCH v2 5/5] sched, rt: support schedstat for RT sched class Yafang Shao

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=20201123125808.50896-1-laoar.shao@gmail.com \
    --to=laoar.shao@gmail.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.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