mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: 王贇 <yun.wang@linux.alibaba.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] tg: count the sum wait time of an task group
Date: Tue, 3 Jul 2018 10:10:05 +0800	[thread overview]
Message-ID: <21628e16-5d34-d7f6-8c10-ff354b4e7b35@linux.alibaba.com> (raw)
In-Reply-To: <20180702120356.GJ2494@hirez.programming.kicks-ass.net>

Hi, Peter

On 2018/7/2 下午8:03, Peter Zijlstra wrote:
> On Mon, Jul 02, 2018 at 03:29:39PM +0800, 王贇 wrote:
>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
>> index 1866e64..ef82ceb 100644
>> --- a/kernel/sched/fair.c
>> +++ b/kernel/sched/fair.c
>> @@ -862,6 +862,7 @@ static void update_curr_fair(struct rq *rq)
>>   static inline void
>>   update_stats_wait_end(struct cfs_rq *cfs_rq, struct sched_entity *se)
>>   {
>> +	struct task_group *tg;
>>   	struct task_struct *p;
>>   	u64 delta;
>>
>> @@ -882,6 +883,9 @@ static void update_curr_fair(struct rq *rq)
>>   			return;
>>   		}
>>   		trace_sched_stat_wait(p, delta);
>> +	} else {
>> +		tg = group_cfs_rq(se)->tg;
>> +		__schedstat_add(tg->wait_sum, delta);
>>   	}
> 
> You're joking right? This patch is both broken and utterly insane.
> 
> You're wanting to update an effectively global variable for every
> schedule action (and its broken because it is without any serialization
> or atomics).

Thanks for the reply and sorry for the thoughtless, I'll rewrite
the code to make it per-cpu variable, then assemble the results
on show.

Regards,
Michael Wang


> 
> NAK
> 

  reply	other threads:[~2018-07-03  2:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-02  7:29 王贇
2018-07-02 12:03 ` Peter Zijlstra
2018-07-03  2:10   ` 王贇 [this message]
2018-07-03  5:42 ` [PATCH] tg: show " 王贇
2018-07-04  3:27   ` [PATCH v2] " 王贇
2018-07-09  9:12     ` 王贇
2018-07-17  3:28     ` 王贇
2018-07-23  9:31     ` Peter Zijlstra
2018-07-23 12:32       ` 王贇
2018-07-23 13:31     ` [PATCH v3] " 王贇
2018-07-25 14:23     ` [tip:sched/core] sched/debug: Show the sum wait time of a " tip-bot for Yun Wang

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=21628e16-5d34-d7f6-8c10-ff354b4e7b35@linux.alibaba.com \
    --to=yun.wang@linux.alibaba.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.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

all inboxes | Powered by JetHome®