History

sctp: introduce priority based stream scheduler

This patch introduces RFC Draft ndata section 3.4 Priority Based Scheduler (SCTP_SS_PRIO). It works by having a struct sctp_stream_priority for each priority configured. This struct is then enlisted on a queue ordered per priority if, and only if, there is a stream with data queued, so that dequeueing is very straightforward: either finish current datamsg or simply dequeue from the highest priority queued, which is the next stream pointed, and that's it. If there are multiple streams assigned with the same priority and with data queued, it will do round robin amongst them while respecting datamsgs boundaries (when not using idata chunks), to be reasonably fair. We intentionally don't maintain a list of priorities nor a list of all streams with the same priority to save memory. The first would mean at least 2 other pointers per priority (which, for 1000 priorities, that can mean 16kB) and the second would also mean 2 other pointers but per stream. As SCTP supports up to 65535 streams on a given asoc, that's 1MB. This impacts when giving a priority to some stream, as we have to find out if the new priority is already being used and if we can free the old one, and also when tearing down. The new fields in struct sctp_stream_out_ext and sctp_stream are added under a union because that memory is to be shared with other schedulers.

Marcelo Ricardo Leitner committed 9 years ago

Commit 637784a1 parent 0ccdf3c5 files · +377 −2Browse files

Showing the changes to include/uapi/linux (1 of 5 files). Show all

Unified · Split

include/uapi/linux/sctp.h+2−1
@@ -1099,7 +1099,8 @@ struct sctp_add_streams { · 1098 unmodified lines
10991099 /* SCTP Stream schedulers */
11001100 enum sctp_sched_type {
11011101 SCTP_SS_FCFS,
1102− SCTP_SS_MAX = SCTP_SS_FCFS
1102+ SCTP_SS_PRIO,
1103+ SCTP_SS_MAX = SCTP_SS_PRIO
11031104 };
11041105
11051106 #endif /* _UAPI_SCTP_H */