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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251110183854.48b33b50@gandalf.local.home>
Date: Mon, 10 Nov 2025 18:38:54 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Yongliang Gao <leonylgao@...il.com>, Sebastian Andrzej Siewior
 <bigeasy@...utronix.de>
Cc: mhiramat@...nel.org, mathieu.desnoyers@...icios.com,
 linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org, Yongliang
 Gao <leonylgao@...cent.com>, Huang Cun <cunhuang@...cent.com>
Subject: Re: [PATCH] trace/pid_list: optimize pid_list->lock contention

On Wed, 15 Oct 2025 19:49:52 +0800
Yongliang Gao <leonylgao@...il.com> wrote:

> diff --git a/kernel/trace/pid_list.c b/kernel/trace/pid_list.c
> index 090bb5ea4a19..62082a4f60db 100644
> --- a/kernel/trace/pid_list.c
> +++ b/kernel/trace/pid_list.c
> @@ -138,14 +138,14 @@ bool trace_pid_list_is_set(struct trace_pid_list *pid_list, unsigned int pid)
>  	if (pid_split(pid, &upper1, &upper2, &lower) < 0)
>  		return false;
>  
> -	raw_spin_lock_irqsave(&pid_list->lock, flags);
> +	read_lock_irqsave(&pid_list->lock, flags);
>  	upper_chunk = pid_list->upper[upper1];
>  	if (upper_chunk) {
>  		lower_chunk = upper_chunk->data[upper2];
>  		if (lower_chunk)
>  			ret = test_bit(lower, lower_chunk->data);
>  	}
> -	raw_spin_unlock_irqrestore(&pid_list->lock, flags);
> +	read_unlock_irqrestore(&pid_list->lock, flags);
>  
>  	return ret;
>  }

Unfortunately you cannot do this because this is called while holding the
task pi_lock and rq locks. In PREEMPT_RT() the read/write_lock_* turn into
mutexes.

Sebastian, is there any equivalent of raw_read/write_locks() that can be
used?

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ