Re: [PATCH -tip 23/32] sched: Add a per-thread core scheduling interface

From: Peter Zijlstra
Date: Wed Nov 25 2020 - 08:09:16 EST


On Tue, Nov 17, 2020 at 06:19:53PM -0500, Joel Fernandes (Google) wrote:
> +/* Called from prctl interface: PR_SCHED_CORE_SHARE */
> +int sched_core_share_pid(pid_t pid)
> +{
> + struct task_struct *task;
> + int err;
> +
> + if (pid == 0) { /* Recent current task's cookie. */
> + /* Resetting a cookie requires privileges. */
> + if (current->core_task_cookie)
> + if (!capable(CAP_SYS_ADMIN))
> + return -EPERM;

Coding-Style fail.

Also, why?!? I realize it is true for your case, because hardware fail.
But in general this just isn't true. This wants to be some configurable
policy.