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: <20190924152514.enzeuoo5a6o3mgqu@linutronix.de>
Date:   Tue, 24 Sep 2019 17:25:14 +0200
From:   Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To:     Scott Wood <swood@...hat.com>
Cc:     linux-rt-users@...r.kernel.org, linux-kernel@...r.kernel.org,
        "Paul E . McKenney" <paulmck@...ux.ibm.com>,
        Joel Fernandes <joel@...lfernandes.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Steven Rostedt <rostedt@...dmis.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Juri Lelli <juri.lelli@...hat.com>,
        Clark Williams <williams@...hat.com>
Subject: Re: [PATCH RT v3 3/5] sched: migrate_dis/enable: Use rt_invol_sleep

On 2019-09-24 08:53:43 [-0500], Scott Wood wrote:
> As I pointed out in the "[PATCH RT 6/8] sched: migrate_enable: Set state to
> TASK_RUNNING" discussion, we can get here inside the rtmutex code (e.g. from
> debug_rt_mutex_print_deadlock) where saved_state is already holding
> something -- plus, the waker won't have WF_LOCK_SLEEPER and therefore
> saved_state will get cleared anyway.

So let me drop the saved_state pieces and get back to it once I get to
the other thread (which you replied and I didn't realised until now).

Regarding the WF_LOCK_SLEEPER part. I think this works as expected.
Imagine:

CPU0						CPU1
spin_lock();
set_current_state(TASK_UNINTERRUPTIBLE);
…
spin_unlock()
 -> migrate_enable();
   -> stop_one_cpu();				<-- A)
other_func();					<-- B)
schedule();

So. With only CPU0 we enter schedule() with TASK_UNINTERRUPTIBLE because
the state gets preserved with the change I added (which is expected).
If CPU1 sends a wake_up() at A) then the saved_state gets overwritten
and we enter schedule() with TASK_RUNNING. Same happens if it is sent at
B) point which is outside of any migrate/spin lock related code. 

Was this clear or did I miss the point?

> -Scott

Sebastian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ