OSDN Git Service

mptcp: avoid atomic bit manipulation when possible
authorPaolo Abeni <pabeni@redhat.com>
Fri, 7 Jan 2022 00:20:26 +0000 (16:20 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 7 Jan 2022 11:27:07 +0000 (11:27 +0000)
commite9d09baca67625cfb41c0f2b547b9dbb4043ae95
treea9765cd538be65d85c5cc6f1e8069c8782a507cf
parent3e5014909b5661b3da59990d72a317a45ba3b284
mptcp: avoid atomic bit manipulation when possible

Currently the msk->flags bitmask carries both state for the
mptcp_release_cb() - mostly touched under the mptcp data lock
- and others state info touched even outside such lock scope.

As a consequence, msk->flags is always manipulated with
atomic operations.

This change splits such bitmask in two separate fields, so
that we use plain bit operations when touching the
cb-related info.

The MPTCP_PUSH_PENDING bit needs additional care, as it is the
only CB related field currently accessed either under the mptcp
data lock or the mptcp socket lock.
Let's add another mask just for such bit's sake.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/protocol.c
net/mptcp/protocol.h
net/mptcp/subflow.c