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]
Date:   Mon, 31 Oct 2022 17:39:45 +0100
From:   Dietmar Eggemann <dietmar.eggemann@....com>
To:     Joel Fernandes <joel@...lfernandes.org>
Cc:     Connor O'Brien <connoro@...gle.com>, 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>,
        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>
Subject: Re: [RFC PATCH 07/11] sched: Add proxy execution

On 29/10/2022 05:31, Joel Fernandes wrote:
> Hello Dietmar,
> 
>> On Oct 24, 2022, at 6:13 AM, Dietmar Eggemann <dietmar.eggemann@....com> wrote:
>>
>> On 03/10/2022 23:44, Connor O'Brien wrote:
>>> From: Peter Zijlstra <peterz@...radead.org>

[...]

>>> +    put_prev_task(rq, next);
>>> +    if (curr_in_chain) {
>>> +        rq->proxy = rq->idle;
>>> +        set_tsk_need_resched(rq->idle);
>>> +        /*
>>> +         * XXX [juril] don't we still need to migrate @next to
>>> +         * @owner's CPU?
>>> +         */
>>> +        return rq->idle;
>>> +    }
>>
>> --> (1)
> 
> Sorry but what has this got to do with your comment below?

This was the place where fake_task was used in:

https://lkml.kernel.org/r/20181009092434.26221-6-juri.lelli@redhat.com

+migrate_task:
   ...
+	 }
+	 rq->proxy = &fake_task;           <-- !!!
+
+	 for (; p; p = p->blocked_task) {

>>> +    rq->proxy = rq->idle;

We use `rq->idle` now,

[...]

>>> +    rq_unpin_lock(rq, rf);
>>> +    raw_spin_rq_unlock(rq);
>>
>> Don't we run into rq_pin_lock()'s:
>>
>> SCHED_WARN_ON(rq->balance_callback && rq->balance_callback !=
>> &balance_push_callback)
>>
>> by releasing rq lock between queue_balance_callback(, push_rt/dl_tasks)
>> and __balance_callbacks()?
> 
> Apologies, I’m a bit lost here. The code you are responding to inline does not call rq_pin_lock, it calls rq_unpin_lock.  So what scenario does the warning trigger according to you?

True, but the code which sneaks in between proxy()'s
raw_spin_rq_unlock(rq) and raw_spin_rq_lock(rq) does.


__schedule()

  rq->proxy = next = pick_next_task()

    __pick_next_task()

      pick_next_task_rt()

        set_next_task_rt()

          rt_queue_push_tasks()

            queue_balance_callback(..., push_rt_tasks); <-- queue rt cb

  proxy()

    raw_spin_rq_unlock(rq)

                 ... <-- other thread does rq_lock_XXX(rq)
                                              raw_spin_rq_lock_XXX(rq)
                                                rq_pin_lock(rq)

    raw_spin_rq_lock(rq)

  context_switch()

     finish_task_switch()

       finish_lock_switch()

         __balance_callbacks(rq) <-- run rt cb here

  __balance_callbacks(rq)() <-- or run rt cb here

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ