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]
Message-Id: <1263849258.3667.43.camel@achroite.uk.solarflarecom.com>
Date:	Mon, 18 Jan 2010 21:14:18 +0000
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Jiri Pirko <jpirko@...hat.com>
Cc:	linux-kernel@...r.kernel.org, davem@...emloft.net,
	netdev@...r.kernel.org
Subject: Re: [PATCH] list.h: add list_for_each_struct_entry macro

On Mon, 2010-01-18 at 22:07 +0100, Jiri Pirko wrote:
> Mon, Jan 18, 2010 at 06:17:13PM CET, bhutchings@...arflare.com wrote:
[...]
> >#define list_for_each_struct_entry(pos, head, type, posmember, member)	     \
> >	for (pos = list_empty(head) ? NULL :				     \
> >		&list_first_entry(head, type, member)->posmember;	     \
> >	     prefetch(container_of(pos, type, posmember)->member.next), pos; \
> >	     pos = list_is_last(&container_of(pos, type, posmember)->member, \
> >				head) ?	NULL :				     \
> >		&list_entry(container_of(pos, type, posmember)->member.next, \
> >			    type, member)->posmember)
> >
> 
> At the first glance, this would take even more cputime for lists longer
> than 2 or so, wouldn't it?

If you're concerned about speed, measure it, don't guess.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ