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: Tue, 14 May 2024 12:47:59 -0400
From: Waiman Long <longman@...hat.com>
To: Yury Norov <yury.norov@...il.com>, linux-kernel@...r.kernel.org,
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
 "Paul E. McKenney" <paulmck@...nel.org>,
 "Rafael J. Wysocki" <rafael@...nel.org>,
 Anna-Maria Behnsen <anna-maria@...utronix.de>,
 Ben Segall <bsegall@...gle.com>,
 Daniel Bristot de Oliveira <bristot@...hat.com>,
 Dietmar Eggemann <dietmar.eggemann@....com>,
 Frederic Weisbecker <frederic@...nel.org>,
 Imran Khan <imran.f.khan@...cle.com>, Ingo Molnar <mingo@...hat.com>,
 Johannes Weiner <hannes@...xchg.org>, Juri Lelli <juri.lelli@...hat.com>,
 Leonardo Bras <leobras@...hat.com>, Mel Gorman <mgorman@...e.de>,
 Peter Zijlstra <peterz@...radead.org>, Rik van Riel <riel@...riel.com>,
 Steven Rostedt <rostedt@...dmis.org>, Tejun Heo <tj@...nel.org>,
 Thomas Gleixner <tglx@...utronix.de>,
 Valentin Schneider <vschneid@...hat.com>,
 Vincent Guittot <vincent.guittot@...aro.org>,
 Zefan Li <lizefan.x@...edance.com>, cgroups@...r.kernel.org
Subject: Re: [PATCH 5/6] cgroup/cpuset: optimize
 cpuset_mems_allowed_intersects()


On 5/13/24 18:01, Yury Norov wrote:
> If the function is called with tsk1 == tsk2, we know for sure that their
> mems_allowed nodes do intersect, and so we can return immediately instead
> of checking the nodes content.
>
> Signed-off-by: Yury Norov <yury.norov@...il.com>
> ---
>   kernel/cgroup/cpuset.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
> index 4237c8748715..47ed206d4890 100644
> --- a/kernel/cgroup/cpuset.c
> +++ b/kernel/cgroup/cpuset.c
> @@ -5010,6 +5010,9 @@ EXPORT_SYMBOL_GPL(cpuset_mem_spread_node);
>   int cpuset_mems_allowed_intersects(const struct task_struct *tsk1,
>   				   const struct task_struct *tsk2)
>   {
> +	if (tsk1 == tsk2)
> +		return 1;
> +
>   	return nodes_intersects(tsk1->mems_allowed, tsk2->mems_allowed);
>   }
>   
Reviewed-by: Waiman Long <longman@...hat.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ