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 10:42:46 +0200
From: Thomas Gleixner <tglx@...utronix.de>
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>, Valentin
 Schneider <vschneid@...hat.com>, Vincent Guittot
 <vincent.guittot@...aro.org>, Waiman Long <longman@...hat.com>, Yury Norov
 <yury.norov@...il.com>, Zefan Li <lizefan.x@...edance.com>,
 cgroups@...r.kernel.org
Subject: Re: [PATCH 6/6] tick/common: optimize cpumask_equal() usage

On Tue, May 14 2024 at 10:31, Thomas Gleixner wrote:
> On Mon, May 13 2024 at 15:01, Yury Norov wrote:
>> Some functions in the file call cpumask_equal() with src1p == src2p.
>> We can obviously just skip comparison entirely in this case.
>>
>> This patch fixes cpumask_equal invocations when boot-test or LTP detect
>> such condition.
>
> Please write your changelogs in imperative mood.
>
> git grep 'This patch' Documentation/process/
>
> Also please see Documentation/process/maintainer-tip.rst
>
>> Signed-off-by: Yury Norov <yury.norov@...il.com>
>> ---
>>  kernel/time/tick-common.c | 15 +++++++++++----
>>  1 file changed, 11 insertions(+), 4 deletions(-)
>>
>> diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
>> index d88b13076b79..b31fef292833 100644
>> --- a/kernel/time/tick-common.c
>> +++ b/kernel/time/tick-common.c
>> @@ -253,7 +253,8 @@ static void tick_setup_device(struct tick_device *td,
>>  	 * When the device is not per cpu, pin the interrupt to the
>>  	 * current cpu:
>>  	 */
>> -	if (!cpumask_equal(newdev->cpumask, cpumask))
>> +	if (newdev->cpumask != cpumask &&
>> +			!cpumask_equal(newdev->cpumask, cpumask))
>>  		irq_set_affinity(newdev->irq, cpumask);
>
> I'm not seeing the benefit. This is slow path setup code so the extra
> comparison does not really buy anything aside of malformatted line
> breaks.

Instead of sprinkling these conditional all over the place, can't you
just do the obvious and check for ptr1 == ptr2 in bitmap_copy() and
bitmap_equal()?

Thanks,

	tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ