linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Chengming Zhou <zhouchengming@bytedance.com>,
	arbn@yandex-team.com, mingo@redhat.com,
	linux-kernel@vger.kernel.org, Minye Zhu <zhuminye@bytedance.com>
Subject: Re: [PATCH] sched/cpuacct: fix charge percpu cpuusage
Date: Mon, 14 Feb 2022 08:57:23 -1000	[thread overview]
Message-ID: <YgqmE9Id35av9NZk@slm.duckdns.org> (raw)
In-Reply-To: <YgoqPT67g2NcV/eH@hirez.programming.kicks-ass.net>

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.

-- 
tejun

  reply	other threads:[~2022-02-14 19:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-13 12:01 [PATCH] sched/cpuacct: fix charge percpu cpuusage Chengming Zhou
2022-02-14 10:09 ` Peter Zijlstra
2022-02-14 18:57   ` Tejun Heo [this message]
2022-02-15 12:23     ` [Phishing Risk] [External] " Chengming Zhou
2022-02-15 12:19   ` 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=YgqmE9Id35av9NZk@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=arbn@yandex-team.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=zhouchengming@bytedance.com \
    --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;
as well as URLs for NNTP newsgroup(s).