Re: [ovs-dev] [PATCH net-next 2/3] netlink: Convert netlink_lookup() to use RCU protected hash table

2014-08-04 Thread Sasha Levin
On 08/02/2014 05:47 AM, Thomas Graf wrote: > static void *netlink_seq_start(struct seq_file *seq, loff_t *pos) > - __acquires(nl_table_lock) > { > - read_lock(&nl_table_lock); > + rcu_read_lock(); > return *pos ? netlink_seq_socket_idx(seq, *pos - 1) : SEQ_START_TOKEN; > } I'm

[ovs-dev] [PATCH 00/16] generic hashtable implementation

2012-08-14 Thread Sasha Levin
the case where the hashtable is allocated statically, which is the common case. - A lot more places converted to use the new hashtable. Sasha Levin (16): hashtable: introduce a small and naive hashtable user_ns: use new hashtable implementation mm,ksm: use new hashtable implementation

[ovs-dev] [PATCH 01/16] hashtable: introduce a small and naive hashtable

2012-08-14 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 --- include/linux/hashtable.h | 284 + 1 files changed, 284 insertions(+), 0

[ovs-dev] [PATCH 02/16] user_ns: use new hashtable implementation

2012-08-14 Thread Sasha Levin
Switch user_ns to use the new hashtable implementation. This reduces the amount of generic unrelated code in user_ns. Signed-off-by: Sasha Levin --- kernel/user.c | 33 + 1 files changed, 13 insertions(+), 20 deletions(-) diff --git a/kernel/user.c b/kernel

[ovs-dev] [PATCH 03/16] mm,ksm: use new hashtable implementation

2012-08-14 Thread Sasha Levin
Switch ksm to use the new hashtable implementation. This reduces the amount of generic unrelated code in the ksm module. Signed-off-by: Sasha Levin --- mm/ksm.c | 33 +++-- 1 files changed, 15 insertions(+), 18 deletions(-) diff --git a/mm/ksm.c b/mm/ksm.c index

[ovs-dev] [PATCH 04/16] workqueue: use new hashtable implementation

2012-08-14 Thread Sasha Levin
Switch workqueues to use the new hashtable implementation. This reduces the amount of generic unrelated code in the workqueues. Signed-off-by: Sasha Levin --- kernel/workqueue.c | 86 +--- 1 files changed, 15 insertions(+), 71 deletions

[ovs-dev] [PATCH 05/16] mm/huge_memory: use new hashtable implementation

2012-08-14 Thread Sasha Levin
ssing it. Signed-off-by: Sasha Levin --- mm/huge_memory.c | 57 ++--- 1 files changed, 15 insertions(+), 42 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 57c4b93..a5d0a8a 100644 --- a/mm/huge_memory.c +++ b/mm/huge_mem

[ovs-dev] [PATCH 06/16] tracepoint: use new hashtable implementation

2012-08-14 Thread Sasha Levin
Switch tracepoints to use the new hashtable implementation. This reduces the amount of generic unrelated code in the tracepoints. Signed-off-by: Sasha Levin --- kernel/tracepoint.c | 27 +++ 1 files changed, 11 insertions(+), 16 deletions(-) diff --git a/kernel

[ovs-dev] [PATCH 07/16] net,9p: use new hashtable implementation

2012-08-14 Thread Sasha Levin
Switch 9p error table to use the new hashtable implementation. This reduces the amount of generic unrelated code in 9p. Signed-off-by: Sasha Levin --- net/9p/error.c | 21 ++--- 1 files changed, 10 insertions(+), 11 deletions(-) diff --git a/net/9p/error.c b/net/9p/error.c

[ovs-dev] [PATCH 08/16] block, elevator: use new hashtable implementation

2012-08-14 Thread Sasha Levin
when accessing it. Signed-off-by: Sasha Levin --- block/blk.h |2 +- block/elevator.c | 23 --- include/linux/elevator.h |5 - 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/block/blk.h b/block/blk.h index 2a0ea32..5650d48 100644

[ovs-dev] [PATCH 09/16] SUNRPC/cache: use new hashtable implementation

2012-08-14 Thread Sasha Levin
Switch cache to use the new hashtable implementation. This reduces the amount of generic unrelated code in the cache implementation. Signed-off-by: Sasha Levin --- net/sunrpc/cache.c | 20 +--- 1 files changed, 9 insertions(+), 11 deletions(-) diff --git a/net/sunrpc/cache.c

[ovs-dev] [PATCH 10/16] dlm: use new hashtable implementation

2012-08-14 Thread Sasha Levin
Switch dlm to use the new hashtable implementation. This reduces the amount of generic unrelated code in the dlm. Signed-off-by: Sasha Levin --- fs/dlm/lowcomms.c | 47 +-- 1 files changed, 13 insertions(+), 34 deletions(-) diff --git a/fs/dlm

[ovs-dev] [PATCH 11/16] net, l2tp: use new hashtable implementation

2012-08-14 Thread Sasha Levin
Switch l2tp to use the new hashtable implementation. This reduces the amount of generic unrelated code in l2tp. Signed-off-by: Sasha Levin --- net/l2tp/l2tp_core.c| 132 +-- net/l2tp/l2tp_core.h|8 ++-- net/l2tp/l2tp_debugfs.c | 19

[ovs-dev] [PATCH 12/16] dm: use new hashtable implementation

2012-08-14 Thread Sasha Levin
Switch dm to use the new hashtable implementation. This reduces the amount of generic unrelated code in the dm. Signed-off-by: Sasha Levin --- drivers/md/dm-snap.c | 24 --- drivers/md/persistent-data/dm-block-manager.c |1 - .../persistent

[ovs-dev] [PATCH 13/16] lockd: use new hashtable implementation

2012-08-14 Thread Sasha Levin
Switch lockd to use the new hashtable implementation. This reduces the amount of generic unrelated code in lockd. Signed-off-by: Sasha Levin --- fs/lockd/svcsubs.c | 58 +-- 1 files changed, 28 insertions(+), 30 deletions(-) diff --git a/fs

[ovs-dev] [PATCH 14/16] net,rds: use new hashtable implementation

2012-08-14 Thread Sasha Levin
Switch rds to use the new hashtable implementation. This reduces the amount of generic unrelated code in rds. Signed-off-by: Sasha Levin --- net/rds/bind.c | 20 +- net/rds/connection.c | 102 ++ 2 files changed, 55 insertions

[ovs-dev] [PATCH 15/16] openvswitch: use new hashtable implementation

2012-08-14 Thread Sasha Levin
Switch openvswitch to use the new hashtable implementation. This reduces the amount of generic unrelated code in openvswitch. Signed-off-by: Sasha Levin --- net/openvswitch/vport.c | 30 +- 1 files changed, 13 insertions(+), 17 deletions(-) diff --git a/net

[ovs-dev] [PATCH 16/16] tracing output: use new hashtable implementation

2012-08-14 Thread Sasha Levin
Switch tracing to use the new hashtable implementation. This reduces the amount of generic unrelated code in the tracing module. Signed-off-by: Sasha Levin --- kernel/trace/trace_output.c | 20 1 files changed, 8 insertions(+), 12 deletions(-) diff --git a/kernel/trace

Re: [ovs-dev] [PATCH 01/16] hashtable: introduce a small and naive hashtable

2012-08-14 Thread Sasha Levin
On 08/15/2012 01:25 AM, NeilBrown wrote: > On Tue, 14 Aug 2012 18:24:35 +0200 Sasha Levin > wrote: > > >> +static inline void hash_init_size(struct hlist_head *hashtable, int bits) >> +{ >> +int i; >> + >> +for (i = 0; i < HASH_SIZE(bits); i

Re: [ovs-dev] [PATCH 02/16] user_ns: use new hashtable implementation

2012-08-14 Thread Sasha Levin
On 08/15/2012 01:52 AM, Eric W. Biederman wrote: > Sasha Levin writes: > >> Switch user_ns to use the new hashtable implementation. This reduces the >> amount of >> generic unrelated code in user_ns. > > Two concerns here. > 1) When adding a new entry you re

Re: [ovs-dev] [PATCH 02/16] user_ns: use new hashtable implementation

2012-08-14 Thread Sasha Levin
On 08/15/2012 03:08 AM, Eric W. Biederman wrote: >> I can offer the following: I'll write a small module that will hash 1...1 >> > into a hashtable which uses 7 bits (just like user_ns) and post the >> > distribution >> > we'll get. > That won't hurt. I think 1-100 then 1000-1100 may actually

Re: [ovs-dev] [PATCH 02/16] user_ns: use new hashtable implementation

2012-08-15 Thread Sasha Levin
On 08/15/2012 05:31 AM, Mathieu Desnoyers wrote: > * Eric W. Biederman (ebied...@xmission.com) wrote: >> Sasha Levin writes: >> >>> On 08/15/2012 03:08 AM, Eric W. Biederman wrote: >>>>> I can offer the following: I'll write a small module that will h

[ovs-dev] [PATCH v2 00/16] generic hashtable implementation

2012-08-18 Thread Sasha Levin
es to the code. Sasha Levin (16): hashtable: introduce a small and naive hashtable userns: use new hashtable implementation mm,ksm: use new hashtable implementation workqueue: use new hashtable implementation mm/huge_memory: use new hashtable implementation tracepoint: use new hashtable

[ovs-dev] [PATCH v2 01/16] hashtable: introduce a small and naive hashtable

2012-08-18 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 --- include/linux/hashtable.h | 284 + 1 files changed, 284 insertions(+), 0

[ovs-dev] [PATCH 02/16] user_ns: use new hashtable implementation

2012-08-18 Thread Sasha Levin
Switch user_ns to use the new hashtable implementation. This reduces the amount of generic unrelated code in user_ns. Signed-off-by: Sasha Levin --- kernel/user.c | 33 + 1 files changed, 13 insertions(+), 20 deletions(-) diff --git a/kernel/user.c b/kernel

[ovs-dev] [PATCH v2 02/16] userns: use new hashtable implementation

2012-08-18 Thread Sasha Levin
Switch to using the new hashtable implementation to store user structs. This reduces the amount of generic unrelated code in kernel/user.c. Signed-off-by: Sasha Levin --- kernel/user.c | 33 + 1 files changed, 13 insertions(+), 20 deletions(-) diff --git a

[ovs-dev] [PATCH v2 03/16] mm, ksm: use new hashtable implementation

2012-08-18 Thread Sasha Levin
Switch ksm to use the new hashtable implementation. This reduces the amount of generic unrelated code in the ksm module. Signed-off-by: Sasha Levin --- mm/ksm.c | 33 +++-- 1 files changed, 15 insertions(+), 18 deletions(-) diff --git a/mm/ksm.c b/mm/ksm.c index

[ovs-dev] [PATCH v2 04/16] workqueue: use new hashtable implementation

2012-08-18 Thread Sasha Levin
Switch workqueues to use the new hashtable implementation. This reduces the amount of generic unrelated code in the workqueues. Signed-off-by: Sasha Levin --- kernel/workqueue.c | 86 +--- 1 files changed, 15 insertions(+), 71 deletions

[ovs-dev] [PATCH v2 05/16] mm/huge_memory: use new hashtable implementation

2012-08-18 Thread Sasha Levin
ssing it. Signed-off-by: Sasha Levin --- mm/huge_memory.c | 57 ++--- 1 files changed, 15 insertions(+), 42 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 8b3c55a..cebe345 100644 --- a/mm/huge_memory.c +++ b/mm/huge_mem

[ovs-dev] [PATCH v2 06/16] tracepoint: use new hashtable implementation

2012-08-18 Thread Sasha Levin
Switch tracepoints to use the new hashtable implementation. This reduces the amount of generic unrelated code in the tracepoints. Signed-off-by: Sasha Levin --- kernel/tracepoint.c | 27 +++ 1 files changed, 11 insertions(+), 16 deletions(-) diff --git a/kernel

[ovs-dev] [PATCH v2 07/16] net, 9p: use new hashtable implementation

2012-08-18 Thread Sasha Levin
Switch 9p error table to use the new hashtable implementation. This reduces the amount of generic unrelated code in 9p. Signed-off-by: Sasha Levin --- net/9p/error.c | 21 ++--- 1 files changed, 10 insertions(+), 11 deletions(-) diff --git a/net/9p/error.c b/net/9p/error.c

[ovs-dev] [PATCH v2 08/16] block, elevator: use new hashtable implementation

2012-08-18 Thread Sasha Levin
when accessing it. Signed-off-by: Sasha Levin --- block/blk.h |2 +- block/elevator.c | 23 --- include/linux/elevator.h |5 - 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/block/blk.h b/block/blk.h index 2a0ea32..5650d48 100644

[ovs-dev] [PATCH v2 10/16] dlm: use new hashtable implementation

2012-08-18 Thread Sasha Levin
Switch dlm to use the new hashtable implementation. This reduces the amount of generic unrelated code in the dlm. Signed-off-by: Sasha Levin --- fs/dlm/lowcomms.c | 47 +-- 1 files changed, 13 insertions(+), 34 deletions(-) diff --git a/fs/dlm

[ovs-dev] [PATCH v2 09/16] SUNRPC/cache: use new hashtable implementation

2012-08-18 Thread Sasha Levin
Switch cache to use the new hashtable implementation. This reduces the amount of generic unrelated code in the cache implementation. Signed-off-by: Sasha Levin --- net/sunrpc/cache.c | 20 +--- 1 files changed, 9 insertions(+), 11 deletions(-) diff --git a/net/sunrpc/cache.c

[ovs-dev] [PATCH v2 11/16] net, l2tp: use new hashtable implementation

2012-08-18 Thread Sasha Levin
Switch l2tp to use the new hashtable implementation. This reduces the amount of generic unrelated code in l2tp. Signed-off-by: Sasha Levin --- net/l2tp/l2tp_core.c| 134 +- net/l2tp/l2tp_core.h|8 ++-- net/l2tp/l2tp_debugfs.c | 19

[ovs-dev] [PATCH v2 12/16] dm: use new hashtable implementation

2012-08-18 Thread Sasha Levin
Switch dm to use the new hashtable implementation. This reduces the amount of generic unrelated code in the dm. Signed-off-by: Sasha Levin --- drivers/md/dm-snap.c | 24 --- drivers/md/persistent-data/dm-block-manager.c |1 - .../persistent

[ovs-dev] [PATCH v2 13/16] lockd: use new hashtable implementation

2012-08-18 Thread Sasha Levin
Switch lockd to use the new hashtable implementation. This reduces the amount of generic unrelated code in lockd. Signed-off-by: Sasha Levin --- fs/lockd/svcsubs.c | 66 --- 1 files changed, 36 insertions(+), 30 deletions(-) diff --git a/fs

[ovs-dev] [PATCH v2 14/16] net, rds: use new hashtable implementation

2012-08-18 Thread Sasha Levin
Switch rds to use the new hashtable implementation. This reduces the amount of generic unrelated code in rds. Signed-off-by: Sasha Levin --- net/rds/bind.c | 28 +- net/rds/connection.c | 102 ++ 2 files changed, 63 insertions

[ovs-dev] [PATCH v2 15/16] openvswitch: use new hashtable implementation

2012-08-18 Thread Sasha Levin
Switch openvswitch to use the new hashtable implementation. This reduces the amount of generic unrelated code in openvswitch. Signed-off-by: Sasha Levin --- net/openvswitch/vport.c | 30 +- 1 files changed, 13 insertions(+), 17 deletions(-) diff --git a/net

[ovs-dev] [PATCH v2 16/16] tracing output: use new hashtable implementation

2012-08-18 Thread Sasha Levin
Switch tracing to use the new hashtable implementation. This reduces the amount of generic unrelated code in the tracing module. Signed-off-by: Sasha Levin --- kernel/trace/trace_output.c | 20 1 files changed, 8 insertions(+), 12 deletions(-) diff --git a/kernel/trace

Re: [ovs-dev] [PATCH v2 01/16] hashtable: introduce a small and naive hashtable

2012-08-19 Thread Sasha Levin
On 08/19/2012 03:16 PM, Mathieu Desnoyers wrote: > * 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. >> >>

Re: [ovs-dev] [PATCH v2 01/16] hashtable: introduce a small and naive hashtable

2012-08-19 Thread Sasha Levin
On 08/19/2012 04:16 PM, Mathieu Desnoyers wrote: > * Mathieu Desnoyers (mathieu.desnoy...@efficios.com) wrote: >> * Sasha Levin (levinsasha...@gmail.com) wrote: > [...] >>> +/** >>> + * hash_for_each_possible - iterate over all possible objects for a given >&

[ovs-dev] [PATCH v3 00/17] generic hashtable implementation

2012-08-21 Thread Sasha Levin
ng hash_init in rds and lockd. - Addressed the userns comments by Eric Biederman. - Ran a small test to confirm hash_32 does a good job for low key values (1-1), which showed it did - this resulted in no changes to the code. Sasha Levin (17): hashtable: introduce a small and naive hashtabl

[ovs-dev] [PATCH v3 01/17] hashtable: introduce a small and naive hashtable

2012-08-21 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 --- include/linux/hashtable.h | 291 + 1 files changed, 291 insertions(+), 0

[ovs-dev] [PATCH v3 02/17] userns: use new hashtable implementation

2012-08-21 Thread Sasha Levin
Switch to using the new hashtable implementation to store user structs. This reduces the amount of generic unrelated code in kernel/user.c. Signed-off-by: Sasha Levin --- kernel/user.c | 33 + 1 files changed, 13 insertions(+), 20 deletions(-) diff --git a

[ovs-dev] [PATCH v3 03/17] mm, ksm: use new hashtable implementation

2012-08-21 Thread Sasha Levin
Switch ksm to use the new hashtable implementation. This reduces the amount of generic unrelated code in the ksm module. Signed-off-by: Sasha Levin --- mm/ksm.c | 33 +++-- 1 files changed, 15 insertions(+), 18 deletions(-) diff --git a/mm/ksm.c b/mm/ksm.c index

[ovs-dev] [PATCH v3 04/17] workqueue: use new hashtable implementation

2012-08-21 Thread Sasha Levin
Switch workqueues to use the new hashtable implementation. This reduces the amount of generic unrelated code in the workqueues. Signed-off-by: Sasha Levin --- kernel/workqueue.c | 86 +--- 1 files changed, 15 insertions(+), 71 deletions

[ovs-dev] [PATCH v3 05/17] mm/huge_memory: use new hashtable implementation

2012-08-21 Thread Sasha Levin
ssing it. Signed-off-by: Sasha Levin --- mm/huge_memory.c | 57 ++--- 1 files changed, 15 insertions(+), 42 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 8b3c55a..cebe345 100644 --- a/mm/huge_memory.c +++ b/mm/huge_mem

[ovs-dev] [PATCH v3 06/17] tracepoint: use new hashtable implementation

2012-08-21 Thread Sasha Levin
Switch tracepoints to use the new hashtable implementation. This reduces the amount of generic unrelated code in the tracepoints. Signed-off-by: Sasha Levin --- kernel/tracepoint.c | 27 +++ 1 files changed, 11 insertions(+), 16 deletions(-) diff --git a/kernel

[ovs-dev] [PATCH v3 07/17] net, 9p: use new hashtable implementation

2012-08-21 Thread Sasha Levin
Switch 9p error table to use the new hashtable implementation. This reduces the amount of generic unrelated code in 9p. Signed-off-by: Sasha Levin --- net/9p/error.c | 21 ++--- 1 files changed, 10 insertions(+), 11 deletions(-) diff --git a/net/9p/error.c b/net/9p/error.c

[ovs-dev] [PATCH v3 08/17] block, elevator: use new hashtable implementation

2012-08-21 Thread Sasha Levin
when accessing it. Signed-off-by: Sasha Levin --- block/blk.h |2 +- block/elevator.c | 23 --- include/linux/elevator.h |5 - 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/block/blk.h b/block/blk.h index 2a0ea32..5650d48 100644

[ovs-dev] [PATCH v3 09/17] SUNRPC/cache: use new hashtable implementation

2012-08-21 Thread Sasha Levin
Switch cache to use the new hashtable implementation. This reduces the amount of generic unrelated code in the cache implementation. Signed-off-by: Sasha Levin --- net/sunrpc/cache.c | 20 +--- 1 files changed, 9 insertions(+), 11 deletions(-) diff --git a/net/sunrpc/cache.c

[ovs-dev] [PATCH v3 10/17] dlm: use new hashtable implementation

2012-08-21 Thread Sasha Levin
Switch dlm to use the new hashtable implementation. This reduces the amount of generic unrelated code in the dlm. Signed-off-by: Sasha Levin --- fs/dlm/lowcomms.c | 47 +-- 1 files changed, 13 insertions(+), 34 deletions(-) diff --git a/fs/dlm

[ovs-dev] [PATCH v3 11/17] net, l2tp: use new hashtable implementation

2012-08-21 Thread Sasha Levin
Switch l2tp to use the new hashtable implementation. This reduces the amount of generic unrelated code in l2tp. Signed-off-by: Sasha Levin --- net/l2tp/l2tp_core.c| 134 +- net/l2tp/l2tp_core.h|8 ++-- net/l2tp/l2tp_debugfs.c | 19

[ovs-dev] [PATCH v3 12/17] dm: use new hashtable implementation

2012-08-21 Thread Sasha Levin
Switch dm to use the new hashtable implementation. This reduces the amount of generic unrelated code in the dm. Signed-off-by: Sasha Levin --- drivers/md/dm-snap.c | 24 --- drivers/md/persistent-data/dm-block-manager.c |1 - .../persistent

[ovs-dev] [PATCH v3 13/17] lockd: use new hashtable implementation

2012-08-21 Thread Sasha Levin
Switch lockd to use the new hashtable implementation. This reduces the amount of generic unrelated code in lockd. Signed-off-by: Sasha Levin --- fs/lockd/svcsubs.c | 66 --- 1 files changed, 36 insertions(+), 30 deletions(-) diff --git a/fs

[ovs-dev] [PATCH v3 14/17] net, rds: use new hashtable implementation

2012-08-21 Thread Sasha Levin
Switch rds to use the new hashtable implementation. This reduces the amount of generic unrelated code in rds. Signed-off-by: Sasha Levin --- net/rds/bind.c | 28 +- net/rds/connection.c | 102 ++ 2 files changed, 63 insertions

[ovs-dev] [PATCH v3 15/17] openvswitch: use new hashtable implementation

2012-08-21 Thread Sasha Levin
Switch openvswitch to use the new hashtable implementation. This reduces the amount of generic unrelated code in openvswitch. Signed-off-by: Sasha Levin --- net/openvswitch/vport.c | 30 +- 1 files changed, 13 insertions(+), 17 deletions(-) diff --git a/net

[ovs-dev] [PATCH v3 16/17] tracing output: use new hashtable implementation

2012-08-21 Thread Sasha Levin
Switch tracing to use the new hashtable implementation. This reduces the amount of generic unrelated code in the tracing module. Signed-off-by: Sasha Levin --- kernel/trace/trace_output.c | 20 1 files changed, 8 insertions(+), 12 deletions(-) diff --git a/kernel/trace

[ovs-dev] [PATCH v3 17/17] SUNRPC: use new hashtable implementation in auth

2012-08-21 Thread Sasha Levin
Switch sunrpc/auth.c to use the new hashtable implementation. This reduces the amount of generic unrelated code in auth.c. Signed-off-by: Sasha Levin --- net/sunrpc/auth.c | 45 +++-- 1 files changed, 19 insertions(+), 26 deletions(-) diff --git a

Re: [ovs-dev] [PATCH v3 13/17] lockd: use new hashtable implementation

2012-08-22 Thread Sasha Levin
On 08/22/2012 01:47 PM, J. Bruce Fields wrote: > On Wed, Aug 22, 2012 at 04:27:08AM +0200, Sasha Levin wrote: >> +static int __init nlm_init(void) >> +{ >> +hash_init(nlm_files); >> +return 0; >> +} >> + >> +module_init(nlm_init); > > Tha

Re: [ovs-dev] [PATCH v3 13/17] lockd: use new hashtable implementation

2012-08-22 Thread Sasha Levin
On 08/22/2012 03:22 PM, Mathieu Desnoyers wrote: > * Sasha Levin (levinsasha...@gmail.com) wrote: >> On 08/22/2012 01:47 PM, J. Bruce Fields wrote: >>> On Wed, Aug 22, 2012 at 04:27:08AM +0200, Sasha Levin wrote: >>>> +static int __init nlm_init(void) >&

Re: [ovs-dev] [PATCH v3 01/17] hashtable: introduce a small and naive hashtable

2012-08-22 Thread Sasha Levin
Hi Tejun, On 08/22/2012 08:01 PM, Tejun Heo wrote: > Hello, Sasha. > > On Wed, Aug 22, 2012 at 04:26:56AM +0200, Sasha Levin wrote: >> +#define DEFINE_HASHTABLE(name, bits) >> \ >> +struct hlist_head name[HASH_SIZE(bit

Re: [ovs-dev] [PATCH v3 01/17] hashtable: introduce a small and naive hashtable

2012-08-24 Thread Sasha Levin
On 08/23/2012 10:04 PM, Tejun Heo wrote: > Hello, Sasha. > > On Thu, Aug 23, 2012 at 02:24:32AM +0200, Sasha Levin wrote: >>> I think the almost trivial nature of hlist hashtables makes this a bit >>> tricky and I'm not very sure but having this combinatory expl

Re: [ovs-dev] [PATCH v3 01/17] hashtable: introduce a small and naive hashtable

2012-08-24 Thread Sasha Levin
On 08/24/2012 09:59 PM, Tejun Heo wrote: > Hello, Sasha. > > On Fri, Aug 24, 2012 at 09:47:19PM +0200, Sasha Levin wrote: >>> I think this is problematic. It looks exactly like other existing >>> DEFINE macros yet what its semantics is different. I don't think

Re: [ovs-dev] [PATCH v3 01/17] hashtable: introduce a small and naive hashtable

2012-08-24 Thread Sasha Levin
On 08/24/2012 10:33 PM, Tejun Heo wrote: > Hello, Sasha. > > On Fri, Aug 24, 2012 at 10:11:55PM +0200, Sasha Levin wrote: >>> If this implementation is about the common trivial case, why not just >>> have the usual DECLARE/DEFINE_HASHTABLE() combination? >&g

Re: [ovs-dev] [PATCH v3 01/17] hashtable: introduce a small and naive hashtable

2012-08-24 Thread Sasha Levin
>> Why do we need hash_head/hash_for_each_head()? I haven't stumbled on a place >> yet >> that needed direct access to the bucket itself. > > Because whole hash table walking is much less common and we can avoid > another full set of iterators. I don't agree. Out of 32 places which now use a has

Re: [ovs-dev] [PATCH v3 01/17] hashtable: introduce a small and naive hashtable

2012-08-28 Thread Sasha Levin
On 08/25/2012 06:24 AM, Mathieu Desnoyers wrote: > * Tejun Heo (t...@kernel.org) wrote: >> Hello, >> >> On Sat, Aug 25, 2012 at 12:59:25AM +0200, Sasha Levin wrote: >>> Thats the thing, the amount of things of things you can do with a given >>> bucket >&g

Re: [ovs-dev] [PATCH v3 01/17] hashtable: introduce a small and naive hashtable

2012-08-28 Thread Sasha Levin
On 08/28/2012 12:11 PM, Mathieu Desnoyers wrote: > * Sasha Levin (levinsasha...@gmail.com) wrote: >> On 08/25/2012 06:24 AM, Mathieu Desnoyers wrote: >>> * Tejun Heo (t...@kernel.org) wrote: >>>> Hello, >>>> >>>> On Sat, Aug 25, 2012 at 12:5

Re: [ovs-dev] [PATCH v3 01/17] hashtable: introduce a small and naive hashtable

2012-09-06 Thread Sasha Levin
On 09/04/2012 07:01 PM, Mathieu Desnoyers wrote: >> #define do_for_each_ftrace_rec(pg, rec) >> \ >> > for (pg = ftrace_pages_start, rec = &pg->records[pg->index]; >> > \ >> > pg && rec == &pg->records[pg->index];

Re: [ovs-dev] [PATCH v3 01/17] hashtable: introduce a small and naive hashtable

2012-09-06 Thread Sasha Levin
On 09/06/2012 04:55 PM, Josh Triplett wrote: > On Thu, Sep 06, 2012 at 03:53:58PM +0200, Sasha Levin wrote: >> On 09/04/2012 07:01 PM, Mathieu Desnoyers wrote: >>>> #define do_for_each_ftrace_rec(pg, rec) >>>> \ >>&

Re: [ovs-dev] [PATCH v3 01/17] hashtable: introduce a small and naive hashtable

2012-09-06 Thread Sasha Levin
On 09/06/2012 06:00 PM, Steven Rostedt wrote: >> > I think that that code doesn't make sense. The users of hlist_for_each_* >> > aren't >> > supposed to be changing the loop cursor. > I totally agree. Modifying the 'node' pointer is just asking for issues. > Yes that is error prone, but not due to

Re: [ovs-dev] [PATCH v3 01/17] hashtable: introduce a small and naive hashtable

2012-09-06 Thread Sasha Levin
On 09/06/2012 06:50 PM, Mathieu Desnoyers wrote: > * Sasha Levin (levinsasha...@gmail.com) wrote: >> On 09/06/2012 06:00 PM, Steven Rostedt wrote: >>>>> I think that that code doesn't make sense. The users of hlist_for_each_* >>>>> aren't >

[ovs-dev] [PATCH v7 01/16] hashtable: introduce a small and naive hashtable

2012-10-28 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 --- Sorry for the long delay, I was busy with a bunch of personal things. Changes since v6: - Use macros that point to

[ovs-dev] [PATCH v7 02/16] userns: use new hashtable implementation

2012-10-28 Thread Sasha Levin
Switch to using the new hashtable implementation to store user structs. This reduces the amount of generic unrelated code in kernel/user.c. Signed-off-by: Sasha Levin --- kernel/user.c | 33 + 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/kernel

[ovs-dev] [PATCH v7 03/16] mm, ksm: use new hashtable implementation

2012-10-28 Thread Sasha Levin
Switch ksm to use the new hashtable implementation. This reduces the amount of generic unrelated code in the ksm module. Signed-off-by: Sasha Levin --- mm/ksm.c | 33 +++-- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/mm/ksm.c b/mm/ksm.c index

[ovs-dev] [PATCH v7 04/16] workqueue: use new hashtable implementation

2012-10-28 Thread Sasha Levin
Switch workqueues to use the new hashtable implementation. This reduces the amount of generic unrelated code in the workqueues. Signed-off-by: Sasha Levin --- kernel/workqueue.c | 86 ++ 1 file changed, 15 insertions(+), 71 deletions(-) diff

[ovs-dev] [PATCH v7 05/16] mm/huge_memory: use new hashtable implementation

2012-10-28 Thread Sasha Levin
ssing it. Signed-off-by: Sasha Levin --- mm/huge_memory.c | 55 ++- 1 file changed, 14 insertions(+), 41 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 3c14a96..38ce8e9 100644 --- a/mm/huge_memory.c +++ b/mm/huge_mem

[ovs-dev] [PATCH v7 06/16] tracepoint: use new hashtable implementation

2012-10-28 Thread Sasha Levin
Switch tracepoints to use the new hashtable implementation. This reduces the amount of generic unrelated code in the tracepoints. Signed-off-by: Sasha Levin --- kernel/tracepoint.c | 27 +++ 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/kernel

[ovs-dev] [PATCH v7 07/16] net, 9p: use new hashtable implementation

2012-10-28 Thread Sasha Levin
Switch 9p error table to use the new hashtable implementation. This reduces the amount of generic unrelated code in 9p. Signed-off-by: Sasha Levin --- net/9p/error.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/net/9p/error.c b/net/9p/error.c

[ovs-dev] [PATCH v7 08/16] block, elevator: use new hashtable implementation

2012-10-28 Thread Sasha Levin
when accessing it. Signed-off-by: Sasha Levin --- block/blk.h | 2 +- block/elevator.c | 23 --- include/linux/elevator.h | 5 - 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/block/blk.h b/block/blk.h index ca51543..a0abbf6 100644 --- a/

[ovs-dev] [PATCH v7 09/16] SUNRPC/cache: use new hashtable implementation

2012-10-28 Thread Sasha Levin
Switch cache to use the new hashtable implementation. This reduces the amount of generic unrelated code in the cache implementation. Signed-off-by: Sasha Levin --- net/sunrpc/cache.c | 20 +--- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/net/sunrpc/cache.c b

[ovs-dev] [PATCH v7 10/16] dlm: use new hashtable implementation

2012-10-28 Thread Sasha Levin
Switch dlm to use the new hashtable implementation. This reduces the amount of generic unrelated code in the dlm. Signed-off-by: Sasha Levin --- fs/dlm/lowcomms.c | 47 +-- 1 file changed, 13 insertions(+), 34 deletions(-) diff --git a/fs/dlm

[ovs-dev] [PATCH v7 11/16] net, l2tp: use new hashtable implementation

2012-10-28 Thread Sasha Levin
Switch l2tp to use the new hashtable implementation. This reduces the amount of generic unrelated code in l2tp. Signed-off-by: Sasha Levin --- net/l2tp/l2tp_core.c| 134 ++-- net/l2tp/l2tp_core.h| 8 +-- net/l2tp/l2tp_debugfs.c | 19

[ovs-dev] [PATCH v7 12/16] dm: use new hashtable implementation

2012-10-28 Thread Sasha Levin
Switch dm to use the new hashtable implementation. This reduces the amount of generic unrelated code in the dm. Signed-off-by: Sasha Levin --- drivers/md/dm-snap.c | 24 + drivers/md/persistent-data/dm-block-manager.c | 1 - .../persistent

[ovs-dev] [PATCH v7 13/16] lockd: use new hashtable implementation

2012-10-28 Thread Sasha Levin
Switch lockd to use the new hashtable implementation. This reduces the amount of generic unrelated code in lockd. Signed-off-by: Sasha Levin --- fs/lockd/svcsubs.c | 66 +- 1 file changed, 36 insertions(+), 30 deletions(-) diff --git a/fs

[ovs-dev] [PATCH v7 14/16] net, rds: use new hashtable implementation

2012-10-28 Thread Sasha Levin
Switch rds to use the new hashtable implementation. This reduces the amount of generic unrelated code in rds. Signed-off-by: Sasha Levin --- net/rds/bind.c | 28 +- net/rds/connection.c | 102 +++ 2 files changed, 63 insertions

[ovs-dev] [PATCH v7 15/16] openvswitch: use new hashtable implementation

2012-10-28 Thread Sasha Levin
Switch openvswitch to use the new hashtable implementation. This reduces the amount of generic unrelated code in openvswitch. Signed-off-by: Sasha Levin --- net/openvswitch/vport.c | 34 +- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/net

[ovs-dev] [PATCH v7 16/16] tracing output: use new hashtable implementation

2012-10-28 Thread Sasha Levin
Switch tracing to use the new hashtable implementation. This reduces the amount of generic unrelated code in the tracing module. Signed-off-by: Sasha Levin --- kernel/trace/trace_output.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/kernel/trace

Re: [ovs-dev] [PATCH v7 15/16] openvswitch: use new hashtable implementation

2012-10-29 Thread Sasha Levin
Hi Mathieu, On Mon, Oct 29, 2012 at 9:29 AM, Mathieu Desnoyers wrote: > * Sasha Levin (levinsasha...@gmail.com) wrote: > [...] >> -static struct hlist_head *hash_bucket(struct net *net, const char *name) >> -{ >> - unsigned int hash = jhash(name, strlen(na

Re: [ovs-dev] [PATCH v7 10/16] dlm: use new hashtable implementation

2012-10-29 Thread Sasha Levin
On Mon, Oct 29, 2012 at 9:07 AM, Mathieu Desnoyers wrote: > * Mathieu Desnoyers (mathieu.desnoy...@efficios.com) wrote: >> * Sasha Levin (levinsasha...@gmail.com) wrote: >> [...] >> > @@ -158,34 +159,21 @@ static int dlm_allow_conn; >> > static struct

Re: [ovs-dev] [PATCH v7 01/16] hashtable: introduce a small and naive hashtable

2012-10-29 Thread Sasha Levin
On Mon, Oct 29, 2012 at 7:29 AM, Mathieu Desnoyers wrote: > * Sasha Levin (levinsasha...@gmail.com) wrote: >> + >> + for (i = 0; i < sz; i++) >> + INIT_HLIST_HEAD(&ht[sz]); > > ouch. How did this work ? Has it been tested at all ? > > s

Re: [ovs-dev] [PATCH v7 01/16] hashtable: introduce a small and naive hashtable

2012-10-29 Thread Sasha Levin
On Mon, Oct 29, 2012 at 12:14 PM, Mathieu Desnoyers wrote: > * Sasha Levin (levinsasha...@gmail.com) wrote: >> On Mon, Oct 29, 2012 at 7:29 AM, Mathieu Desnoyers >> wrote: >> > * Sasha Levin (levinsasha...@gmail.com) wrote: >> >>

Re: [ovs-dev] [PATCH v7 06/16] tracepoint: use new hashtable implementation

2012-10-29 Thread Sasha Levin
On Mon, Oct 29, 2012 at 7:35 AM, Mathieu Desnoyers wrote: > * Sasha Levin (levinsasha...@gmail.com) wrote: >> Switch tracepoints to use the new hashtable implementation. This reduces the >> amount of >> generic unrelated code in the tracepoints. >> &g

Re: [ovs-dev] [PATCH v7 15/16] openvswitch: use new hashtable implementation

2012-10-29 Thread Sasha Levin
On Mon, Oct 29, 2012 at 11:59 AM, Mathieu Desnoyers wrote: > * Sasha Levin (levinsasha...@gmail.com) wrote: >> Hi Mathieu, >> >> On Mon, Oct 29, 2012 at 9:29 AM, Mathieu Desnoyers >> wrote: >> > * Sasha Levin (levinsasha...@gmail.com) wrote: >&g

Re: [ovs-dev] [PATCH v7 06/16] tracepoint: use new hashtable implementation

2012-10-29 Thread Sasha Levin
On Mon, Oct 29, 2012 at 2:31 PM, Josh Triplett wrote: > On Mon, Oct 29, 2012 at 01:29:24PM -0400, Sasha Levin wrote: >> On Mon, Oct 29, 2012 at 7:35 AM, Mathieu Desnoyers >> wrote: >> > * Sasha Levin (levinsasha...@gmail.com) wrote: >> >> Switch

Re: [ovs-dev] [PATCH v7 06/16] tracepoint: use new hashtable implementation

2012-10-29 Thread Sasha Levin
On Mon, Oct 29, 2012 at 2:53 PM, Mathieu Desnoyers wrote: > * Sasha Levin (levinsasha...@gmail.com) wrote: >> On Mon, Oct 29, 2012 at 2:31 PM, Josh Triplett wrote: >> > On Mon, Oct 29, 2012 at 01:29:24PM -0400, Sasha Levin wrote: >> >> On Mon, Oct 29, 2012

Re: [ovs-dev] [PATCH v7 06/16] tracepoint: use new hashtable implementation

2012-10-29 Thread Sasha Levin
On Mon, Oct 29, 2012 at 3:12 PM, Tejun Heo wrote: > On Mon, Oct 29, 2012 at 03:09:36PM -0400, Sasha Levin wrote: >> The other thing is whether hash_init() should be called for hashtables >> that were created with DEFINE_HASHTABLE(). That point was raised by >> Neil Brown

[ovs-dev] [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

[ovs-dev] [PATCH v8 02/16] userns: use new hashtable implementation

2012-10-30 Thread Sasha Levin
Switch to using the new hashtable implementation to store user structs. This reduces the amount of generic unrelated code in kernel/user.c. Signed-off-by: Sasha Levin --- kernel/user.c | 33 - 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/kernel

  1   2   >