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]
Date:	Mon, 28 Oct 2013 11:00:55 +0800
From:	Wei Yang <weiyang@...ux.vnet.ibm.com>
To:	Tejun Heo <tj@...nel.org>
Cc:	Wei Yang <weiyang@...ux.vnet.ibm.com>, cl@...ux-foundation.org,
	linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] percpu: stop the loop when a cpu belongs to a new
 group

On Sun, Oct 27, 2013 at 08:30:08AM -0400, Tejun Heo wrote:
>On Mon, Oct 21, 2013 at 04:58:11PM +0800, Wei Yang wrote:
>> When a cpu belongs to a new group, there is no cpu has the same group id. This
>> means it can be assigned a new group id without checking with every others.
>> 
>> This patch does this optimiztion.
>
>Does this actually matter?  If so, it'd probably make a lot more sense
>to start inner loop at @cpu + 1 so that it becomes O(N).

One of the worst case in my mind:

CPU:        0    1    2    3    4    ...
Group:      0    1    2    3    4    ...
(sounds it is impossible in the real world)

Every time, when we encounter a new CPU and try to assign it to a group, we
found it belongs to a new group. The original logic will iterate on all old
CPUs again, while the new logic could skip this and assign it to a new group.

Again, this is a tiny change, which doesn't matters a lot.

BTW, I don't get your point for "start inner loop at @cpu+1".

The original logic is:
	loop 1:   0 - nr_cpus
	loop 2:      0 - (cpu - 1)

If you found one better approach to improve the logic, I believe all the users
will appreciate your efforts :-)

Thanks for your review and comments again ~

>
>Thanks.
>
>-- 
>tejun

-- 
Richard Yang
Help you, Help me

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ