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] [day] [month] [year] [list]
Date:	Wed, 12 Mar 2008 10:27:30 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Oleg Nesterov <oleg@...sign.ru>, Christoph Hellwig <hch@....de>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	linux-kernel@...r.kernel.org
Subject: Re: Q: (stupid) can't we "fix" hlist_for_each_entry() ?

On Wed, 12 Mar 2008 10:48:50 +0100 Peter Zijlstra <peterz@...radead.org> wrote:

> On Wed, 2008-03-12 at 11:12 +0300, Oleg Nesterov wrote:
> > hlist_for_each_entry/hlist_for_each_entry_rcu doesn't actually need 4
> > arguments, it could be
> > 
> > #define hlist_for_each_entry_rcu(pos, head, member)		 			\
> > 	for (pos = hlist_entry((head)->first, typeof(*(pos)), member);			\
> > 	     rcu_dereference(pos) != hlist_entry(NULL, typeof(*(pos)), member) &&	\
> > 		({ prefetch((pos)->member.next); 1; });					\
> > 	     (pos) = hlist_entry((pos)->member.next, typeof(*(pos)), member))
> > 
> > Or,
> > 
> > #define hlist_for_each_entry_rcu(pos, head, member)		 			\
> > 	for (pos = (void*)(head)->first;						\
> > 	     rcu_dereference(pos) && ({ prefetch(((hlist_node*)pos)->next); 1; }) &&	\
> > 		({ (pos) = hlist_entry((void*)(pos), typeof(*(pos)), member)); 1; });	\
> > 	     (pos) = (void*)(pos)->member.next)
> > 
> > Q: is it worth "fixing" ?
> 
> I'm in favour.
> 
> > If yes, what is the "right" way to do this? These macros are spread all over
> > the kernel...
> 
> The usual way would be to prepare a git tree for Linus to pull right
> after -rc1 I think was the best point, and at the same time supply
> Andrew with a bunch of patches fixing up the various users in his tree.

That, or create new functions with new names, migrate over to them
piecemeal and later remove the old functions.

It's a bit of a problem that there is no alternative name.

eh, send over the jumbopatch after 2.6.25 is released - I'll take care of it.
--
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