mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
[NETNS][FRAGS]: Make the LRU list per namespace.
The inet_frags.lru_list is used for evicting only, so we have to make it per-namespace, to evict only those fragments, who's namespace exceeded its high threshold, but not the whole hash. Besides, this helps to avoid long loops in evictor. The spinlock is not per-namespace because it protects the hash table as well, which is global. Signed-off-by: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
3b4bc4a2bf
commit
3140c25c82
5 changed files with 8 additions and 8 deletions
|
|
@ -385,7 +385,7 @@ static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb,
|
|||
fq->q.last_in |= FIRST_IN;
|
||||
}
|
||||
write_lock(&nf_frags.lock);
|
||||
list_move_tail(&fq->q.lru_list, &nf_frags.lru_list);
|
||||
list_move_tail(&fq->q.lru_list, &nf_init_frags.lru_list);
|
||||
write_unlock(&nf_frags.lock);
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -424,7 +424,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
|
|||
return ip6_frag_reasm(fq, prev, dev);
|
||||
|
||||
write_lock(&ip6_frags.lock);
|
||||
list_move_tail(&fq->q.lru_list, &ip6_frags.lru_list);
|
||||
list_move_tail(&fq->q.lru_list, &fq->q.net->lru_list);
|
||||
write_unlock(&ip6_frags.lock);
|
||||
return -1;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue