Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

inet: remove (struct uncached_list)->quarantine

This list is used to tranfert dst that are handled by
rt_flush_dev() and rt6_uncached_list_flush_dev() out
of the per-cpu lists.

But quarantine list is not used later.

If we simply use list_del_init(&rt->dst.rt_uncached),
this also removes the dst from per-cpu list.

This patch also makes the future calls to rt_del_uncached_list()
and rt6_uncached_list_del() faster, because no spinlock
acquisition is needed anymore.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240604165150.726382-1-edumazet@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Eric Dumazet and committed by
Paolo Abeni
98aa546a b4cb4a13

+2 -7
+1 -3
net/ipv4/route.c
··· 1481 1481 struct uncached_list { 1482 1482 spinlock_t lock; 1483 1483 struct list_head head; 1484 - struct list_head quarantine; 1485 1484 }; 1486 1485 1487 1486 static DEFINE_PER_CPU_ALIGNED(struct uncached_list, rt_uncached_list); ··· 1531 1532 rt->dst.dev = blackhole_netdev; 1532 1533 netdev_ref_replace(dev, blackhole_netdev, 1533 1534 &rt->dst.dev_tracker, GFP_ATOMIC); 1534 - list_move(&rt->dst.rt_uncached, &ul->quarantine); 1535 + list_del_init(&rt->dst.rt_uncached); 1535 1536 } 1536 1537 spin_unlock_bh(&ul->lock); 1537 1538 } ··· 3660 3661 struct uncached_list *ul = &per_cpu(rt_uncached_list, cpu); 3661 3662 3662 3663 INIT_LIST_HEAD(&ul->head); 3663 - INIT_LIST_HEAD(&ul->quarantine); 3664 3664 spin_lock_init(&ul->lock); 3665 3665 } 3666 3666 #ifdef CONFIG_IP_ROUTE_CLASSID
+1 -4
net/ipv6/route.c
··· 131 131 struct uncached_list { 132 132 spinlock_t lock; 133 133 struct list_head head; 134 - struct list_head quarantine; 135 134 }; 136 135 137 136 static DEFINE_PER_CPU_ALIGNED(struct uncached_list, rt6_uncached_list); ··· 188 189 handled = true; 189 190 } 190 191 if (handled) 191 - list_move(&rt->dst.rt_uncached, 192 - &ul->quarantine); 192 + list_del_init(&rt->dst.rt_uncached); 193 193 } 194 194 spin_unlock_bh(&ul->lock); 195 195 } ··· 6753 6755 struct uncached_list *ul = per_cpu_ptr(&rt6_uncached_list, cpu); 6754 6756 6755 6757 INIT_LIST_HEAD(&ul->head); 6756 - INIT_LIST_HEAD(&ul->quarantine); 6757 6758 spin_lock_init(&ul->lock); 6758 6759 } 6759 6760