From: Thomas Gleixner <tglx@linutronix.de>
To: Frederic Weisbecker <frederic@kernel.org>
Cc: qianjun.kernel@gmail.com, peterz@infradead.org, will@kernel.org,
luto@kernel.org, linux-kernel@vger.kernel.org,
laoar.shao@gmail.com, qais.yousef@arm.com, urezki@gmail.com
Subject: Re: [PATCH V7 4/4] softirq: Allow early break the softirq processing loop
Date: Sat, 26 Sep 2020 00:37:37 +0200 [thread overview]
Message-ID: <87imc1v5xq.fsf@nanos.tec.linutronix.de> (raw)
In-Reply-To: <20200924230811.GC19346@lenoir>
On Fri, Sep 25 2020 at 01:08, Frederic Weisbecker wrote:
> On Thu, Sep 24, 2020 at 05:37:42PM +0200, Thomas Gleixner wrote:
>> Subject: softirq; Prevent starvation of higher softirq vectors
>> From: Thomas Gleixner <tglx@linutronix.de>
>> Date: Thu, 24 Sep 2020 10:40:24 +0200
>>
>> From: Thomas Gleixner <tglx@linutronix.de>
>>
>> The early termination of the softirq processing loop can lead to starvation
>> of the higher numbered soft interrupt vectors because each run starts at
>> the lowest bit. If the loop terminates then the already processed bits can
>> be raised again before the next loop starts. If these lower bits run into
>> the termination again, then a re-raise might starve the higher bits forever.
>>
>> To prevent this, store the leftovers of the previous run in the upper 16
>> bit of the local softirq_pending storage and ensure that these are
>> processed before any newly raised bits are handled.
>>
>> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
>> ---
>> kernel/softirq.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++--------
>> 1 file changed, 50 insertions(+), 8 deletions(-)
>>
>> --- a/kernel/softirq.c
>> +++ b/kernel/softirq.c
>> @@ -259,11 +259,23 @@ static inline bool __softirq_needs_break
>> return need_resched() || __softirq_timeout(tbreak);
>> }
>>
>> +/*
>> + * local_softirq_pending() is split into two 16 bit words. The low word
>> + * contains the bits set by raise_softirq(), the high word contains pending
>> + * bits which have not been processed in an early terminated run. This is
>> + * required to prevent starvation of the higher numbered softirqs.
>> + */
>> +#define SIRQ_PREV_SHIFT 16
>
> Note that in the case of x86, irq_start.__softirq_pending is a u16.
>
> The origin is there: 9aee5f8a7e30330d0a8f4c626dc924ca5590aba5
> "x86/irq: Demote irq_cpustat_t::__softirq_pending to u16"
Bah, crap. I knew I that and wanted to fix it up but then forgot.
Thanks for reminding me of my slowly upcoming alzheimer!
next prev parent reply other threads:[~2020-09-25 22:37 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-15 11:56 [PATCH V7 0/4] Softirq:avoid large sched delay from the pending softirqs qianjun.kernel
2020-09-15 11:56 ` [PATCH V7 1/4] softirq: Use sched_clock() based timeout qianjun.kernel
2020-09-24 8:34 ` Thomas Gleixner
2020-09-15 11:56 ` [PATCH V7 2/4] softirq: Factor loop termination condition qianjun.kernel
2020-09-24 8:36 ` Thomas Gleixner
2020-09-24 12:31 ` Thomas Gleixner
2020-09-15 11:56 ` [PATCH V7 3/4] softirq: Rewrite softirq processing loop qianjun.kernel
2020-09-15 11:56 ` [PATCH V7 4/4] softirq: Allow early break the " qianjun.kernel
2020-09-24 15:37 ` Thomas Gleixner
2020-09-24 23:08 ` Frederic Weisbecker
2020-09-24 23:10 ` Frederic Weisbecker
2020-09-25 22:37 ` Thomas Gleixner [this message]
2020-09-25 0:42 ` Frederic Weisbecker
2020-09-25 22:42 ` Thomas Gleixner
2020-09-26 12:22 ` Frederic Weisbecker
2020-09-28 10:51 ` jun qian
2020-09-29 11:44 ` Frederic Weisbecker
2020-10-09 15:01 ` Qais Yousef
2020-10-13 10:43 ` Frederic Weisbecker
2020-10-13 12:40 ` Qais Yousef
2020-09-26 2:00 ` jun qian
2020-09-27 1:05 ` [softirq] 56c21abbe6: will-it-scale.per_process_ops -9.1% regression kernel test robot
2020-09-28 9:20 ` [PATCH V7 4/4] softirq: Allow early break the softirq processing loop Peter Zijlstra
2020-09-28 11:15 ` jun qian
2020-09-28 9:22 ` Peter Zijlstra
2020-09-28 10:09 ` Thomas Gleixner
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=87imc1v5xq.fsf@nanos.tec.linutronix.de \
--to=tglx@linutronix.de \
--cc=frederic@kernel.org \
--cc=laoar.shao@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=peterz@infradead.org \
--cc=qais.yousef@arm.com \
--cc=qianjun.kernel@gmail.com \
--cc=urezki@gmail.com \
--cc=will@kernel.org \
/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