summaryrefslogtreecommitdiffstats
path: root/net/sctp/chunk.c
diff options
context:
space:
mode:
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>2017-10-03 18:20:11 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-03 19:27:28 -0400
commitf952be79cebd49d04154781d99408867a069d375 (patch)
treece68d2060940a95d6a8657bc44d261d856668bd5 /net/sctp/chunk.c
parent1fdb8d8fefe2e7320ea15a65051758a4c4332f05 (diff)
sctp: introduce struct sctp_stream_out_ext
With the stream schedulers, sctp_stream_out will become too big to be allocated by kmalloc and as we need to allocate with BH disabled, we cannot use __vmalloc in sctp_stream_init(). This patch moves out the stats from sctp_stream_out to sctp_stream_out_ext, which will be allocated only when the application tries to sendmsg something on it. Just the introduction of sctp_stream_out_ext would already fix the issue described above by splitting the allocation in two. Moving the stats to it also reduces the pressure on the allocator as we will ask for less memory atomically when creating the socket and we will use GFP_KERNEL later. Then, for stream schedulers, we will just use sctp_stream_out_ext. Tested-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/chunk.c')
-rw-r--r--net/sctp/chunk.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c
index 3afac275ee82..7b261afc47b9 100644
--- a/net/sctp/chunk.c
+++ b/net/sctp/chunk.c
@@ -311,10 +311,10 @@ int sctp_chunk_abandoned(struct sctp_chunk *chunk)
311 311
312 if (chunk->sent_count) { 312 if (chunk->sent_count) {
313 chunk->asoc->abandoned_sent[SCTP_PR_INDEX(TTL)]++; 313 chunk->asoc->abandoned_sent[SCTP_PR_INDEX(TTL)]++;
314 streamout->abandoned_sent[SCTP_PR_INDEX(TTL)]++; 314 streamout->ext->abandoned_sent[SCTP_PR_INDEX(TTL)]++;
315 } else { 315 } else {
316 chunk->asoc->abandoned_unsent[SCTP_PR_INDEX(TTL)]++; 316 chunk->asoc->abandoned_unsent[SCTP_PR_INDEX(TTL)]++;
317 streamout->abandoned_unsent[SCTP_PR_INDEX(TTL)]++; 317 streamout->ext->abandoned_unsent[SCTP_PR_INDEX(TTL)]++;
318 } 318 }
319 return 1; 319 return 1;
320 } else if (SCTP_PR_RTX_ENABLED(chunk->sinfo.sinfo_flags) && 320 } else if (SCTP_PR_RTX_ENABLED(chunk->sinfo.sinfo_flags) &&
@@ -323,7 +323,7 @@ int sctp_chunk_abandoned(struct sctp_chunk *chunk)
323 &chunk->asoc->stream.out[chunk->sinfo.sinfo_stream]; 323 &chunk->asoc->stream.out[chunk->sinfo.sinfo_stream];
324 324
325 chunk->asoc->abandoned_sent[SCTP_PR_INDEX(RTX)]++; 325 chunk->asoc->abandoned_sent[SCTP_PR_INDEX(RTX)]++;
326 streamout->abandoned_sent[SCTP_PR_INDEX(RTX)]++; 326 streamout->ext->abandoned_sent[SCTP_PR_INDEX(RTX)]++;
327 return 1; 327 return 1;
328 } else if (!SCTP_PR_POLICY(chunk->sinfo.sinfo_flags) && 328 } else if (!SCTP_PR_POLICY(chunk->sinfo.sinfo_flags) &&
329 chunk->msg->expires_at && 329 chunk->msg->expires_at &&