summaryrefslogtreecommitdiffstats
path: root/net/sctp/sm_sideeffect.c
diff options
context:
space:
mode:
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>2016-04-29 14:17:08 -0300
committerDavid S. Miller <davem@davemloft.net>2016-05-01 21:06:10 -0400
commit0970f5b3665933f5f0d069607c78fb10bd918b62 (patch)
treed9dac95d765c7337d9e32cbd0cc2013aba5bb74f /net/sctp/sm_sideeffect.c
parent70e927b98bb632e0c987818835aacd6787ebe107 (diff)
downloadlinux-0970f5b3665933f5f0d069607c78fb10bd918b62.tar.gz
linux-0970f5b3665933f5f0d069607c78fb10bd918b62.tar.bz2
linux-0970f5b3665933f5f0d069607c78fb10bd918b62.zip
sctp: signal sk_data_ready earlier on data chunks reception
Dave Miller pointed out that fb586f25300f ("sctp: delay calls to sk_data_ready() as much as possible") may insert latency specially if the receiving application is running on another CPU and that it would be better if we signalled as early as possible. This patch thus basically inverts the logic on fb586f25300f and signals it as early as possible, similar to what we had before. Fixes: fb586f25300f ("sctp: delay calls to sk_data_ready() as much as possible") Reported-by: Dave Miller <davem@davemloft.net> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/sm_sideeffect.c')
-rw-r--r--net/sctp/sm_sideeffect.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index e8f0112f9b28..aa3712259368 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -1741,10 +1741,9 @@ out:
} else if (local_cork)
error = sctp_outq_uncork(&asoc->outqueue, gfp);
- if (sp->pending_data_ready) {
- sk->sk_data_ready(sk);
- sp->pending_data_ready = 0;
- }
+ if (sp->data_ready_signalled)
+ sp->data_ready_signalled = 0;
+
return error;
nomem:
error = -ENOMEM;