Multimedia/Real-Time Prashanth Reddy Multimedia and Real-Time • Audio and Video – Continuous Media (CM) • Graphics – Discrete media • CM – High data rates – Timing requirements • Soft real-time applications Problems • Traditional OSs do not provide good support – Schedulers • Round Robin, Priority scheduling • No sense of urgency – Large number of user-kernel level interactions • Efficient usage of resources • Varying demands • Delays, jitter Papers • Scheduling and IPC Mechanisms for Continuous Media – New scheduling and IPC mechanisms • Split-level scheduling – User-level and kernel-level scheduler – Use shared memory • Memory mapped streams – Shared memory FIFO Papers • User-specified Adaptive Scheduling in a Streaming Media Network – Deliver data in resource-limited, small-scale environments – Meet the preferences and demands of the users – MediaNet – a distributed stream processing system Deadline/Workahead Scheduling • Each message has a logical arrival time l(m) • Each real-time process has a fixed logical delay bound • A real-time process is critical at time ‘t’ if l(m) <= t • Workahead processes - real-time processes that have pending messages but not critical DWS contd… Split-level CPU scheduling • Combines the advantages of thread and LWPs • Minimizes user/kernel interactions • Also prioritizes LWPs in different VASs correctly • Kernel level scheduler and user level scheduler communicate through shared memory Split-level scheduling contd… Split-level scheduling contd… Memory Mapped Streams • CM data must be moved to/from kernel • Components – Control and Synchronization – Data location transfer – Data transfer • Requires user/kernel interaction in one or more of the above components MMS contd… • A shared memory FIFO • Uses shared memory for control and synchronization • Uses shared memory to hold data location and the data • Mechanisms – Statically shared pages of physical memory – Fixed range of virtual pages, mapped dynamically – Array of “message descriptors” Performance Evaluation Performance Evaluation contd… Summary • Proper scheduling through Split-level scheduling and usage of shared memory • MMS – low-overhead IPC mechanism • Reduced user-kernel interactions User-specified Adaptive Scheduling in a Streaming Media Network • MediaNet – a distributed stream processing system • Users can specify how the system should adapt • Uses local and global resource scheduling • Adapts without resource reservation MediaNet Architecture Video source User’s desired stream & adaptation prefs subscribe schedules Global scheduling service Video description, location, & resource info publish from MediaNet’s website feedback Video player Specifications • Continuous Media Network (CMN) – Directed acyclic graph of operations • frame dropping, transcoding, compression and decompression etc. • User specification – One or more CMNs, each with associated utility value • Goal: Maximize users’ utility while utilizing the network efficiently Operations frm1 … Op … frmn Other attributes • Fixed location? • Transitional? from MediaNet’s website Frame size Interval Example User Specification Utility CMN 1.0 Vid Prio* pcS 0.3 pcD Vid Prio* pcS 0.1 Vid pcS User Prio* Drop B Prio* Drop PB Prio* User pcD User pcD Scheduling Scheduling contd… Implementation • Global scheduling service – implemented on a single node – eventually hierarchical • Local, per-node schedulers – monitor and report available bandwidth; eventually CPU + memory usage – implement local CMNs • Global scheduler reconfigures schedules online Local Scheduler • Implement the CMN given by the GS – Must correctly reconfigure on-line • Report monitoring info back to GS • Implemented in Cyclone – Type-safe, C-like language – One component per operation, dynamically reconfigurable • Uses TCP for send/receive Monitoring • Monitor available bandwidth – Keep track of TCP throughput, attempted vs. actual bandwidth • Send regular reports to global scheduler • Too pessimistic – “creep” bandwidth estimate additively to optimistically attempt higher utility configs Reconfiguration • New configuration is applied in parallel with the current configuration – Old operations are “flushed” along the dataflow path – New operations are enabled when all old ones are flushed on a particular node • Challenges – Rapid reconfiguration – Low disruption to stream Experiments • Conducted on 8 850 MHz PIII’s, 512 MB RAM, 100 Mb/s Ethernet, Red Hat Linux 7.1 using a “bowtie” topology: MPEG clip Bandwidth Requirements Frame rate I+P+B I+P I 30 fps 145 KB/s 88 KB/s 27 KB/s Results No adaptation Local, proactive frame dropping Priority-based frame dropping MediaNet Multi-User Performance Multi-User Performance contd… Multi-User Performance contd… B frame dropping op Multi-User Performance contd… B frame dropping op Summary • Application-specific QoS via user specs • High network utilization and per-user utility via global scheduling: – Share resources between flows in a multicast-like manner, but generalized to CMNs – Utilize multiple, redundant paths – Intelligently place operations to reduce network utilization • Adapts to resource availabilities on-line Conclusion • Split-level scheduling – Tight coupling between user-level and kernellevel schedulers – Difficult to employ multiple scheduling policies • Scalability – Hierarchical global scheduling service • Automate setting utility values Acknowledgements • Some of the slides have been taken from MediaNet’s website: http://www.cs.umd.edu/projects/medianet/ Thank You