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: <20220301201432.GL11184@worktop.programming.kicks-ass.net>
Date:   Tue, 1 Mar 2022 21:14:32 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc:     linux-kernel@...r.kernel.org, Ben Segall <bsegall@...gle.com>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Ingo Molnar <mingo@...hat.com>,
        Juri Lelli <juri.lelli@...hat.com>,
        Mel Gorman <mgorman@...e.de>,
        Steven Rostedt <rostedt@...dmis.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Vincent Guittot <vincent.guittot@...aro.org>
Subject: Re: [PATCH] sched: Make preempt_enable_no_resched() behave like
 preempt_enable() on PREEMPT_RT

On Tue, Mar 01, 2022 at 07:30:32PM +0100, Sebastian Andrzej Siewior wrote:
> From: Thomas Gleixner <tglx@...utronix.de>
> 
> Use the distinction that has been made earlier between
> preempt_enable_no_resched() and sched_preempt_enable_no_resched().
> sched_preempt_enable_no_resched() is used within the scheduler where an
> immediate schedule() follows. preempt_enable_no_resched() is used
> outside of the scheduler and an immediate schedule() invocation may not
> follow for other reasons.
> 
> The lack of an immediate schedule() invocation matters on PREEMPT_RT
> where it will introduce latencies while the scheduler expects a context
> switch.
> 
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
> ---
>  include/linux/preempt.h | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/preempt.h b/include/linux/preempt.h
> index b4381f255a5ca..582e43856a532 100644
> --- a/include/linux/preempt.h
> +++ b/include/linux/preempt.h
> @@ -210,7 +210,11 @@ do { \
>  	preempt_count_dec(); \
>  } while (0)
>  
> -#define preempt_enable_no_resched() sched_preempt_enable_no_resched()
> +#ifdef CONFIG_PREEMPT_RT
> +# define preempt_enable_no_resched() preempt_enable()
> +#else
> +# define preempt_enable_no_resched() sched_preempt_enable_no_resched()
> +#endif

Ignoring !x86 for a moment:

arch/x86/mm/kmmio.c:    preempt_enable_no_resched();
arch/x86/mm/kmmio.c:    preempt_enable_no_resched();
include/linux/preempt.h:#define sched_preempt_enable_no_resched() \
include/linux/preempt.h:#define preempt_enable_no_resched() sched_preempt_enable_no_resched()
include/linux/preempt.h:#define preempt_enable_no_resched_notrace() \
include/linux/preempt.h:#define sched_preempt_enable_no_resched()       barrier()
include/linux/preempt.h:#define preempt_enable_no_resched()             barrier()
include/linux/preempt.h:#define preempt_enable_no_resched_notrace()     barrier()
include/linux/preempt.h:#undef sched_preempt_enable_no_resched
include/linux/preempt.h:#undef preempt_enable_no_resched
include/linux/preempt.h:#undef preempt_enable_no_resched_notrace
kernel/sched/core.c:            preempt_enable_no_resched();
kernel/sched/core.c:                    preempt_enable_no_resched();
kernel/sched/core.c:            sched_preempt_enable_no_resched();
kernel/sched/core.c:    sched_preempt_enable_no_resched();
kernel/sched/core.c:            sched_preempt_enable_no_resched();
kernel/sched/core.c:            preempt_enable_no_resched_notrace();
kernel/sched/core.c:            preempt_enable_no_resched_notrace();
kernel/sched/core.c:            sched_preempt_enable_no_resched();
kernel/sched/core.c:    sched_preempt_enable_no_resched();
kernel/signal.c:                preempt_enable_no_resched();
kernel/smpboot.c:                       preempt_enable_no_resched();
lib/smp_processor_id.c: preempt_enable_no_resched_notrace();


Surely we can audit that... At a glance the proposed patch does more
harm than good. Only the kmmio case looks obviousl fail, but then IIRC
kmmio had worse problems.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ