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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53164824.3000704@oracle.com>
Date:	Tue, 04 Mar 2014 14:39:48 -0700
From:	Khalid Aziz <khalid.aziz@...cle.com>
To:	"H. Peter Anvin" <hpa@...or.com>, tglx@...utronix.de,
	Ingo Molnar <mingo@...nel.org>, peterz@...radead.org,
	akpm@...ux-foundation.org, andi.kleen@...el.com, rob@...dley.net,
	viro@...iv.linux.org.uk, oleg@...hat.com
CC:	linux-kernel@...r.kernel.org
Subject: Re: [RFC] [PATCH] Pre-emption control for userspace

On 03/04/2014 02:12 PM, H. Peter Anvin wrote:
>
> Shades of the Android wakelocks, no?
>
> This seems to effectively give userspace an option to turn preemptive
> multitasking into cooperative multitasking, which of course is
> unacceptable for a privileged process (the same reason why unprivileged
> processes aren't allowed to run at above-normal priority, including RT
> priority.)
>
> I have several issues with this interface:
>
> 1. First, a process needs to know if it *should* have been preempted
> before it calls sched_yield().  So there needs to be a second flag set
> by the scheduler when granting amnesty.

Good idea. I like it. I will add it.

>
> 2. A process which fails to call sched_yield() after being granted
> amnesty must be penalized.

I agree. Is it fair to say that such a process sees the penalty by being 
charged that extra timeslice and being pushed to the right side of RB 
tree since its p->se.vruntime would have gone up, which then delays the 
time when it can get CPU again? I am open to adding a more explicit 
penalty - maybe deny its next preemption delay request if it failed to 
call sched_yield() the last time when it should have?

>
> 3. I'm not keen on occupying a full page for this.  I'm wondering if
> doing a pointer into user space, futex-style, might make more sense.
> The downside, of course, is what happens if the page being pointed to is
> swapped out.

Using a full page for what is effectively a single bit flag does not sit 
well with me either. Doing it through proc forces minimum size of a page 
(please correct me there if I am wrong). I will explore your idea some 
more to see if that can be made to work.

>
> Keep in mind this HAS to be per thread.
>

Thanks, hpa!

--
Khalid

--
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