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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEXW_YRBYJU-iwF6FMGm=Tv5Tqw1CW3aONU6eRzThF9yjEFtJQ@mail.gmail.com>
Date:   Fri, 14 Oct 2022 13:01:35 -0400
From:   Joel Fernandes <joel@...lfernandes.org>
To:     "Connor O'Brien" <connoro@...gle.com>
Cc:     linux-kernel@...r.kernel.org, kernel-team@...roid.com,
        John Stultz <jstultz@...gle.com>,
        Joel Fernandes <joelaf@...gle.com>,
        Qais Yousef <qais.yousef@....com>,
        Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Juri Lelli <juri.lelli@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        Valentin Schneider <vschneid@...hat.com>,
        Will Deacon <will@...nel.org>,
        Waiman Long <longman@...hat.com>,
        Boqun Feng <boqun.feng@...il.com>,
        "Paul E . McKenney" <paulmck@...nel.org>,
        Youssef Esmat <youssefesmat@...gle.com>
Subject: Re: [RFC PATCH 05/11] sched: Split scheduler execution context

Hi,
Just on the yield bits (my opinion):

On Mon, Oct 3, 2022 at 5:45 PM Connor O'Brien <connoro@...gle.com> wrote:
>
> From: Peter Zijlstra <peterz@...radead.org>
>
> Lets define the scheduling context as all the scheduler state in
> task_struct and the execution context as all state required to run the
> task.
>
> Currently both are intertwined in task_struct. We want to logically
> split these such that we can run the execution context of one task
> with the scheduling context of another.
>
> To this purpose introduce rq::proxy to point to the task_struct used
> for scheduler state and preserve rq::curr to denote the execution
> context.
>
> XXX connoro: A couple cases here may need more discussion:
> - sched_yield() and yield_to(): whether we call the sched_class
>   methods for rq->curr or rq->proxy, there seem to be cases where
>   proxy exec could cause a yielding mutex owner to run again
>   immediately. How much of a concern is this?

A task chosen to run again after calling yield is not unprecedented.
>From sched_yield manpage:
"If the calling thread is the only thread in the highest priority list
at that time, it will continue to run after a call to sched_yield()."

[...]
> @@ -8276,6 +8300,11 @@ static void do_sched_yield(void)
>         rq = this_rq_lock_irq(&rf);
>
>         schedstat_inc(rq->yld_count);
> +       /*
> +        * XXX how about proxy exec?
> +        * If a task currently proxied by some other task yields, should we
> +        * apply the proxy or the current yield "behaviour" ?
> +        */
>         current->sched_class->yield_task(rq);

I think we should keep it simple and keep the existing yield behavior.
If there was no priority inversion, and lock owner called yield, why
should it behave any differently?

>
>         preempt_disable();
> @@ -8625,6 +8654,10 @@ EXPORT_SYMBOL(yield);
>   */
>  int __sched yield_to(struct task_struct *p, bool preempt)
>  {
> +       /*
> +        * XXX what about current being proxied?
> +        * Should we use proxy->sched_class methods in this case?
> +        */
>         struct task_struct *curr = current;
>         struct rq *rq, *p_rq;
>         unsigned long flags;

Ditto.

> @@ -8984,7 +9017,7 @@ void __init init_idle(struct task_struct *idle, int cpu)
[...]

Thanks,

 - Joel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ