diff options
author | Florian Westphal <fw@strlen.de> | 2020-02-26 12:14:51 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-02-27 07:46:26 +0300 |
commit | 2e52213c79c0b94aff42ba898ad9ad57546be67d (patch) | |
tree | 87979d44054a051fdc13afd8b36474c4ced32f6a /net/mptcp/subflow.c | |
parent | bfae9dae449d5eeb196a071fe4720504362672b4 (diff) | |
download | linux-2e52213c79c0b94aff42ba898ad9ad57546be67d.tar.xz |
mptcp: avoid work queue scheduling if possible
We can't lock_sock() the mptcp socket from the subflow data_ready callback,
it would result in ABBA deadlock with the subflow socket lock.
We can however grab the spinlock: if that succeeds and the mptcp socket
is not owned at the moment, we can process the new skbs right away
without deferring this to the work queue.
This avoids the schedule_work and hence the small delay until the
work item is processed.
Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mptcp/subflow.c')
-rw-r--r-- | net/mptcp/subflow.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index 37a4767db441..0de2a44bdaa0 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -563,7 +563,7 @@ static void subflow_data_ready(struct sock *sk) } if (mptcp_subflow_data_available(sk)) - mptcp_data_ready(parent); + mptcp_data_ready(parent, sk); } static void subflow_write_space(struct sock *sk) @@ -696,7 +696,7 @@ static void subflow_state_change(struct sock *sk) * the data available machinery here. */ if (parent && subflow->mp_capable && mptcp_subflow_data_available(sk)) - mptcp_data_ready(parent); + mptcp_data_ready(parent, sk); if (parent && !(parent->sk_shutdown & RCV_SHUTDOWN) && !subflow->rx_eof && subflow_is_done(sk)) { |