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: <20241202103228.GM24400@noisy.programming.kicks-ass.net>
Date: Mon, 2 Dec 2024 11:32:28 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Ryo Takakura <ryotkkr98@...il.com>
Cc: mingo@...hat.com, will@...nel.org, longman@...hat.com,
	boqun.feng@...il.com, bigeasy@...utronix.de, clrkwllms@...nel.org,
	rostedt@...dmis.org, tglx@...utronix.de,
	linux-kernel@...r.kernel.org, linux-rt-devel@...ts.linux.dev
Subject: Re: [PATCH] lockdep: Fix wait context check on softirq for PREEMPT_RT

On Mon, Dec 02, 2024 at 10:20:17AM +0900, Ryo Takakura wrote:
> Commit 0c1d7a2c2d32 ("lockdep: Remove softirq accounting on
> PREEMPT_RT.") stopped updating @softirq_context on PREEMPT_RT
> to ignore "inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage"
> as the report accounts softirq context which PREEMPT_RT doesn't
> have to.
> 
> However, wait context check still needs to report mutex usage
> within softirq, even when its threaded on PREEMPT_RT. The check
> is failing to report the usage as task_wait_context() checks if
> its in softirq by referencing @softirq_context, ending up not 
> assigning the correct wait type of LD_WAIT_CONFIG for PREEMPT_RT's
> softirq.
> 
> [    0.184549]   | wait context tests |
> [    0.184549]   --------------------------------------------------------------------------
> [    0.184549]                                  | rcu  | raw  | spin |mutex |
> [    0.184549]   --------------------------------------------------------------------------
> [    0.184550]                in hardirq context:  ok  |  ok  |  ok  |  ok  |
> [    0.185083] in hardirq context (not threaded):  ok  |  ok  |  ok  |  ok  |
> [    0.185606]                in softirq context:  ok  |  ok  |  ok  |FAILED|
> 
> Account softirq context but only when !PREEMPT_RT so that
> task_wait_context() returns LD_WAIT_CONFIG as intended.
> 
> Signed-off-by: Ryo Takakura <ryotkkr98@...il.com>
> 
> 
> ---
> 
> Hi! 
> 
> I wasn't able come up with a way to fix the wait context test while 
> keeping the commit 0c1d7a2c2d32 ("lockdep: Remove softirq accounting 
> on PREEMPT_RT.") without referencing @softirq_context...
> Hoping to get a feedback on it!
> 
> Also I wonder if the test can be skipped as I believe its taken care 
> by spinlock wait context test since the PREEMPT_RT's softirq context is 
> protected by local_lock which is mapped to rt_spinlock.

Right,.. so I remember talking about this with Boqun, and I think we
were going to 'fix' the test, but I can't quite remember.

Perhaps adding the local_lock to SOFTIRQ_ENTER?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ