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] [day] [month] [year] [list]
Date:	Fri, 20 Mar 2009 15:04:09 +0100
From:	Oleg Nesterov <oleg@...hat.com>
To:	Miklos Szeredi <miklos@...redi.hu>
Cc:	roland@...hat.com, peterz@...radead.org, efault@....de,
	rjw@...k.pl, jdike@...toit.com, mingo@...e.hu,
	user-mode-linux-devel@...ts.sourceforge.net,
	linux-kernel@...r.kernel.org
Subject: Re: [patch] fix uml slowness caused by ptrace preemption bug on
	host

On 03/20, Miklos Szeredi wrote:
>
> I'm no scheduler expert either.

neither me ;)

> --- linux.git.orig/kernel/sched.c	2009-03-18 12:53:47.000000000 +0100
> +++ linux.git/kernel/sched.c	2009-03-20 08:58:13.000000000 +0100
> @@ -4629,7 +4629,8 @@ asmlinkage void __sched preempt_schedule
>  	 * If there is a non-zero preempt_count or interrupts are disabled,
>  	 * we do not want to preempt the current task. Just return..
>  	 */
> -	if (likely(ti->preempt_count || irqs_disabled()))
> +	if (likely(ti->preempt_count || irqs_disabled() ||
> +		   current->state != TASK_RUNNING))

But this was specially designed to allow to preempt !TASK_RUNNING tasks,
note the "if (prev->state && !(preempt_count() & PREEMPT_ACTIVE))" in
schedule().

Perhaps "|| current->state == TASK_TRACED" makes more sense, TASK_TRACED
is special because we know we are going to schedule really soon. But I think
your previous patch is better, imho we should change preempt_schedule() to
fix the very specific problem with ptrace_notify().

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ