lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200924230811.GC19346@lenoir>
Date:   Fri, 25 Sep 2020 01:08:12 +0200
From:   Frederic Weisbecker <frederic@...nel.org>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     qianjun.kernel@...il.com, peterz@...radead.org, will@...nel.org,
        luto@...nel.org, linux-kernel@...r.kernel.org,
        laoar.shao@...il.com, qais.yousef@....com, urezki@...il.com
Subject: Re: [PATCH V7 4/4] softirq: Allow early break the softirq processing
 loop

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@...utronix.de>
> Date: Thu, 24 Sep 2020 10:40:24 +0200
> 
> From: Thomas Gleixner <tglx@...utronix.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@...utronix.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"

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ