mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chengming Zhou <zhouchengming@bytedance.com>
To: Tejun Heo <tj@kernel.org>, Peter Zijlstra <peterz@infradead.org>
Cc: arbn@yandex-team.com, mingo@redhat.com,
	linux-kernel@vger.kernel.org, Minye Zhu <zhuminye@bytedance.com>
Subject: Re: [Phishing Risk] [External] Re: [PATCH] sched/cpuacct: fix charge percpu cpuusage
Date: Tue, 15 Feb 2022 20:23:13 +0800	[thread overview]
Message-ID: <86bbb33e-1e9b-70f9-237c-d0c02537380c@bytedance.com> (raw)
In-Reply-To: <YgqmE9Id35av9NZk@slm.duckdns.org>

On 2022/2/15 2:57 上午, Tejun Heo wrote:
> On Mon, Feb 14, 2022 at 11:09:01AM +0100, Peter Zijlstra wrote:
>> --- a/kernel/sched/cpuacct.c
>> +++ b/kernel/sched/cpuacct.c
>> @@ -334,15 +334,13 @@ static struct cftype files[] = {
>>   */
>>  void cpuacct_charge(struct task_struct *tsk, u64 cputime)
>>  {
>> -	struct cpuacct *ca;
>>  	unsigned int cpu = task_cpu(tsk);
>> +	struct cpuacct *ca;
>>  
>> -	rcu_read_lock();
>> +	lockdep_assert_rq_held(cpu_rq(cpu));
>>  
>>  	for (ca = task_ca(tsk); ca; ca = parent_ca(ca))
>>  		*per_cpu_ptr(ca->cpuusage, cpu) += cputime;
>> -
>> -	rcu_read_unlock();
> 
> And probably expand the same to cgroup_account_cputime[_field]() too.
> 
> Thanks.
> 

Good suggestion, will do.

Thanks.

  reply	other threads:[~2022-02-15 12:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-13 12:01 Chengming Zhou
2022-02-14 10:09 ` Peter Zijlstra
2022-02-14 18:57   ` Tejun Heo
2022-02-15 12:23     ` Chengming Zhou [this message]
2022-02-15 12:19   ` [External] " Chengming Zhou

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=86bbb33e-1e9b-70f9-237c-d0c02537380c@bytedance.com \
    --to=zhouchengming@bytedance.com \
    --cc=arbn@yandex-team.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tj@kernel.org \
    --cc=zhuminye@bytedance.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®