lkml.org 
[lkml]   [2021]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 4/9] sched: Default core-sched policy
From
Date
On 4/21/21 9:33 AM, Peter Zijlstra wrote:
> On Thu, Apr 01, 2021 at 03:10:16PM +0200, Peter Zijlstra wrote:
>> Implement default core scheduling policy.
>>
>> - fork() / clone(): inherit cookie from parent
>> - exec(): if cookie then new cookie
>>
>> Did that exec() thing want to change cookie on suid instead, just like
>> perf_event_exit_task() ?
>
> Talk to me about that exec() thing; I still think it's weird. Did we
> just want to drop cookie on suid instead?
>

The choices for fork and exec were for security. A forked process or thread gets a copy because the code is "trusted",
but execed code is not by default (that was the policy choice) and so it gets a new cookie. Dropping the cookie on suid
was not considered (an oversight on my part), but seems like a good idea, but I think, also orthogonal.

The biggest issue with a new cookie on exec is that makes it difficult to construct a large process tree of all the same
cookies like the cgroup interface does. If we remove the cgroup interface, we either need to remove the "new cookie on
exec" (inherit cookie from parent from fork) or provide a global/per-task policy for controlling that. Probably easiest
to just drop it.

-chrish

\
 
 \ /
  Last update: 2021-04-21 16:34    [W:0.179 / U:1.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site