Skip to contentSkip to conversation

netfilter conntrack tcp lock

DISCUSSION Paul E. McKenney 3 participants 3 messages Apr 22, 2009 1 message not in the archive netfilter

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 3 lines · Stephen Hemminger

Not sure what the performance impact would be but simply changing tcp_lock (in nf_conntrack_proto_tcp) to a spin_lock might get a performance boost. I thought I heard Paul say read_locks are way slower than spin_lock.

In -rt, read_locks are really exclusive locks. :-/

And an uncontended read_lock is somewhat slower than a spin_lock, but not overwhelmingly so.

Quoted 1 line

Alternatively, going to some form of bit based hash lock might work.

I have to ask the stupid question... Can conntrack entries be hashed or otherwise partitioned, with a lock then assigned to each partition?

Thanx, Paul

#2 lore raw
In reply to a message not in the archive
Quoted 7 lines · Stephen Hemminger

Not sure what the performance impact would be but simply changing tcp_lock (in nf_conntrack_proto_tcp) to a spin_lock might get a performance boost. I thought I heard Paul say read_locks are way slower than spin_lock.

Alternatively, going to some form of bit based hash lock might work.

I thought Patrick was OK with adding a spinlock into each nf_conn struct ? (We shrunk this struct with the rcu_head removal)

A straight forward locking schem. We have spinlocks everywhere in kernel afterall, and conntracking deserves this.

Just resubmit one of your prior patch perhaps ? I can dig it in a couple of hours eventually.

Thanks

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 9 lines · Eric Dumazet
Quoted 6 lines · Stephen Hemminger

Not sure what the performance impact would be but simply changing tcp_lock (in nf_conntrack_proto_tcp) to a spin_lock might get a performance boost. I thought I heard Paul say read_locks are way slower than spin_lock.

Alternatively, going to some form of bit based hash lock might work.

I thought Patrick was OK with adding a spinlock into each nf_conn struct ? (We shrunk this struct with the rcu_head removal)

Yes, my main concern was the further size increase.

Quoted 4 lines

A straight forward locking schem. We have spinlocks everywhere in kernel afterall, and conntracking deserves this.

Just resubmit one of your prior patch perhaps ? I can dig it in a couple of hours eventually.

Yes, please.

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html