mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
neigh: Protect neigh->ha[] with a seqlock
Add a seqlock in struct neighbour to protect neigh->ha[], and avoid dirtying neighbour in stress situation (many different flows / dsts) Dirtying takes place because of read_lock(&n->lock) and n->used writes. Switching to a seqlock, and writing n->used only on jiffies changes permits less dirtying. Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
d122179a3c
commit
0ed8ddf404
4 changed files with 51 additions and 26 deletions
|
|
@ -502,10 +502,8 @@ int arp_find(unsigned char *haddr, struct sk_buff *skb)
|
|||
|
||||
if (n) {
|
||||
n->used = jiffies;
|
||||
if (n->nud_state&NUD_VALID || neigh_event_send(n, skb) == 0) {
|
||||
read_lock_bh(&n->lock);
|
||||
memcpy(haddr, n->ha, dev->addr_len);
|
||||
read_unlock_bh(&n->lock);
|
||||
if (n->nud_state & NUD_VALID || neigh_event_send(n, skb) == 0) {
|
||||
neigh_ha_snapshot(haddr, n, dev);
|
||||
neigh_release(n);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue