From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: zyhtheonly@gmail.com, zyhtheonly@yeah.net
Cc: tglx@linutronix.de, rostedt@goodmis.org, mingo@redhat.com,
Venkatesh Pallipadi <venki@google.com>,
peterz@infradead.org, juri.lelli@redhat.com,
vincent.guittot@linaro.org, linux-kernel@vger.kernel.org,
dietmar.eggemann@arm.com, bsegall@google.com, mgorman@suse.de,
bristot@redhat.com, vschneid@redhat.com
Subject: Re: [PATCH v3] sched/cputime: let ktimers align with ksoftirqd in accounting CPUTIME_SOFTIRQ
Date: Fri, 1 Dec 2023 17:16:40 +0100 [thread overview]
Message-ID: <20231201161640.Z0cJLUi3@linutronix.de> (raw)
In-Reply-To: <20231201080522.GA31309@didi-ThinkCentre-M930t-N000>
On 2023-12-01 16:05:41 [+0800], tiozhang wrote:
> In CONFIG_PREEMPT_RT kernel, ktimers also calls __do_softirq,
> so when accounting CPUTIME_SOFTIRQ, ktimers need to be accounted the same
> as ksoftirqd.
I still don't understand why this is a good thing and why want to align
it with ksoftirqd and what breaks if we don't.
This "skip ksoftirqd for accounting" has been added in commit
b52bfee445d31 ("sched: Add IRQ_TIME_ACCOUNTING, finer accounting of irq time")
At this point (v2.6.37) it had no accounting of time spent in ksoftirqd as
SOFTIRQ time. This was then fixed/ added by commit
414bee9ba613a ("softirqs: Account ksoftirqd time as cpustat softirq")
which went in v2.6.39. It started accounting it when it was noticed by
the tick. So it is less accurate. The "benefit" seems to be that this
accounting pops up in /proc/stat. As per-CPU or overall.
I *guess* this was to align the softirqs which occur at the end of an
interrupt with those which were outsourced to ksoftirqd because they
took too long. This would patch the wording
… wanted to see more complete solution in not accounting irq
processing time to tasks at all.
https://lore.kernel.org/all/1284688596-6731-1-git-send-email-venki@google.com/
Or it tried to preserve the current status.
A different account occurs for SOFTIRQs if they occur as port of
hardirq and are maybe deferred to ksoftirqd vs a task raising softirqs
on their own like packet over loopback.
Don't see the benefit that but this is my interpretation based on what
it does.
This was v2.6.39. Since then we got threaded interrupts (also v2.6.39)
or threaded-NAPI which utilise mostly the same mechanism as ksoftirqd
but are treated differently. I don't see why ktimers should align with
ksoftirqd and honestly and I don't understand why ksoftirqd had to be
excluded to in the first place.
Sorry, but I would need to go on than this.
> Signed-off-by: tiozhang <tiozhang@didiglobal.com>
Sebastian
next prev parent reply other threads:[~2023-12-01 16:16 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-24 6:34 [PATCH] sched/cputime: exclude ktimer threads in irqtime_account_irq tiozhang
2023-11-27 18:07 ` Steven Rostedt
2023-11-30 9:41 ` [PATCH v2] sched/cputime: exclude ktimers " tiozhang
2023-11-30 12:00 ` Sebastian Andrzej Siewior
2023-12-01 7:27 ` Yuanhan Zhang
2023-12-01 7:32 ` Sebastian Andrzej Siewior
2023-12-01 8:05 ` [PATCH v3] sched/cputime: let ktimers align with ksoftirqd in accounting CPUTIME_SOFTIRQ tiozhang
2023-12-01 16:16 ` Sebastian Andrzej Siewior [this message]
2023-12-02 10:28 ` Yuanhan Zhang
2023-12-05 15:31 ` Sebastian Andrzej Siewior
2023-12-07 10:43 ` Yuanhan Zhang
2023-12-07 15:35 ` Steven Rostedt
2023-12-07 17:19 ` Yuanhan Zhang
2023-12-07 18:18 ` Steven Rostedt
2023-12-08 9:26 ` Sebastian Andrzej Siewior
2023-12-11 12:02 ` [PATCH v4] sched/cputime: account ksoftirqd's time on SYSTEM in PREEMPT_RT Tio Zhang
2023-12-15 18:30 ` [PATCH v3] sched/cputime: let ktimers align with ksoftirqd in accounting CPUTIME_SOFTIRQ Yuanhan Zhang
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=20231201161640.Z0cJLUi3@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=venki@google.com \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=zyhtheonly@gmail.com \
--cc=zyhtheonly@yeah.net \
/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®