diff options
| author | Kuniyuki Iwashima <[email protected]> | 2025-07-16 22:08:12 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2025-07-17 23:25:20 +0000 |
| commit | d539d8fbd8fcf64a1492c51f5ee99aaa8a8dc9ab (patch) | |
| tree | dda874417e9d21e8e3bc0358a02b31da5401c9ea /net/core/lock_debug.c | |
| parent | neighbour: Annotate neigh_table.phash_buckets and pneigh_entry.next with __rcu. (diff) | |
| download | kernel-d539d8fbd8fcf64a1492c51f5ee99aaa8a8dc9ab.tar.gz kernel-d539d8fbd8fcf64a1492c51f5ee99aaa8a8dc9ab.zip | |
neighbour: Free pneigh_entry after RCU grace period.
We will convert RTM_GETNEIGH to RCU.
neigh_get() looks up pneigh_entry by pneigh_lookup() and passes
it to pneigh_fill_info().
Then, we must ensure that the entry is alive till pneigh_fill_info()
completes, but read_lock_bh(&tbl->lock) in pneigh_lookup() does not
guarantee that.
Also, we will convert all readers of tbl->phash_buckets[] to RCU.
Let's use call_rcu() to free pneigh_entry and update phash_buckets[]
and ->next by rcu_assign_pointer().
pneigh_ifdown_and_unlock() uses list_head to avoid overwriting
->next and moving RCU iterators to another list.
pndisc_destructor() (only IPv6 ndisc uses this) uses a mutex, so it
is not delayed to call_rcu(), where we cannot sleep. This is fine
because the mcast code works with RCU and ipv6_dev_mc_dec() frees
mcast objects after RCU grace period.
While at it, we change the return type of pneigh_ifdown_and_unlock()
to void.
Signed-off-by: Kuniyuki Iwashima <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/core/lock_debug.c')
0 files changed, 0 insertions, 0 deletions
