[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221114124659.GE590078@lothringen>
Date: Mon, 14 Nov 2022 13:46:59 +0100
From: Frederic Weisbecker <frederic@...nel.org>
To: "Leizhen (ThunderTown)" <thunder.leizhen@...wei.com>
Cc: "Paul E . McKenney" <paulmck@...nel.org>,
Neeraj Upadhyay <quic_neeraju@...cinc.com>,
Josh Triplett <josh@...htriplett.org>,
Steven Rostedt <rostedt@...dmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Lai Jiangshan <jiangshanlai@...il.com>,
Joel Fernandes <joel@...lfernandes.org>, rcu@...r.kernel.org,
linux-kernel@...r.kernel.org, Robert Elliott <elliott@....com>
Subject: Re: [PATCH v7 4/6] rcu: Add RCU stall diagnosis information
On Mon, Nov 14, 2022 at 08:32:19PM +0800, Leizhen (ThunderTown) wrote:
> >> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> >> index ed93ddb8203d42c..3921aacfd421ba9 100644
> >> --- a/kernel/rcu/tree.c
> >> +++ b/kernel/rcu/tree.c
> >> @@ -866,6 +866,24 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp)
> >> rdp->rcu_iw_gp_seq = rnp->gp_seq;
> >> irq_work_queue_on(&rdp->rcu_iw, rdp->cpu);
> >> }
> >> +
> >> + if (rcu_cpu_stall_cputime && rdp->snap_record.gp_seq != rdp->gp_seq) {
> >> + int cpu = rdp->cpu;
> >> + struct rcu_snap_record *rsrp;
> >> + struct kernel_cpustat *kcsp;
> >> +
> >> + kcsp = &kcpustat_cpu(cpu);
> >> +
> >> + rsrp = &rdp->snap_record;
> >> + rsrp->cputime_irq = kcpustat_field(kcsp, CPUTIME_IRQ, cpu);
> >> + rsrp->cputime_softirq = kcpustat_field(kcsp, CPUTIME_SOFTIRQ, cpu);
> >> + rsrp->cputime_system = kcpustat_field(kcsp, CPUTIME_SYSTEM, cpu);
> >> + rsrp->nr_hardirqs = kstat_cpu_irqs_sum(rdp->cpu);
> >> + rsrp->nr_softirqs = kstat_cpu_softirqs_sum(rdp->cpu);
> >
> > Getting the sum of all CPU's IRQs, with even two iterations on all of them, look
> > costly. So I have to ask: why is this information useful and why can't we deduce
> > it from other CPUs stall reports?
>
> Only the RCU stalled CPUs are recorded. Why all CPUs?
Bah, I misread kstat_cpu_softirqs_sum() kstat_cpu_irqs_sum() content. Sorry
about that, my brainfart... :-)
Powered by blists - more mailing lists