Re: [PATCH v8 01/16] hashtable: introduce a small and naive hashtable

2012-11-01 Thread Sasha Levin
On Tue, Oct 30, 2012 at 10:23 PM, Linus Torvalds wrote: > On Tue, Oct 30, 2012 at 6:36 PM, Sasha Levin wrote: >> >> I can either rebase that on top of mainline, or we can ask maintainers >> to take it to their own trees if you take only 01/16 into mainline. >> What would you prefer? > > I don't r

RE: [PATCH v8 01/16] hashtable: introduce a small and naive hashtable

2012-10-31 Thread David Laight
> > > On Tue, Oct 30, 2012 at 02:45:57PM -0400, Sasha Levin wrote: > > >> +/* Use hash_32 when possible to allow for fast 32bit hashing in 64bit > > >> kernels. */ > > >> +#define hash_min(val, bits) > > >> \ > > >> +({

Re: [dm-devel] [PATCH v8 01/16] hashtable: introduce a small and naive hashtable

2012-10-31 Thread George Spelvin
Tejun Heo wrote: >> +#define hash_min(val, bits) \ >> +({ \ >> +sizeof(val) <= 4 ? \ >> +hash_32(val, bits) :

Re: [PATCH v8 01/16] hashtable: introduce a small and naive hashtable

2012-10-30 Thread Linus Torvalds
On Tue, Oct 30, 2012 at 8:24 PM, Al Viro wrote: > > Oh, well... there go my blackmail plans ;-) Seriously, though, I'm at loss > regarding several embedded architectures - arch/score, in particular, > seems to be completely orphaned. Don't worry about it. Do a best-effort, and if nobody ever rea

Re: [PATCH v8 01/16] hashtable: introduce a small and naive hashtable

2012-10-30 Thread Al Viro
On Tue, Oct 30, 2012 at 07:48:19PM -0700, Linus Torvalds wrote: > On Tue, Oct 30, 2012 at 7:24 PM, Al Viro wrote: > > > > BTW, how serious have you been back at KS when you were talking about > > pull requests killing a thousand of lines of code being acceptable > > at any point in the cycle? > >

Re: [PATCH v8 01/16] hashtable: introduce a small and naive hashtable

2012-10-30 Thread Linus Torvalds
On Tue, Oct 30, 2012 at 7:24 PM, Al Viro wrote: > > BTW, how serious have you been back at KS when you were talking about > pull requests killing a thousand of lines of code being acceptable > at any point in the cycle? Well... I'm absolutely a lot more open to pull requests that kill code than n

Re: [PATCH v8 01/16] hashtable: introduce a small and naive hashtable

2012-10-30 Thread Al Viro
On Tue, Oct 30, 2012 at 06:25:46PM -0700, Linus Torvalds wrote: > But whatever. This series has gotten way too much bike-shedding > anyway. I think it should just be applied, since it does remove lines > of code overall. I'd even possibly apply it to mainline, but it seems > to be against linux-ne

Re: [PATCH v8 01/16] hashtable: introduce a small and naive hashtable

2012-10-30 Thread Linus Torvalds
On Tue, Oct 30, 2012 at 6:36 PM, Sasha Levin wrote: > > I can either rebase that on top of mainline, or we can ask maintainers > to take it to their own trees if you take only 01/16 into mainline. > What would you prefer? I don't really care deeply. The only reason to merge it now would be to avo

Re: [PATCH v8 01/16] hashtable: introduce a small and naive hashtable

2012-10-30 Thread Sasha Levin
Hi Linus, > But whatever. This series has gotten way too much bike-shedding > anyway. I think it should just be applied, since it does remove lines > of code overall. I'd even possibly apply it to mainline, but it seems > to be against linux-next. Yup, I switched to using -next because I've been

Re: [PATCH v8 01/16] hashtable: introduce a small and naive hashtable

2012-10-30 Thread Steven Rostedt
On Tue, 2012-10-30 at 18:25 -0700, Linus Torvalds wrote: > On Tue, Oct 30, 2012 at 6:16 PM, Steven Rostedt wrote: > > > > ({\ > > sizeof(val) <= 4 ? hash_32(val, bits) : hash_long(val, bits); \ > > }) > > > > Is the better

Re: [PATCH v8 01/16] hashtable: introduce a small and naive hashtable

2012-10-30 Thread Linus Torvalds
On Tue, Oct 30, 2012 at 6:16 PM, Steven Rostedt wrote: > > ({\ > sizeof(val) <= 4 ? hash_32(val, bits) : hash_long(val, bits); \ > }) > > Is the better way to go. We are C programmers, we like to see the ?: on > a single l

Re: [PATCH v8 01/16] hashtable: introduce a small and naive hashtable

2012-10-30 Thread Steven Rostedt
On Tue, 2012-10-30 at 20:33 -0400, Sasha Levin wrote: > On Tue, Oct 30, 2012 at 5:42 PM, Tejun Heo wrote: > > Hello, > > > > Just some nitpicks. > > > > On Tue, Oct 30, 2012 at 02:45:57PM -0400, Sasha Levin wrote: > >> +/* Use hash_32 when possible to allow for fast 32bit hashing in 64bit > >> ke

Re: [PATCH v8 01/16] hashtable: introduce a small and naive hashtable

2012-10-30 Thread Sasha Levin
On Tue, Oct 30, 2012 at 8:51 PM, Jim Rees wrote: > Sasha Levin wrote: > > On Tue, Oct 30, 2012 at 5:42 PM, Tejun Heo wrote: > > Hello, > > > > Just some nitpicks. > > > > On Tue, Oct 30, 2012 at 02:45:57PM -0400, Sasha Levin wrote: > >> +/* Use hash_32 when possible to allow for fas

Re: [PATCH v8 01/16] hashtable: introduce a small and naive hashtable

2012-10-30 Thread Jim Rees
Sasha Levin wrote: On Tue, Oct 30, 2012 at 5:42 PM, Tejun Heo wrote: > Hello, > > Just some nitpicks. > > On Tue, Oct 30, 2012 at 02:45:57PM -0400, Sasha Levin wrote: >> +/* Use hash_32 when possible to allow for fast 32bit hashing in 64bit kernels. */ >> +#define hash_min(val, b

Re: [PATCH v8 01/16] hashtable: introduce a small and naive hashtable

2012-10-30 Thread Sasha Levin
On Tue, Oct 30, 2012 at 5:42 PM, Tejun Heo wrote: > Hello, > > Just some nitpicks. > > On Tue, Oct 30, 2012 at 02:45:57PM -0400, Sasha Levin wrote: >> +/* Use hash_32 when possible to allow for fast 32bit hashing in 64bit >> kernels. */ >> +#define hash_min(val, bits)

Re: [PATCH v8 01/16] hashtable: introduce a small and naive hashtable

2012-10-30 Thread Tejun Heo
Hello, Just some nitpicks. On Tue, Oct 30, 2012 at 02:45:57PM -0400, Sasha Levin wrote: > +/* Use hash_32 when possible to allow for fast 32bit hashing in 64bit > kernels. */ > +#define hash_min(val, bits) > \ > +({

Re: [PATCH v8 01/16] hashtable: introduce a small and naive hashtable

2012-10-30 Thread Mathieu Desnoyers
* Sasha Levin (levinsasha...@gmail.com) wrote: > This hashtable implementation is using hlist buckets to provide a simple > hashtable to prevent it from getting reimplemented all over the kernel. > > Signed-off-by: Sasha Levin Reviewed-by: Mathieu Desnoyers > --- > > Changes from v8: > > -

[PATCH v8 01/16] hashtable: introduce a small and naive hashtable

2012-10-30 Thread Sasha Levin
This hashtable implementation is using hlist buckets to provide a simple hashtable to prevent it from getting reimplemented all over the kernel. Signed-off-by: Sasha Levin --- Changes from v8: - Addressed comments from Tejun Heo and Mathieu Desnoyers. include/linux/hashtable.h | 196 +++