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]
Date:   Wed, 22 Apr 2020 08:51:35 -0700
From:   "Paul E. McKenney" <paulmck@...nel.org>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     mingo@...nel.org, linux-kernel@...r.kernel.org, tglx@...utronix.de,
        rostedt@...dmis.org, qais.yousef@....com, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, dietmar.eggemann@....com,
        bsegall@...gle.com, mgorman@...e.de
Subject: Re: [PATCH 18/23] sched,locktorture: Convert to sched_set_fifo()

On Wed, Apr 22, 2020 at 01:27:37PM +0200, Peter Zijlstra wrote:
> Because SCHED_FIFO is a broken scheduler model (see previous patches)
> take away the priority field, the kernel can't possibly make an
> informed decision.
> 
> Effectively changes prio from 99 to 50.
> 
> Cc: paulmck@...nel.org
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> Reviewed-by: Ingo Molnar <mingo@...nel.org>

Reviewed-by: Paul E. McKenney <paulmck@...nel.org>

> ---
>  kernel/locking/locktorture.c |   10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> --- a/kernel/locking/locktorture.c
> +++ b/kernel/locking/locktorture.c
> @@ -436,8 +436,6 @@ static int torture_rtmutex_lock(void) __
>  
>  static void torture_rtmutex_boost(struct torture_random_state *trsp)
>  {
> -	int policy;
> -	struct sched_param param;
>  	const unsigned int factor = 50000; /* yes, quite arbitrary */
>  
>  	if (!rt_task(current)) {
> @@ -448,8 +446,7 @@ static void torture_rtmutex_boost(struct
>  		 */
>  		if (trsp && !(torture_random(trsp) %
>  			      (cxt.nrealwriters_stress * factor))) {
> -			policy = SCHED_FIFO;
> -			param.sched_priority = MAX_RT_PRIO - 1;
> +			sched_set_fifo(current);
>  		} else /* common case, do nothing */
>  			return;
>  	} else {
> @@ -462,13 +459,10 @@ static void torture_rtmutex_boost(struct
>  		 */
>  		if (!trsp || !(torture_random(trsp) %
>  			       (cxt.nrealwriters_stress * factor * 2))) {
> -			policy = SCHED_NORMAL;
> -			param.sched_priority = 0;
> +			sched_set_normal(current, 0);
>  		} else /* common case, do nothing */
>  			return;
>  	}
> -
> -	sched_setscheduler_nocheck(current, policy, &param);
>  }
>  
>  static void torture_rtmutex_delay(struct torture_random_state *trsp)
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ