diff options
| author | Qingfang Deng <dqfext@gmail.com> | 2025-08-28 09:20:16 +0800 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2025-08-29 13:39:53 -0700 |
| commit | 72cdc67e7fa74931b055df3a76852bab551f1a04 (patch) | |
| tree | 2e62cddcf0bb3f7728f804c49151fe689d71ec59 /scripts/gdb/linux/pgtable.py | |
| parent | d23ad54de795ec0054f90ecb03b41e8f2c410f3a (diff) | |
pppoe: remove rwlock usage
Like ppp_generic.c, convert the PPPoE socket hash table to use RCU for
lookups and a spinlock for updates. This removes rwlock usage and allows
lockless readers on the fast path.
- Mark hash table and list pointers as __rcu.
- Use spin_lock() to protect writers.
- Readers use rcu_dereference() under rcu_read_lock(). All known callers
of get_item() already hold the RCU read lock, so no additional locking
is needed.
- get_item() now uses refcount_inc_not_zero() instead of sock_hold() to
safely take a reference. This prevents crashes if a socket is already
in the process of being freed (sk_refcnt == 0).
- Set SOCK_RCU_FREE to defer socket freeing until after an RCU grace
period.
- Move skb_queue_purge() into sk_destruct callback to ensure purge
happens after an RCU grace period.
Signed-off-by: Qingfang Deng <dqfext@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20250828012018.15922-1-dqfext@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'scripts/gdb/linux/pgtable.py')
0 files changed, 0 insertions, 0 deletions
