net: drop nopreempt requirement on sock_prot_inuse_add()

[ Upstream commit b3cb764aa1 ]

This is distracting really, let's make this simpler,
because many callers had to take care of this
by themselves, even if on x86 this adds more
code than really needed.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stable-dep-of: a9bf9c7dc6 ("af_unix: Annotate data-race of sk->sk_state in unix_stream_connect().")
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Eric Dumazet
2021-11-15 09:11:50 -08:00
committed by Greg Kroah-Hartman
parent aa4ed1e0f6
commit c8f2ebbb0e
10 changed files with 10 additions and 31 deletions
+2 -2
View File
@@ -1464,11 +1464,11 @@ proto_memory_pressure(struct proto *prot)
struct prot_inuse {
int val[PROTO_INUSE_NR];
};
/* Called with local bh disabled */
static inline void sock_prot_inuse_add(const struct net *net,
const struct proto *prot, int val)
{
__this_cpu_add(net->core.prot_inuse->val[prot->inuse_idx], val);
this_cpu_add(net->core.prot_inuse->val[prot->inuse_idx], val);
}
int sock_prot_inuse_get(struct net *net, struct proto *proto);
int sock_inuse_get(struct net *net);