mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: liu.song11@zte.com.cn
Cc: fishland@aliyun.com, mingo@redhat.com,
	linux-kernel@vger.kernel.org, jiang.xuexin@zte.com.cn
Subject: Re: [PATCH] psi: Only collect online cpu time in collect_percpu_times
Date: Thu, 5 Dec 2019 11:33:29 +0100	[thread overview]
Message-ID: <20191205103329.GH2810@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <201912051005599522735@zte.com.cn>

On Thu, Dec 05, 2019 at 10:05:59AM +0800, liu.song11@zte.com.cn wrote:
> >On Mon, Dec 02, 2019 at 09:09:28PM +0800, Liu Song wrote:
> >> From: Liu Song <liu.song11@zte.com.cn> 
> >>  
> >> Tasks can only run on the online cpu, so only need to
> >> collect the time of the online cpu.
> >>  
> >> Signed-off-by: Liu Song <liu.song11@zte.com.cn> 
> >> ---
> >>  kernel/sched/psi.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>  
> >> diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
> >> index 7acc632c3b82..605f02facb7b 100644
> >> --- a/kernel/sched/psi.c
> >> +++ b/kernel/sched/psi.c
> >> @@ -316,7 +316,7 @@ static void collect_percpu_times(struct psi_group *group,
> >>       * the sampling period. This eliminates artifacts from uneven
> >>       * loading, or even entirely idle CPUs.
> >>       */
> >> -    for_each_possible_cpu(cpu) {
> >> +    for_each_online_cpu(cpu) {
> >>          u32 times[NR_PSI_STATES];
> >>          u32 nonidle;
> >>          u32 cpu_changed_states;
> >
> >And who collects the deltas that remain after offline?
> 
> Hi,
> After the cpu goes offline, there is no activity on the cpu and no time will be updated.

But there might have been activitiy before it went offline.

> So the value of deltas is 0 and it will not contribute to the total time.

No, the value will not change, but it need not be 0.



  parent reply	other threads:[~2019-12-05 10:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191202130928.2971-1-fishland@aliyun.com>
2019-12-04 12:35 ` Peter Zijlstra
     [not found]   ` <201912051005599522735@zte.com.cn>
2019-12-05 10:33     ` Peter Zijlstra [this message]
     [not found]       ` <201912061229281310714@zte.com.cn>
2019-12-06 12:01         ` Peter Zijlstra

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=20191205103329.GH2810@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=fishland@aliyun.com \
    --cc=jiang.xuexin@zte.com.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liu.song11@zte.com.cn \
    --cc=mingo@redhat.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®