diff options
author | Jesper Dangaard Brouer <brouer@redhat.com> | 2013-01-28 18:45:51 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-29 13:36:24 -0500 |
commit | 3ef0eb0db4bf92c6d2510fe5c4dc51852746f206 (patch) | |
tree | 3f0d424f598a82eb17a5199d27fec9964513e16e /net/ipv6 | |
parent | 6d7b857d541ecd1d9bd997c97242d4ef94b19de2 (diff) |
net: frag, move LRU list maintenance outside of rwlock
Updating the fragmentation queues LRU (Least-Recently-Used) list,
required taking the hash writer lock. However, the LRU list isn't
tied to the hash at all, so we can use a separate lock for it.
Original-idea-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/netfilter/nf_conntrack_reasm.c | 5 | ||||
-rw-r--r-- | net/ipv6/reassembly.c | 4 |
2 files changed, 3 insertions, 6 deletions
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c index 07ef2949c946..c674f158efa8 100644 --- a/net/ipv6/netfilter/nf_conntrack_reasm.c +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c | |||
@@ -328,9 +328,8 @@ found: | |||
328 | fq->nhoffset = nhoff; | 328 | fq->nhoffset = nhoff; |
329 | fq->q.last_in |= INET_FRAG_FIRST_IN; | 329 | fq->q.last_in |= INET_FRAG_FIRST_IN; |
330 | } | 330 | } |
331 | write_lock(&nf_frags.lock); | 331 | |
332 | list_move_tail(&fq->q.lru_list, &fq->q.net->lru_list); | 332 | inet_frag_lru_move(&fq->q); |
333 | write_unlock(&nf_frags.lock); | ||
334 | return 0; | 333 | return 0; |
335 | 334 | ||
336 | discard_fq: | 335 | discard_fq: |
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index 18cb8defcdb2..bab2c270f292 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c | |||
@@ -341,9 +341,7 @@ found: | |||
341 | fq->q.meat == fq->q.len) | 341 | fq->q.meat == fq->q.len) |
342 | return ip6_frag_reasm(fq, prev, dev); | 342 | return ip6_frag_reasm(fq, prev, dev); |
343 | 343 | ||
344 | write_lock(&ip6_frags.lock); | 344 | inet_frag_lru_move(&fq->q); |
345 | list_move_tail(&fq->q.lru_list, &fq->q.net->lru_list); | ||
346 | write_unlock(&ip6_frags.lock); | ||
347 | return -1; | 345 | return -1; |
348 | 346 | ||
349 | discard_fq: | 347 | discard_fq: |