[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [dm-devel] [PATCH v3 01/17] hashtable: introduce a small and naive hashtable
- From: "David Laight" <David Laight ACULAB COM>
- To: "Sasha Levin" <levinsasha928 gmail com>, "Mathieu Desnoyers" <mathieu desnoyers efficios com>
- Cc: snitzer redhat com, fweisbec gmail com, Trond Myklebust netapp com, bfields fieldses org, paul gortmaker windriver com, dm-devel redhat com, agk redhat com, aarcange redhat com, rds-devel oss oracle com, eric dumazet gmail com, venkat x venkatsubra oracle com, ccaulfie redhat com, mingo elte hu, dev openvswitch org, jesse nicira com, josh joshtriplett org, Steven Rostedt <rostedt goodmis org>, lw cn fujitsu com, teigland redhat com, axboe kernel dk, linux-nfs vger kernel org, edumazet google com, linux-mm kvack org, Pedro Alves <palves redhat com>, linux-kernel vger kernel org, ejt redhat com, ebiederm xmission com, netdev vger kernel org, Tejun Heo <tj kernel org>, akpm linux-foundation org, torvalds linux-foundation org, davem davemloft net
- Subject: Re: [dm-devel] [PATCH v3 01/17] hashtable: introduce a small and naive hashtable
- Date: Thu, 6 Sep 2012 15:36:52 +0100
> My solution to making 'break' work in the iterator is:
>
> for (bkt = 0, node = NULL; bkt < HASH_SIZE(name) && node ==
NULL; bkt++)
> hlist_for_each_entry(obj, node, &name[bkt], member)
I'd take a look at the generated code.
Might come out a bit better if the condition is changed to:
node == NULL && bkt < HASH_SIZE(name)
you might find the compiler always optimises out the
node == NULL comparison.
(It might anyway, but switching the order gives it a better
chance.)
David
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]