lkml.org 
[lkml]   [2020]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH -tip 23/32] sched: Add a per-thread core scheduling interface
    From
    Date
    On 12/2/20 4:47 PM, Chris Hyser wrote:

    > + get_task_struct(task);
    > +
    > + /*
    > + * Check if this process has the right to modify the specified
    > + * process. Use the regular "ptrace_may_access()" checks.
    > + */
    > + if (!ptrace_may_access(task, PTRACE_MODE_READ_REALCREDS)) {
    > + rcu_read_unlock();
    > + err = -EPERM;
    > + goto out;
    > + }
    > + rcu_read_unlock();
    > +
    > + if (flags == PR_SCHED_CORE_CLEAR) {
    > + dest = task;
    > + src = NULL;
    > + } else if (flags == PR_SCHED_CORE_SHARE_TO) {
    > + dest = task;
    > + src = current;
    > + } else if (flags == PR_SCHED_CORE_SHARE_FROM) {
    > + dest = current;
    > + src = task;
    > + }

    I should have put in an else clause to catch bad input.

    > +
    > + err = sched_core_share_tasks(dest, src);
    > out:
    > if (task)
    > put_task_struct(task);

    \
     
     \ /
      Last update: 2020-12-03 00:19    [W:4.550 / U:0.040 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site