SlideShare uma empresa Scribd logo
1 de 9
Baixar para ler offline
RTAI
Políticas de Escalonamento
           Walter Fetter Lages
            w.fetter@ieee.org


Universidade Federal do Rio Grande do Sul
          Escola de Engenharia
  Departamento de Engenharia Elétrica
   ENG04008 Sistemas de Tempo Real




                                        Copyright (c) Walter Fetter Lages – p.1
Políticas de Escalonamento
•   Independentemente da política, o escalonamento
    do RTAI é preemptivo e baseado em prioridades
     • A tarefa de maior prioridade executa
     • As tarefas de menor prioridade são
       bloqueadas
     • Tarefas de menor prioridade são
       "preemptadas"caso uma tarefa de prioridade
       maior seja liberada
•   A política de escalonamento pode ser selecionada
    por tarefa


                                       Copyright (c) Walter Fetter Lages – p.2
Políticas Suportadas

•   First-in first-out (FIFO)
•   Round robin (RR)
•   Rate monotonic (RMS)
•   Deadline monotonic (DMS)
•   Earliest deadline first (EDF)




                                   Copyright (c) Walter Fetter Lages – p.3
First-in Fitst-out

•   É a política default
•   As tarefas apenas são "preemptadas"por tarefas
    de maior prioridade
•   As demais tarefas com a mesma prioridade da
    tarefa executando, só executam quando esta
    liberar a CPU




                                        Copyright (c) Walter Fetter Lages – p.4
Round Robin
•   Só está disponível se for habilitada na
    configuração do RTAI
•   As tarefas podem ser "preemptadas"por tarefas de
    maior prioridade ou por tarefas de mesma
    prioridade quando o quantum expirar
•   Pode ser atribuída a cada tarefa através da função
    rt_set_sched_policy(RT_TASK *task,int policy,
        int rr_quantum_ns)
•   A política pode ser RT_SCHED_FIFO ou
    RT_SCHED_RR
•   rr_quantum_ns=0 utiliza o tick do Linux

                                         Copyright (c) Walter Fetter Lages – p.5
Rate Monotonic
•   Pode ser vista como um caso particular da
    política FIFO
     • Apenas uma tarefa em cada nível de
       prioridade
     • Prioridade maior atribuída a tarefas com o
       menor período
•   Quando se utiliza criação dinâmicas de tarefas
    pode ser complicado garantir que existe apenas
    uma tarefa em cada nível de prioridade
     • Pode-se utilizar a função
       rt_spv_RMS(cpu) para forçar que as
       prioridades estejam corretamente atribuídas
                                        Copyright (c) Walter Fetter Lages – p.6
Deadline Monotonic
•   Também pode ser vista como um caso particular
    da política FIFO
     • Apenas uma tarefa em cada nível de
       prioridade
     • Prioridade maior atribuída a tarefas com o
       menor deadline
     • Ao contrário da rate monotonic não existe
       função do RTAI para auxiliar
        • O deadline das tarefas não é informado ao
          sistema na criação das tarefas



                                        Copyright (c) Walter Fetter Lages – p.7
Earliest Deadline First

•   É escalonada a tarefa que tem o deadline mais
    próximo
•   O escalonador precisa saber quando a tarefa
    deverá ser liberada novamente e o deadline
•   Para tanto, ao invés de
    rt_task_wait_period(), utiliza-se a
    função
    void rt_task_set_resume_end(RTIME resume_time,
        RTIME end_time);
•   Se resume_time e end_time forem
    negativos, são interpretados como relativos aos
    valores anteriores
                                         Copyright (c) Walter Fetter Lages – p.8
Tarefas com Políticas Diferentes

  •   É possível misturar tarefas com políticas
      diferentes no mesmo sistema
  •   FIFO, RR, RMS e DMS podem ser misturadas
      sem problemas desde que o usuário garanta que
      as prioridades serão atribuídas de forma coerente
      com o efeito desejado.
  •   EDF não é baseada em prioridade, portanto a
      interação com tarefas com as outras políticas não
      é tão uniforme
        • O RTAI escalona tarefas EDF com maior
          prioridade que as demais
        • Tarefas EDF executam antes das demais
          quando o instante de liberação expira
                                           Copyright (c) Walter Fetter Lages – p.9

Mais conteúdo relacionado

Destaque

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 

Destaque (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

Rtai sched

  • 1. RTAI Políticas de Escalonamento Walter Fetter Lages w.fetter@ieee.org Universidade Federal do Rio Grande do Sul Escola de Engenharia Departamento de Engenharia Elétrica ENG04008 Sistemas de Tempo Real Copyright (c) Walter Fetter Lages – p.1
  • 2. Políticas de Escalonamento • Independentemente da política, o escalonamento do RTAI é preemptivo e baseado em prioridades • A tarefa de maior prioridade executa • As tarefas de menor prioridade são bloqueadas • Tarefas de menor prioridade são "preemptadas"caso uma tarefa de prioridade maior seja liberada • A política de escalonamento pode ser selecionada por tarefa Copyright (c) Walter Fetter Lages – p.2
  • 3. Políticas Suportadas • First-in first-out (FIFO) • Round robin (RR) • Rate monotonic (RMS) • Deadline monotonic (DMS) • Earliest deadline first (EDF) Copyright (c) Walter Fetter Lages – p.3
  • 4. First-in Fitst-out • É a política default • As tarefas apenas são "preemptadas"por tarefas de maior prioridade • As demais tarefas com a mesma prioridade da tarefa executando, só executam quando esta liberar a CPU Copyright (c) Walter Fetter Lages – p.4
  • 5. Round Robin • Só está disponível se for habilitada na configuração do RTAI • As tarefas podem ser "preemptadas"por tarefas de maior prioridade ou por tarefas de mesma prioridade quando o quantum expirar • Pode ser atribuída a cada tarefa através da função rt_set_sched_policy(RT_TASK *task,int policy, int rr_quantum_ns) • A política pode ser RT_SCHED_FIFO ou RT_SCHED_RR • rr_quantum_ns=0 utiliza o tick do Linux Copyright (c) Walter Fetter Lages – p.5
  • 6. Rate Monotonic • Pode ser vista como um caso particular da política FIFO • Apenas uma tarefa em cada nível de prioridade • Prioridade maior atribuída a tarefas com o menor período • Quando se utiliza criação dinâmicas de tarefas pode ser complicado garantir que existe apenas uma tarefa em cada nível de prioridade • Pode-se utilizar a função rt_spv_RMS(cpu) para forçar que as prioridades estejam corretamente atribuídas Copyright (c) Walter Fetter Lages – p.6
  • 7. Deadline Monotonic • Também pode ser vista como um caso particular da política FIFO • Apenas uma tarefa em cada nível de prioridade • Prioridade maior atribuída a tarefas com o menor deadline • Ao contrário da rate monotonic não existe função do RTAI para auxiliar • O deadline das tarefas não é informado ao sistema na criação das tarefas Copyright (c) Walter Fetter Lages – p.7
  • 8. Earliest Deadline First • É escalonada a tarefa que tem o deadline mais próximo • O escalonador precisa saber quando a tarefa deverá ser liberada novamente e o deadline • Para tanto, ao invés de rt_task_wait_period(), utiliza-se a função void rt_task_set_resume_end(RTIME resume_time, RTIME end_time); • Se resume_time e end_time forem negativos, são interpretados como relativos aos valores anteriores Copyright (c) Walter Fetter Lages – p.8
  • 9. Tarefas com Políticas Diferentes • É possível misturar tarefas com políticas diferentes no mesmo sistema • FIFO, RR, RMS e DMS podem ser misturadas sem problemas desde que o usuário garanta que as prioridades serão atribuídas de forma coerente com o efeito desejado. • EDF não é baseada em prioridade, portanto a interação com tarefas com as outras políticas não é tão uniforme • O RTAI escalona tarefas EDF com maior prioridade que as demais • Tarefas EDF executam antes das demais quando o instante de liberação expira Copyright (c) Walter Fetter Lages – p.9