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] [day] [month] [year] [list]
Date:	Wed, 6 Jan 2010 02:35:53 -0800 (PST)
From:	David Rientjes <rientjes@...gle.com>
To:	H Hartley Sweeten <hartleys@...ionengravers.com>
cc:	Linux Kernel <linux-kernel@...r.kernel.org>,
	akpm@...ux-foundation.org, bfields@...ldses.org
Subject: RE: [PATCH] nodemask.h: change any_online_node() to a static
 inline

On Tue, 5 Jan 2010, H Hartley Sweeten wrote:

> > Could you simply remove any_online_node() and replace its callers with 
> > first_node(node_online_map) instead?
> 
> No idea ;-)
> 
> My main intention with this patch was to quite some sparse noise in
> net/sunrpc/svc.c.  This seemed the cleanest way to do it.
> 

It certainly silents the warning, which is good, but it also leaves behind 
a macro that can simply be removed and reimplemented with 
first_node(node_online_map) given the current use cases.

> It looks like any_online_node is, currently, only called by:
> 
> arch/powerpc/mm/numa.c
>   3 places, twice setting a local int variable called 'nid' and once just
>   returning the 'node' from the macro.  All three call the marco as:
> 
> 	... any_online_node(NODE_MASK_ALL);
> 

NODE_MASK_ALL is a nodemask_t with all bits set, so this will simply 
return the first nid where node_online(nid) is true.  That's equivalent to 
first_node(node_online_map).

> net/sunrpc/svc.c
>   1 place, setting a local unsigned int variable called 'node'.  Calls the
>   macro as:
> 
> 	... any_online_node(node_online_map);
> 

Same thing, except this doesn't require any iteration since node_online() 
for the first bit in node_online_map will always be true.

> I really don't know if the macro could be replaced by first_node(node_online_map).
> 

It can, so I think an even better step would be to remove 
any_online_node() completely and convert the callers you've identified to 
use the new implementation.

Thanks!
--
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