Skip to content

Commit 016f3d1

Browse files
lrq-maxdavem330
authored andcommitted
vxlan: reduce dirty cache line in vxlan_find_mac
vxlan_find_mac() unconditionally set f->used for every packet, this causes a cache miss for every packet, since remote, hlist and used of vxlan_fdb share the same cache line, which are accessed when send every packets. so f->used is set only if not equal to jiffies, to reduce dirty cache line times, this gives 3% speed-up with small packets. Signed-off-by: Zhang Yu <[email protected]> Signed-off-by: Li RongQing <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 920767a commit 016f3d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/vxlan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ static struct vxlan_fdb *vxlan_find_mac(struct vxlan_dev *vxlan,
464464
struct vxlan_fdb *f;
465465

466466
f = __vxlan_find_mac(vxlan, mac, vni);
467-
if (f)
467+
if (f && f->used != jiffies)
468468
f->used = jiffies;
469469

470470
return f;

0 commit comments

Comments
 (0)