diff options
author | Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> | 2016-03-10 18:33:07 -0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-03-13 22:29:07 -0400 |
commit | cea8768f333e3f0bc231d8b815aa4a9e63fa990c (patch) | |
tree | 60bf6ef493bdc7f9816f4c62f65b7aa106a9a0ce /net/sctp/associola.c | |
parent | 6f15cdbf8a8ac2e22767cc8b1eae225702733c95 (diff) | |
download | linux-stable-cea8768f333e3f0bc231d8b815aa4a9e63fa990c.tar.gz linux-stable-cea8768f333e3f0bc231d8b815aa4a9e63fa990c.tar.bz2 linux-stable-cea8768f333e3f0bc231d8b815aa4a9e63fa990c.zip |
sctp: allow sctp_transmit_packet and others to use gfp
Currently sctp_sendmsg() triggers some calls that will allocate memory
with GFP_ATOMIC even when not necessary. In the case of
sctp_packet_transmit it will allocate a linear skb that will be used to
construct the packet and this may cause sends to fail due to ENOMEM more
often than anticipated specially with big MTUs.
This patch thus allows it to inherit gfp flags from upper calls so that
it can use GFP_KERNEL if it was triggered by a sctp_sendmsg call or
similar. All others, like retransmits or flushes started from BH, are
still allocated using GFP_ATOMIC.
In netperf tests this didn't result in any performance drawbacks when
memory is not too fragmented and made it trigger ENOMEM way less often.
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/associola.c')
-rw-r--r-- | net/sctp/associola.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c index cd873446433c..a19b3e607703 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c @@ -1493,7 +1493,7 @@ void sctp_assoc_rwnd_increase(struct sctp_association *asoc, unsigned int len) asoc->peer.sack_needed = 0; - sctp_outq_tail(&asoc->outqueue, sack); + sctp_outq_tail(&asoc->outqueue, sack, GFP_ATOMIC); /* Stop the SACK timer. */ timer = &asoc->timers[SCTP_EVENT_TIMEOUT_SACK]; |