Last Time. u Priority-based scheduling. u Schedulable utilization u Rate monotonic rule: Keep utilization below 69%

Similar documents
Final Review. Chenyang Lu. CSE 467S Embedded Compu5ng Systems

Real-Time Scheduling Single Processor. Chenyang Lu

87 faces of the English clause

Calculating Equivalent and Compensating Variations in CGE Models

PUBLIC SERVICE COMMISSION OF WEST VI'RGINIA CHARLESTON PROCEDURE. required to satisfy said complaint or make answer thereto, in writing,

Introduc)on to Hierarchical Models 8/25/14. Hierarchical Models in Population Ecology. What are they and why should we use them? Topics of Discussion

CONSTITUTION OF ADASTRAL PARK LEISURE AND SPORTS (ATLAS) BODY TALK GYM CLUB

Judicial Review as a Constraint on Tyranny of the Majority

PROPOSED AMENDMENTS TO THE BOARD OF REGENTS POLICY ON WEAPONS POSSESSION

FOREIGN WORKERS IN SOUTHERN AGRICULTURE *

Matter of Diaz v New York City Dept. of Health & Mental Hygiene 2013 NY Slip Op 32360(U) September 25, 2013 Supreme Court, New York County Docket

State of New York Public Employment Relations Board Decisions from September 5, 1974

World Income Distribution and Mobility

Combating Housing Benefit Fraud: Local Authorities' Discretionary Powers

Did Illegal Overseas Absentee Ballots Decide the 2000 U.S. Presidential Election? 1

% % ^GRANT CHANDLER, CHAIRMAN. PBPmftMCK NQ.».

UC Irvine CSD Working Papers

I i IN THE COURT OF APPEAL OF THE DEMOCRATIC SOCIALIST REPUBLIC OF SRI LANKA CA 1 WAKFS 1 01/2017. I j

CASSETTE TYPE AIR CONDITIONER OWNER S MANUAL

- r. &he Gazette of Andia (a) ~~m;t-im;imjmit~&~~~is9f&i PUBLISHED BY AUTHOFUTY. otm 11-m3-3P-m (i) REGD. NO. D. L;-33~"

Return Migration, Investment in Children, and Intergenerational Mobility: Comparing Sons of Foreign and Native Born Fathers

Is There Really a Border Effect?

Why Haven t Regional Wages Converged?

ELEVENTH GUfu'lLEGISLATURE 1972 (SECOND) Regular Session. CERTIFICATION OF PASSAGE OF AN ACT TO THE C"'()VEfu"\fOR

Immigration New Zealand Operational Manual. Border entry. Issue Date: 29 Novemer 2010

J l. Communications Service Tax (Amendment) Act. Act 864 ,.. J. Section

On the Duration of Comparative Advantages of Top European Wine Producers Jeremiás Máté BALOGH, Attila JÁMBOR

The Optimal Weighting of Pre-Election Polling Data

Regional Disparities in West German Unemployment

Cyber-Physical Systems Scheduling

DETERMINANTS OF UNEMPLOYMENT AND EARNINGS IN SOUTH AFRICA. Master of Science in Statistics

Can the Introduction of a Minimum Wage in FYR Macedonia Decrease the Gender Wage Gap?

Discrimination and Hostile Work Environment Claims Based upon Religion, National Origin, and Alienage

AN ARBITRATION BETWEEN BEFORE : I MARSHALL A. SNIDER ARBITRATORI

American Law & Economics Association Annual Meetings

Money is where the fun ends: material interests and individuals preference for direct democracy

SECTION I - BASIC INFORMATION REGARDING REPORT. 200 MacDill Blvd. Washington, D.C SECTION II - MAKING A FOIA REQUEST

SURVEY ON FOREIGN TRAVELERS METHODOLOGY AND IMPLEMENTATION

The Roles of Foreign Aid and Education in the War on Terror

Fairfield Sentry and the limits of comity in Chapter15cases

SECTION II - MAKING A FOIA REQUEST. SECTION Ill - ACRONYMS, DEFINITIONS AND EXEMPTIONS

Oregon Round Dance Teachers Association

Financing Direct Democracy: Revisiting the Research on Campaign Spending and Citizen Initiatives

Prepared for PC35 only

Garcia v Estate of Scott 2015 NY Slip Op 30567(U) March 2, 2015 Sup Ct, Bronx County Docket Number: /2012 Judge: Alison Y. Tuitt Cases posted

Immigration New Zealand Operational Manual. Border Entry. Issue Date: 2 March 2009

Does Bicameralism Matter?

The Law Commission FAMILY LAW THE GROUND FOR DIVORCE. of the Law Commissions Act 1965

LEGAL STATUS AND U.S. FARM WAGES

Board of Trustees Meeting Minutes

Operating Systems. Chenyang Lu

THIS FIRST AMENDMENT TO THE LEASE (this First Amendment ) is made and entered into this day of

Income Segregation and Suburbanization in France : a discrete choice approach

TWELFTH QJAM L~GISLATURE 1974 (SECOND) Regular Session

Proximity, Regional Integration and Weak Trade among African Countries Perspective from SADC

Case3:09-cv JSW Document1 Filed09/11/09 Page1 of 17. to 5 E LJ. Defendants. )

IN THE THIRTEENTH JUDICIAL CIRCUIT HILLSBOROUGH COUNTY, FLORIDA. ADMINISTRA TIVE ORDER S (Supersedes Administrative Order S )

Ethnic minorities in the UK: burden or benefit?

Attorney Docket Number Application Number

How Interest Groups with Limited Resources can Influence Political Outcomes: Information Control and the Landless Peasant Movement in Brazil

HEALTH, WELFARE AND STATE INSTITUTIONS. Minutes of Meeting - April 18, '75

of any issue of law or fact, to the entry of the

Matter of Brasky v City of New York 2006 NY Slip Op 30744(U) March 15, 2006 Supreme Court, New York County Docket Number: /05 Judge: Lottie E.

Department without an admission of wrongdoing and for the purposk of resolving this matter

8/19/16. Clustering. Clustering is a hard problem. Clustering is a hard problem

Document de treball de l IEB 2009/8

No IN THE UNITED STATES COURT OF APPEALS FOR THE NINTH CIRCUIT

IN THE COURT OF APPEAL OF THE DEMOCRATIC SOCIALIST REPUBLIC OF SRI LANKA.

The Effects of District Magnitude on Voting Behavior

Privacy and fairness in a variant of Prêt-à-voter

Scoring Guidelines and Notes for Document-Based Question

Real-Time CORBA. Chenyang Lu CSE 520S

The E ects of District Magnitude on Voting Behaviour

Innovations In Greek Political Communication And Consequences: Significant changes from

Responder. party to bring this. Whueu, on November 9, 2011, Ma. Adams applied for a. i I misdemeanor charqe for Drivinq While License Revoked in the

Constitution of the Broad MBA Association

Governance and economic growth: The case of Middle Eastern and North African countries

***** VIRGINIA BOARD OF BAR EXAMINERS Roanoke, Virginia - July 24,2007

POLITICAL REGIME DURABILITY, DEVELOPMENT AND GOVERNANCE: THE ROMANIA S CASE. Mihai MUTASCU *

Case 3:09-cv MAP Document 1 Filed 07/23/2009 Page 1 of 17 UNITED STATES DISTRICT COURT MASSACHUSETTS

An Integrated Computational Model of Multiparty Electoral Competition

Economic recessions are one of the most robust

AGENDA REQUEST AGENDA ITEM NO: V.5. Board Appointments. December 7, 2015 BY City Auditor and Clerk Pamela M. Nadalini City Auditor and Clerk Nadalini

WORKING PAPER 2000:9. Ethnic enclaves and the economic success of immigrants - evidence from a natural experiment

BY-LAW NO NOW THEREFORE the Council of The Corporation of the City of Kingston hereby ENACTS as follows.

SEA GRANT LEGAL PROGRAM N_. _;or_. 56 LAW CENTER, L.S.U. U.S.p_,,9, BATON ROUGE, LA PAID PormrtNo. 733 Bn_ Rouge,_.

* Roll Call Number Agenda Item.?il

Hukou and Highways WPS7350. Policy Research Working Paper 7350

Tradable Refugee-Admission Quotas and EU Asylum Policy

SYRIA ACHIEVEMENTS F U NDING OV E RV I E W SYRIA CRISIS RESPONSE COUNTRY RESPONSE OVERVIEW. Non Food Items (NFIs) & Shelter

Legal Strategies for FDA Consent Decrees

The effect of motherhood on wages and wage growth: evidence for Australia

A comparative study of the use of the Istanbul Protocol amongst civil society organizations in low-income countries i

CONVERGENCE AND INTERDEPENDENCE AT THE CIVIL-MILITARY INTERFACE. David R. Segal. Army Research Institute. University of Michigan

Defensive Counterterrorism Measures and Domestic Politics

AGENDA REQUEST AGENDA ITEM NO: V.3. Board Appointments. July 21, 2014 BY City Auditor and Clerk Pamela M. Nadalini City Auditor and Clerk Nadalini

TOWN CENTRES - RULES Queenstown Town Centre Zone Rules Activities Zone Purpose Controlled Activities

Loreley Fin. (Jersey) No. 3, Ltd. v Morgan Stanley & Co. Inc NY Slip Op 32624(U) October 1, 2014 Sup Ct, New York County Docket Number:

Economy and Turnout: Class Differences in the 2000 U.S. Presidential Election Uisoon Kwon University of Minnesota Duluth

Biased Democracies: The Social and Economic Logic of Interest-Based Voting

Transcription:

Last Tme u Prorty-based schedulng Ø Statc prortes Ø Dynamc prortes u Schedulable utlzaton u Rate monotonc rule: Keep utlzaton below 69%

Today u Response tme analyss u Blockng terms u Prorty nverson Ø And solutons u Release jtter u Other extensons

Response Tme vs. RM u Rate monotonc result Ø Tells us that a broad class of embedded systems meet ther tme constrants: Scheduled usng fxed prortes wth RM or DM prorty assgnment Total utlzaton not above 69% Ø However, doesn t gve very good feedback about what s gong on wth a specfc system u Response tme analyss Ø Tells us for each task, what s the longest tme between when t s released and when t fnshes Ø Then these can be compared wth deadlnes Ø Gves nsght nto how close the system s to meetng / not meetng ts deadlne Ø Is more precse (rejects fewer systems)

Computng Response Tme u WC response tme of hghest prorty task R 1 Ø R 1 = C 1 Ø Hopefully obvous u WC response tme of second-prorty task R 2 Ø Case 1: R 2 T 1 R 2 = C 2 + C 1 R 1 R 2 T 1 T 2 1 2 1

More Second-Prorty u Case 2: T 1 < R 2 2T 1 Ø R 2 = C 2 + 2C 1 T 1 R 2 R 1 2T 1 T 2 1 2 1 2 1 u Case 3: 2T 1 < R 2 3T 1 Ø R 2 = C 2 + 3C 1 u General case of the second-prorty task: Ø R 2 = C 2 + celng ( R 2 / T 1 ) C 1

Task Response Tme u General case: R = C + j hp() R Tj C j u hp() s the set of tasks wth prorty hgher than I Ø Only hgher-prorty tasks can delay a task u Problem wth usng ths equaton n practce?

Computng Response Tmes u Rewrte as a recurrence relaton and solve by teratng: R u Fnshed when R n+1 = R n Ø Or when R n > D n+ 1 = u Choose R 0 = 0 or R 0 = C Ø There may be many solutons to the recurrence C Ø These startng ponts guarantee convergence to the smallest soluton (unless there s dvergence) u Result s nvald f R > T Ø Why? + j hp( ) R T n j C j

Response Tme Example u Task 1: T = 30, D = 30, C = 10 u Task 2: T = 40, D = 40, C = 10 u Task 3: T = 52, D = 52, C = 12 u Utlzaton = 81% Rejected by the rate monotonc test! R n+ 1 = C + j hp( ) R T n j C j u R 1 = 10 u R 2 = 20 u R 3 = 52

Sharng Resources u So far tasks are assumed to be ndependent Ø Not allowed to block (e.g. on a network devce) Ø Not allowed to contend for shared resources u Bg problem n practce! u Soluton: Ø Compute worst-case blockng tme for each task Ø Longest tme that task s delayed by a lower-prorty task Ø Why just lower prorty? u Now we can analyze the system agan: R n+ 1 = C + B + j hp( ) R T n j C j

Computng Blockng Terms u How do we compute blockng terms? Ø Depends on the synchronzaton protocol u Tasks synchronze by dsablng nterrupts Ø Best answer: Each task gets blockng term wth length of the longest crtcal secton n a lower-prorty task Ø Smpler answer: Each task gets blockng term wth length of the longest crtcal secton n any task Ø Why do these work? u Tasks synchronze usng mutexes Ø Blockng term generally mpossble to bound oops! Ø Standard thread locks are unfrendly to real-tme systems Lock wat queue s FIFO Ø Possble soluton: Prorty queues for mutexes

Prorty Inverson u Prorty nverson: Low-prorty task delays a hgh prorty task Ø Mutexes (even wth prorty queung) provde unbounded prorty nverson preempton P(s) blocks T1 3 1 2 P(s) succeeds

Prorty Inverson Case Study u Mars Pathfnder Ø Lands on Mars July 4 1997 Ø Msson s successful u Behnd the scenes Ø Sporadc total system resets on the rover Ø Caused by prorty nverson Ø Debugged on the ground, software patch uploaded to fx thngs u Detals Ø Rover controlled by a sngle RS6000 runnng vxworks Ø Rover devces polled over 1553 bus Ø At 8 Hz bc_sched task sets up bus transactons Ø bc_dst task runs (also at 8 Hz) to read back data

More Pathfnder u Symptom: Ø bc_sched sometmes was not fnshed by the tme bc_dst ran Ø Ths trggered a system reset Should never happen snce these tasks are hgh prorty u Problem: bc_sched shared a mutex wth ASI/MET task, whch does meteorologcal scence at low prorty Ø Occasonally the classc prorty nverson happened when there were long-runnng medum prorty tasks u Soluton: Ø vxworks supports prorty nhertance wth a global flag Ø They turned t on

Prorty Inverson Solutons 1. Avod blockng dsable nterrupts nstead u u Pros: u Effcent u Smple Con: u Also delays unrelated, hgh prorty tasks 2. Immedate prorty celng protocol before lockng, rase prorty to hghest prorty of any thread that can touch that semaphore u u Pros: u Farly smple u Less blockng of unrelated tasks Cons: u Requres ahead-of-tme system analyss u Stll has some pessmstc blockng

Prorty Inverson Solutons 3. Prorty nhertance protocol When a task s blockng other tasks (by holdng a mutex) t executes at the prorty of the hghest-prorty blocked task u u Pros u No pessmstc blockng Cons u Complcated n presence of nested lockng u Not that effcent u Blockng terms larger than IPCP u Other solutons exst, such as lock-free synchronzaton

IPCP Bonus u In IPCP, rasng prorty prevents anyone else who mght access a resource from runnng Ø So why take a lock at all? Ø Turns out that lockng s not necessary rasng prorty s enough Ø HOWEVER: Task must not voluntarly block (e.g. on dsk or network) whle n a crtcal secton

Overheads u A real RTOS requres tme to: Ø Block a task Ø Make a schedulng decson Ø Dspatch a new task Ø Handle tmer nterrupts u For a well-desgned RTOS these tmes can be bounded Ø Worst-case blockng tme of the RTOS needs to be added to each task s blockng term Ø 2x worst-case context swtch tme needs to be added to each task s WCET We always charge the cost of a context swtch to the hgher-prorty task

Release Jtter u Release jtter J Tme between nvocaton of task and tme at whch t can actually run Ø E.g. task becomes conceptually runnable at the start of ts perod But must wat for the next tmer nterrupt before the scheduler sees t and dspatches t Ø Or, task would lke to run but must wat for network data to arrve before t actually runs R = C + B + j hp() R + Tj J C j

Other Extensons u Sporadcally perodc tasks Ø Task has an outer perod and smaller nner perod Ø Models bursty processng lke network nterrupts u Sporadc servers Ø Provde rate-lmtng for truly aperodc processng E.g. nterrupts from an untrusted devce u Arbtrary deadlnes Ø When D > T prevous equatons do not apply Ø Can rewrte u Precedence constrants Ø Task A cannot run untl Task B has completed Models scenaro where tasks feed data to each other Ø Makes t harder to schedule a system

Summary u Prorty based schedulng Ø It s what RTOSs support Ø A strong body of theory can be used to analyze these systems Ø Theory s practcal: Many real-world factors can be modeled u Response tme analyss supports worst-case response tme for each prorty-based task Ø Blockng terms Ø Release jtter u Prorty nverson can be a major problem Ø Solutons have nterestng tradeoffs