Embedded Software Streaming Embedded Software Streaming via Block Stream via Block Stream A Dissertation by Pramote Kucharoen Dissertation Advisor Professor Vincent J. Mooney III 7 April 2004
Outline Outline • Introduction • Related Work • Block Streaming • Stream-Enabled Program Files • Stream-Enabled File I/O • Performance Enhancement • Experiments and Results • Conclusion 2
Introduction Introduction Download Download Software Software Package & Package & Streaming Streaming Remote execution Remote execution 3
Running Applications Running Applications • On clients (download and install) – Advantages • Less servers’ computing requirements • Faster user interaction after installation complete – Disadvantages • Long download time • Clients’ limited resources • Unused features downloaded • On servers (remote execution) – Advantages • Applications not downloaded • Less clients’ computing requirements – Disadvantages • Overloading of servers • Slower user interactions • Connection loss 4
6 5 4 3 2 1 Software Streaming Software Streaming 5 4 3 1
Definitions Definitions • Software streaming – A method for allowing the execution of stream- enabled software even while transmission/streaming of the software may still be in progress • Application load time – the amount of time from when the application is selected for download to when the application can be executed • Application suspension time – the amount of time from when the application is suspended due to missing code to when the application can be resumed 6
Outline Outline • Introduction • Related Work • Block Streaming • Stream-Enabled Program Files • Stream-Enabled File I/O • Performance Enhancement • Experiments and Results • Conclusion 7
Related Work (1) Related Work (1) • Java – Allows execution without obtaining all classes – Sends class files when requested – Suspends the application for every class not in memory – Requires JVM – Assumes clients has enough memory to store the entire application 8
Related Work (2) Related Work (2) • Software caching [CH02] – Has high occurrence of application suspension • Liquid software [JH96] – Requires a fast (“gigabit”) compiler 9
Related Work (3) Related Work (3) • Function/module streaming [CK98][UR01] – Allows execution without obtaining all functions – Transfers functions speculatively to reduce the occurrence of application suspension – Assumes clients has enough memory to store the entire application – More difficult to manage memory 10
Related Work (4) Related Work (4) • Block streaming – Divides files into blocks – Streams at block level – No known prior work 11
Related Work (4) Related Work (4) Block Streaming Function/Module Streaming Java application load time application suspension Direct Download Software Caching resources Remote Execution 12
Outline Outline • Introduction • Related Work • Block streaming • Stream-Enabled Program Files • Stream-Enabled File I/O • Performance Enhancement • Experiments and Results • Conclusion 13
Block Streaming Block Streaming • Does not require virtual machines, virtual file system, compiler at client, special support from OS • Uses a binary rewriting technique • Supports embedded applications and small memory footprint devices • Implements at user level (not OS dependant) • Provides stream-enabled file I/O support 14
Objectives Objectives • To reduce application load time • To reduce application suspension time and occurrence of application suspension due to missing code/data • To efficiently utilize resources such as bandwidth and memory • To support small memory footprint embedded devices • To optimize the above four objectives simultaneously (as opposed to tradeoffs) 15
Objective tradeoffs Objective tradeoffs application occurrence of load time, application High resources suspension Low Data transfer Send when Send the entire requested application 16
Block Streaming: Stream Units Block Streaming: Stream Units Stream Units 0 Stream-Enabling Info Stream-Enabling Info Block Block Program Program 1 Stream-Enabling Info File/Data File Stream-Enabling Info File/Data File Block Block 2 Stream-Enabling Info Stream-Enabling Info Block Block … 17
Softstream Client/Server Model Softstream Client/Server Model 18
Softstream Protocol Layers Protocol Layers Softstream OSI Layers: Stream-enabled Application Application Stream-enabled Application Softstream Assembly Presentation Softstream Assembly Softstream Protocol Softstream Protocol Session TCP Transport TCP IP Network IP Link Subnetwork Subnetwork Physical 19
Transmission Profile Transmission Profile • Is created using a profiling method • Is used to send stream units 1 1 1 1 4 6 i=0 i=1 2 2 2 3 2 3 3 3 3 10 7 j=1 j=0 4 4 4 5 4 5 5 5 10 10 6 6 6 6 20
Flow Control (1) Flow Control (1) • Continuous stream – Sends stream units according to the transmission profile – Restarts a new sequence when requesting a missing stream unit 21
Flow Control (2) Flow Control (2) • On-demand stream – Sends stream units according to the transmission profile based on resource constraints 22
Performance Metrics Performance Metrics • Overhead – Bandwidth – Memory – Processing time • Application load time • Application suspension time • Occurrence of application suspensions due to missing code/data 23
Outline Outline • Introduction • Related Work • Block Streaming • Stream-Enabled Program Files • Stream-Enabled File I/O • Performance Enhancement • Experiments and Results • Conclusion 24
Stream- -Enabled Program Files Enabled Program Files Stream • Code generation • Code modification • Code profiling 25
System Overview System Overview Divide Binary Divide Binary Image into Image into Blocks Blocks Request Request Stream Unit Stream Unit Generate Generate Receive Block Stream Units Not in Memory Stream Units Create a Create a Off-block Link Stream Load Stream Transmission Link Stream Load Stream Transmission Profile Block Block Profile Block Block Encounter Off- In Memory Accept Accept Block Branch Request Program Entry Point Request Run the Run the Application Read Application Read Send Stream Send Stream Transmission Transmission Unit Unit Profile Profile Server Client 26
Generating Blocks Generating Blocks Binary Image Stream-Enabled Application 0 1000111010010010010001 Stream-Enabling Info 1000111010010010010001 Stream-Enabling Info 1000101111010011101001 Stream Unit 1000111010010010010001 1000101111010011101001 1000111010010010010001 0111101100010010100011 1000101111010011101001 0111101100010010100011 1000101111010011101001 1010010010010001100010 0111101100010010100011 1010010010010001100010 0111101100010010100011 1111010011101001011110 Source Code 1010010010010001100010 1111010011101001011110 1010010010010001100010 1100010010100011101001 1001011110110001001011 1100010010100011101001 1001011110110001001011 0010010001100010111101 0010010001100010111101 0011101001011110110001 0011101001011110110001 1 0010100011101001001001 Stream-Enabling Info GCC 0010100011101001001001 Stream-Enabling Info #include <stdio.h> 0001100010111101001110 Stream Unit #include <stdio.h> 0001100010111101001110 1000111010010010010001 int main() 1000111010010010010001 1001011110110001001010 int main() 1001011110110001001010 1000101111010011101001 1000101111010011101001 0011101001001001000110 0011101001001001000110 0111101100010010100011 int i; 0111101100010010100011 0010111101001110100101 int i; 0010111101001110100101 1010010010010001100010 1010010010010001100010 1110110001001010001110 1110110001001010001110 1001011110110001001011 1001011110110001001011 1001001001000110001011 1001001001000110001011 1101001110100101111011 1101001110100101111011 0001001010001110100100 0001001010001110100100 2 Stream-Enabling Info 1001000110001011110100 Stream-Enabling Info 1001000110001011110100 Stream Unit 1000111010010010010001 1110100101111011000100 1000111010010010010001 1110100101111011000100 1010001110100100100100 1000101111010011101001 1010001110100100100100 1000101111010011101001 0111101100010010100011 0110001011110100111010 0111101100010010100011 0110001011110100111010 1010010010010001100010 0101111011000100100010 1010010010010001100010 0101111011000100100010 0110100100100100010010 1001011110110001001011 0110100100100100010010 1001011110110001001011 27
Exiting and Entering a Block Exiting and Entering a Block … … branch bl comp bl comp … exception … comp: stwu r1,-31(r1) comp: stwu r1,-31(r1) after executing lwz r0,8(r1) lwz r0,8(r1) the last instruction cmpwi r0,1 cmpwi r0,1 bne .L3 bne .L3 return li r0,0 li r0,0 stw r0,8(r31) stw r0,8(r31) b .L4 b .L4 .L3: sc .L3: sc li r0,1 Off-block branch: Branch li r0,1 instruction that may cause stw r0,8(r31) stw r0,8(r31) the CPU to execution an li r3,0 instruction in a different li r3,0 .L4: … block .L4: … blr blr … … 28
Recommend
More recommend