mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 16:54:20 +08:00
0daf07e527
Using rwlock in networking code is extremely risky.
writers can starve if enough readers are constantly
grabing the rwlock.
I thought rwlock were at fault and sent this patch:
https://lkml.org/lkml/2022/6/17/272
But Peter and Linus essentially told me rwlock had to be unfair.
We need to get rid of rwlock in networking code.
Without this fix, following script triggers soft lockups:
for i in {1..48}
do
ping -f -n -q 127.0.0.1 &
sleep 0.1
done
Fixes: 1da177e4c3
("Linux-2.6.12-rc2")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
29 lines
856 B
C
29 lines
856 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _NET_RAWV6_H
|
|
#define _NET_RAWV6_H
|
|
|
|
#include <net/protocol.h>
|
|
#include <net/raw.h>
|
|
|
|
extern struct raw_hashinfo raw_v6_hashinfo;
|
|
bool raw_v6_match(struct net *net, struct sock *sk, unsigned short num,
|
|
const struct in6_addr *loc_addr,
|
|
const struct in6_addr *rmt_addr, int dif, int sdif);
|
|
|
|
int raw_abort(struct sock *sk, int err);
|
|
|
|
void raw6_icmp_error(struct sk_buff *, int nexthdr,
|
|
u8 type, u8 code, int inner_offset, __be32);
|
|
bool raw6_local_deliver(struct sk_buff *, int);
|
|
|
|
int rawv6_rcv(struct sock *sk, struct sk_buff *skb);
|
|
|
|
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
|
|
int rawv6_mh_filter_register(int (*filter)(struct sock *sock,
|
|
struct sk_buff *skb));
|
|
int rawv6_mh_filter_unregister(int (*filter)(struct sock *sock,
|
|
struct sk_buff *skb));
|
|
#endif
|
|
|
|
#endif
|