SlideShare a Scribd company logo
1 of 34
Download to read offline
Design and Development of Real-Time
Multi-Processor Bandwidth Control Mechanisms in
       General Purpose Operating Systems

                                Youcheng Sun

               Graduate Program in Computer Science and Engineering


                            September 14, 2012




  Y. Sun (GPCSE)                    Master thesis               September 14, 2012   1 / 26
Outline


1   What is an ideal CPU bandwidth control mechanism for Linux?

2   A brief background

3   The OXC framework

4   Game time!

5   Conclusion




      Y. Sun (GPCSE)          Master thesis         September 14, 2012   2 / 26
Outline


1   What is an ideal CPU bandwidth control mechanism for Linux?

2   A brief background

3   The OXC framework

4   Game time!

5   Conclusion




      Y. Sun (GPCSE)          Master thesis         September 14, 2012   3 / 26
Four golden rules


   Hierarchical CPU bandwidth distribution Tasks in a Linux system
   can be organized in a flat or hierarchy. In modern systems, the
   hierarchyical way is preferred. A good mechanism should be able
   to distribute the CPU bandwidths hierarchically.
   Serve all kinds of tasks In Linux, there are different types of tasks
   that scheduled by different schedulers. A good mechanism should
   be able to serve all kinds of tasks.
   Support multi-processor platforms
   Provide real-time guaruntee Linux is used to serve various
   scenarios, among which some have temporal requirements. A
   good mechanism should be able to provide real-time guarantee.



    Y. Sun (GPCSE)             Master thesis           September 14, 2012   4 / 26
Before our work, no existing mechanisms can satisfy
all four golden rules




   Previous work includes RT throttling, CFS bandwdith control,
   AQuoSA, IRMOS real-time framework, etc.
   One common failure is rule 2.




    Y. Sun (GPCSE)           Master thesis          September 14, 2012   5 / 26
Before our work, no existing mechanisms can satisfy
all four golden rules




   Previous work includes RT throttling, CFS bandwdith control,
   AQuoSA, IRMOS real-time framework, etc.
   One common failure is rule 2. Each previous mechanism can
   only work for a specific type of tasks in Linux.




    Y. Sun (GPCSE)           Master thesis          September 14, 2012   5 / 26
Before our work, no existing mechanisms can satisfy
all four golden rules




    Previous work includes RT throttling, CFS bandwdith control,
    AQuoSA, IRMOS real-time framework, etc.
    One common failure is rule 2. Each previous mechanism can
    only work for a specific type of tasks in Linux.
In our work, a framework that satisfies all golden rules is
proposed.




     Y. Sun (GPCSE)           Master thesis          September 14, 2012   5 / 26
Outline


1   What is an ideal CPU bandwidth control mechanism for Linux?

2   A brief background

3   The OXC framework

4   Game time!

5   Conclusion




      Y. Sun (GPCSE)          Master thesis         September 14, 2012   6 / 26
Resource reservation




   The Constant Bandwidth Server (CBS) algorithm is used to
   reserve CPU bandwidth in the work.
   A CBS is characterized by an ordered pair (Q, P), where Q is
   called maximum budget and P is period.
   A CBS can reserve Q every P time units from a CPU.




    Y. Sun (GPCSE)           Master thesis          September 14, 2012   7 / 26
Linux scheduling


Linux adapts modular scheduling design. Each scheduler is an
instance of the struct sched_class.
s t r u c t sched_class {
             const s t r u c t sched_class ∗n e x t ;

          void    (∗ enqueue_task ) ( s t r u c t r q ∗rq , s t r u c t t a s k _ s t r u c t ∗p , i n t f l a g s ) ;
          void    (∗ dequeue_task ) ( s t r u c t r q ∗rq , s t r u c t t a s k _ s t r u c t ∗p , i n t f l a g s ) ;
          void    (∗ y i e l d _ t a s k ) ( s t r u c t r q ∗r q ) ;
          bool    (∗ y i e l d _ t o _ t a s k ) ( s t r u c t r q ∗rq , s t r u c t t a s k _ s t r u c t ∗p , b o o l preempt ) ;

          void (∗ check_preempt_curr ) ( s t r u c t r q ∗rq , s t r u c t t a s k _ s t r u c t ∗p , i n t f l a g s ) ;

          s t r u c t t a s k _ s t r u c t ∗ (∗ p i c k _ n e x t _ t a s k ) ( s t r u c t r q ∗r q ) ;
          void (∗ p u t _ p r e v _ t a s k ) ( s t r u c t r q ∗rq , s t r u c t t a s k _ s t r u c t ∗p ) ;
          ...
};



        These hooks are all scheduling operations for a scheduler.




          Y. Sun (GPCSE)                                          Master thesis                                    September 14, 2012   8 / 26
Linux scheduling

Linux adapts modular scheduling design. Each scheduler is an
instance of the struct sched_class.
s t r u c t sched_class {
             const s t r u c t sched_class ∗n e x t ;

          void (∗ enqueue_task ) ( struct rq *rq , s t r u c t t a s k _ s t r u c t ∗p , i n t f l a g s ) ;
          void (∗ dequeue_task ) ( struct rq *rq , s t r u c t t a s k _ s t r u c t ∗p , i n t f l a g s ) ;
          void (∗ y i e l d _ t a s k ) ( struct rq *rq ) ;
          b o o l (∗ y i e l d _ t o _ t a s k ) ( struct rq *rq , s t r u c t t a s k _ s t r u c t ∗p , b o o l preempt ) ;


          void (∗ check_preempt_curr ) ( struct rq *rq , s t r u c t t a s k _ s t r u c t ∗p , i n t f l a g s ) ;


           s t r u c t t a s k _ s t r u c t ∗ (∗ p i c k _ n e x t _ t a s k ) ( struct rq *rq ) ;
          void (∗ p u t _ p r e v _ t a s k ) ( struct rq *rq , s t r u c t t a s k _ s t r u c t ∗p ) ;
           ...
};



        These hooks are all scheduling operations for a scheduler.


          Y. Sun (GPCSE)                                             Master thesis                                September 14, 2012   9 / 26
The Linux scheduling is runqueue centered




   Every hook in a scheduling class deals with the struct rq. A
   struct rq instance is called runqueue in Linux.
   The struct rq is a per CPU structure. That is, there is a
   runqueue per CPU in Linux.
   A scheduling system is built around the runqueue in each CPU.
   Different per CPU scheduling systems cooperate with each other
   through task migration strategy defined by schedulers.




    Y. Sun (GPCSE)           Master thesis         September 14, 2012   10 / 26
The scheme of per CPU scheduling in Linux




   Y. Sun (GPCSE)   Master thesis   September 14, 2012   11 / 26
Outline


1   What is an ideal CPU bandwidth control mechanism for Linux?

2   A brief background

3   The OXC framework

4   Game time!

5   Conclusion




      Y. Sun (GPCSE)          Master thesis        September 14, 2012   12 / 26
The Open Extension Container (OXC) structure




                                      The idea of ox container is
                                      simple: any data
                                      structure that contains a
                                      runqueue inside is
                                      regarded as the ox
                                      container




    Y. Sun (GPCSE)    Master thesis               September 14, 2012   13 / 26
Pass an ox container’s local runqueue to a scheduling
operation



   For a scheduler, it needs a runqueue so as to deal with its tasks.
   This runqueue can be the per CPU runqueue or an ox container’s
   local runqueue.
   When an ox container’s local runqueue is used by a scheduler,
   tasks will run in this local runqueue.
   Now, besides per CPU scheduling system, there is the per ox
   container scheduling system in Linux.




    Y. Sun (GPCSE)            Master thesis         September 14, 2012   14 / 26
Per oxc scheduling + per CPU scheduling
coexist in Linux




   Y. Sun (GPCSE)   Master thesis   September 14, 2012   15 / 26
The oxc scheduling can be structured in a hierarchy




    Y. Sun (GPCSE)      Master thesis   September 14, 2012   16 / 26
To allocate CPU bandwidth for an ox container



   Different schedulers can use an ox container to enqueue, operate
   and dequeue their tasks.
   Suppose a fraction of CPU bandiwdth is allocated to an ox
   container, all kinds of tasks inside the container will use it as if
   running on a less powerful CPU.




    Y. Sun (GPCSE)              Master thesis            September 14, 2012   17 / 26
To allocate CPU bandwidth for an ox container



    Different schedulers can use an ox container to enqueue, operate
    and dequeue their tasks.
    Suppose a fraction of CPU bandiwdth is allocated to an ox
    container, all kinds of tasks inside the container will use it as if
    running on a less powerful CPU.
Based on this idea, the oxc (scheduling) framework is developed to
control CPU bandwidth allocated to tasks, which can be any type, in
a real-time way.




     Y. Sun (GPCSE)              Master thesis            September 14, 2012   17 / 26
A concrete ox container that can reserve CPU
bandwidth

          This an ox container that can
          reserve bandwidth from a CPU
          according to CBS rules.                                           oxc_runtime and oxc_period
                                                                            are the maximum budget and pe-
 s t r u c t oxc_rq {                                                       riod parameters in CBS.
              unsigned long o x c _ n r _ r u n n i n g ;
              int oxc_throttled ;
              u64 oxc_runtime ;
              ktime_t oxc_period ;
              u64 o x c _ d e a d l i n e ;
              u64 oxc_time ;
              u64 o x c _ s t a r t _ t i m e ;

             struct hrtimer oxc_period_timer ;
             raw_spinlock_t oxc_runtime_lock ;
             b o o l oxc_needs_resync ;

             s t r u c t r q rq_ ;
             s t r u c t r q ∗r q ;
             s t r u c t rb_node rb_node ;
 };




        Y. Sun (GPCSE)                                      Master thesis               September 14, 2012   18 / 26
A concrete ox container that can reserve CPU
bandwidth

          This an ox container that can
          reserve bandwidth from a CPU                                      oxc_runtime and oxc_period
                                                                            are the maximum budget and pe-
          according to CBS rules.                                           riod parameters in CBS.
 s t r u c t oxc_rq {
              unsigned long o x c _ n r _ r u n n i n g ;
              int oxc_throttled ;
              u64 oxc_runtime ;
              ktime_t oxc_period ;
              u64 o x c _ d e a d l i n e ;
              u64 oxc_time ;
              u64 o x c _ s t a r t _ t i m e ;

             struct hrtimer oxc_period_timer ;
             raw_spinlock_t oxc_runtime_lock ;
             b o o l oxc_needs_resync ;

             s t r u c t r q rq_ ;                                          the local runqueue of an ox con-
             s t r u c t r q ∗r q ;
             s t r u c t rb_node rb_node ;
                                                                            tainer
 };




        Y. Sun (GPCSE)                                      Master thesis                September 14, 2012   18 / 26
SMP support



        An ox container can only
        reserve CPU bandwidth from a
        CPU.                                                   cpus_allowed specifies the CPU
                                                               that bandwidths are reserved from.
        The hyper ox container
        structure is defined for
        reserving bandwidths from
        multiple processors.
 s t r u c t hyper_oxc_rq {
              cpumask_var_t cpus_allowed ;
              s t r u c t oxc_rq ∗∗ oxc_rq ;
 };




       Y. Sun (GPCSE)                          Master thesis                 September 14, 2012   19 / 26
SMP support



        An ox container can only
        reserve CPU bandwidth from a                           cpus_allowed specifies the CPU
                                                               that bandwidths are reserved from.
        CPU.
        The hyper ox container
        structure is defined for
        reserving bandwidths from
        multiple processors.
 s t r u c t hyper_oxc_rq {                                    The ox containers to reserve band-
              cpumask_var_t cpus_allowed ;                     widths from corresponding CPUs
              s t r u c t oxc_rq ∗∗ oxc_rq ;
 };




       Y. Sun (GPCSE)                          Master thesis                 September 14, 2012   19 / 26
Outline


1   What is an ideal CPU bandwidth control mechanism for Linux?

2   A brief background

3   The OXC framework

4   Game time!

5   Conclusion




      Y. Sun (GPCSE)          Master thesis        September 14, 2012   20 / 26
Experiment set-ups

Candidates :
    RT throttling : CPU bandwidth control work, without real-time
    guarantee, for RT tasks.
    CFS bandwidth control : CPU bandwidth control work, without
    real-time guarantee, for CFS tasks.
    oxc control : Our CPU bandwidth control work, with real-time
    guarantee, for any type of tasks.
Experiment rules:
    Two tbench connections will be set up in the system; each
    connection is dedicated to one CPU in a dual processor platform.
    The CPU bandwidth allocated to tbench traffic is restricted using
    the above work individually.


     Y. Sun (GPCSE)            Master thesis         September 14, 2012   21 / 26
Results: oxc control vs. RT throttling




    Y. Sun (GPCSE)       Master thesis   September 14, 2012   22 / 26
Results: oxc control vs. CFS bandwidth control




    Y. Sun (GPCSE)     Master thesis    September 14, 2012   23 / 26
Results



   Given that our work is still a prototype, such results are very
   encouraging.




    Y. Sun (GPCSE)             Master thesis          September 14, 2012   24 / 26
Results



   Given that our work is still a prototype, such results are very
   encouraging.
   In addition: we can provide real-time gurantee ;-)




    Y. Sun (GPCSE)             Master thesis            September 14, 2012   24 / 26
Results



    Given that our work is still a prototype, such results are very
    encouraging.
    In addition: we can provide real-time gurantee ;-)




What I am really trying to sell :
Our one-for-all solution for CPU bandwidth control in Linux
is feasible!!!



      Y. Sun (GPCSE)                Master thesis        September 14, 2012   24 / 26
Outline


1   What is an ideal CPU bandwidth control mechanism for Linux?

2   A brief background

3   The OXC framework

4   Game time!

5   Conclusion




      Y. Sun (GPCSE)          Master thesis        September 14, 2012   25 / 26
Conclusion



   In mainline Linux there are two schedulers.
   Numerous schedulers have been or will be implemented based on
   Linux for various reasons.
   There exists CPU bandwidth control work dealing with some of
   these schedulers. But each such mechanism can only work with
   for one scheduler (one specific type of tasks).




    Y. Sun (GPCSE)            Master thesis      September 14, 2012   26 / 26
Conclusion



   In mainline Linux there are two schedulers.
   Numerous schedulers have been or will be implemented based on
   Linux for various reasons.
   There exists CPU bandwidth control work dealing with some of
   these schedulers. But each such mechanism can only work with
   for one scheduler (one specific type of tasks).
   The oxc framework can provide real-time CPU bandwidth
   control for tasks of all these schedulers!
   The project is just started; more work is coming.




    Y. Sun (GPCSE)            Master thesis            September 14, 2012   26 / 26

More Related Content

What's hot

20140513_jeffyang_demo_openstack
20140513_jeffyang_demo_openstack20140513_jeffyang_demo_openstack
20140513_jeffyang_demo_openstackJeff Yang
 
Direct Code Execution @ CoNEXT 2013
Direct Code Execution @ CoNEXT 2013Direct Code Execution @ CoNEXT 2013
Direct Code Execution @ CoNEXT 2013Hajime Tazaki
 
NUSE (Network Stack in Userspace) at #osio
NUSE (Network Stack in Userspace) at #osioNUSE (Network Stack in Userspace) at #osio
NUSE (Network Stack in Userspace) at #osioHajime Tazaki
 
Direct Code Execution - LinuxCon Japan 2014
Direct Code Execution - LinuxCon Japan 2014Direct Code Execution - LinuxCon Japan 2014
Direct Code Execution - LinuxCon Japan 2014Hajime Tazaki
 
Linux Kernel Library - Reusing Monolithic Kernel
Linux Kernel Library - Reusing Monolithic KernelLinux Kernel Library - Reusing Monolithic Kernel
Linux Kernel Library - Reusing Monolithic KernelHajime Tazaki
 
Kernelvm 201312-dlmopen
Kernelvm 201312-dlmopenKernelvm 201312-dlmopen
Kernelvm 201312-dlmopenHajime Tazaki
 
LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1Hajime Tazaki
 
Library Operating System for Linux #netdev01
Library Operating System for Linux #netdev01Library Operating System for Linux #netdev01
Library Operating System for Linux #netdev01Hajime Tazaki
 
Network stack personality in Android phone - netdev 2.2
Network stack personality in Android phone - netdev 2.2Network stack personality in Android phone - netdev 2.2
Network stack personality in Android phone - netdev 2.2Hajime Tazaki
 
Playing BBR with a userspace network stack
Playing BBR with a userspace network stackPlaying BBR with a userspace network stack
Playing BBR with a userspace network stackHajime Tazaki
 
Xdp and ebpf_maps
Xdp and ebpf_mapsXdp and ebpf_maps
Xdp and ebpf_mapslcplcp1
 
Linux rumpkernel - ABC2018 (AsiaBSDCon 2018)
Linux rumpkernel - ABC2018 (AsiaBSDCon 2018)Linux rumpkernel - ABC2018 (AsiaBSDCon 2018)
Linux rumpkernel - ABC2018 (AsiaBSDCon 2018)Hajime Tazaki
 
Scalability and Performance of CNS 3.6
Scalability and Performance of CNS 3.6Scalability and Performance of CNS 3.6
Scalability and Performance of CNS 3.6Gluster.org
 
eBPF Perf Tools 2019
eBPF Perf Tools 2019eBPF Perf Tools 2019
eBPF Perf Tools 2019Brendan Gregg
 
Shifter singularity - june 7, 2018 - bw symposium
Shifter  singularity - june 7, 2018 - bw symposiumShifter  singularity - june 7, 2018 - bw symposium
Shifter singularity - june 7, 2018 - bw symposiuminside-BigData.com
 
Arbiter volumes in gluster
Arbiter volumes in glusterArbiter volumes in gluster
Arbiter volumes in glusteritisravi
 
State of systemd @ Facebook
State of systemd @ FacebookState of systemd @ Facebook
State of systemd @ FacebookDavide Cavalca
 
Making a Process
Making a ProcessMaking a Process
Making a ProcessDavid Evans
 

What's hot (20)

20140513_jeffyang_demo_openstack
20140513_jeffyang_demo_openstack20140513_jeffyang_demo_openstack
20140513_jeffyang_demo_openstack
 
Direct Code Execution @ CoNEXT 2013
Direct Code Execution @ CoNEXT 2013Direct Code Execution @ CoNEXT 2013
Direct Code Execution @ CoNEXT 2013
 
NUSE (Network Stack in Userspace) at #osio
NUSE (Network Stack in Userspace) at #osioNUSE (Network Stack in Userspace) at #osio
NUSE (Network Stack in Userspace) at #osio
 
Direct Code Execution - LinuxCon Japan 2014
Direct Code Execution - LinuxCon Japan 2014Direct Code Execution - LinuxCon Japan 2014
Direct Code Execution - LinuxCon Japan 2014
 
Linux Kernel Library - Reusing Monolithic Kernel
Linux Kernel Library - Reusing Monolithic KernelLinux Kernel Library - Reusing Monolithic Kernel
Linux Kernel Library - Reusing Monolithic Kernel
 
Kernelvm 201312-dlmopen
Kernelvm 201312-dlmopenKernelvm 201312-dlmopen
Kernelvm 201312-dlmopen
 
LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1
 
Library Operating System for Linux #netdev01
Library Operating System for Linux #netdev01Library Operating System for Linux #netdev01
Library Operating System for Linux #netdev01
 
Network stack personality in Android phone - netdev 2.2
Network stack personality in Android phone - netdev 2.2Network stack personality in Android phone - netdev 2.2
Network stack personality in Android phone - netdev 2.2
 
Playing BBR with a userspace network stack
Playing BBR with a userspace network stackPlaying BBR with a userspace network stack
Playing BBR with a userspace network stack
 
Xdp and ebpf_maps
Xdp and ebpf_mapsXdp and ebpf_maps
Xdp and ebpf_maps
 
mTCP使ってみた
mTCP使ってみたmTCP使ってみた
mTCP使ってみた
 
Linux rumpkernel - ABC2018 (AsiaBSDCon 2018)
Linux rumpkernel - ABC2018 (AsiaBSDCon 2018)Linux rumpkernel - ABC2018 (AsiaBSDCon 2018)
Linux rumpkernel - ABC2018 (AsiaBSDCon 2018)
 
Scalability and Performance of CNS 3.6
Scalability and Performance of CNS 3.6Scalability and Performance of CNS 3.6
Scalability and Performance of CNS 3.6
 
eBPF Perf Tools 2019
eBPF Perf Tools 2019eBPF Perf Tools 2019
eBPF Perf Tools 2019
 
Shifter singularity - june 7, 2018 - bw symposium
Shifter  singularity - june 7, 2018 - bw symposiumShifter  singularity - june 7, 2018 - bw symposium
Shifter singularity - june 7, 2018 - bw symposium
 
Arbiter volumes in gluster
Arbiter volumes in glusterArbiter volumes in gluster
Arbiter volumes in gluster
 
State of systemd @ Facebook
State of systemd @ FacebookState of systemd @ Facebook
State of systemd @ Facebook
 
Multimaster
MultimasterMultimaster
Multimaster
 
Making a Process
Making a ProcessMaking a Process
Making a Process
 

Similar to Presentation 14 09_2012

HSA-4123, HSA Memory Model, by Ben Gaster
HSA-4123, HSA Memory Model, by Ben GasterHSA-4123, HSA Memory Model, by Ben Gaster
HSA-4123, HSA Memory Model, by Ben GasterAMD Developer Central
 
Kernel Recipes 2019 - RCU in 2019 - Joel Fernandes
Kernel Recipes 2019 - RCU in 2019 - Joel FernandesKernel Recipes 2019 - RCU in 2019 - Joel Fernandes
Kernel Recipes 2019 - RCU in 2019 - Joel FernandesAnne Nicolas
 
Re-engineering Eclipse MDT/OCL for Xtext
Re-engineering Eclipse MDT/OCL for XtextRe-engineering Eclipse MDT/OCL for Xtext
Re-engineering Eclipse MDT/OCL for XtextEdward Willink
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes IntroductionMiloš Zubal
 
Gluster d thread_synchronization_using_urcu_lca2016
Gluster d thread_synchronization_using_urcu_lca2016Gluster d thread_synchronization_using_urcu_lca2016
Gluster d thread_synchronization_using_urcu_lca2016Gluster.org
 
Efficient Dynamic Scheduling Algorithm for Real-Time MultiCore Systems
Efficient Dynamic Scheduling Algorithm for Real-Time MultiCore Systems Efficient Dynamic Scheduling Algorithm for Real-Time MultiCore Systems
Efficient Dynamic Scheduling Algorithm for Real-Time MultiCore Systems iosrjce
 
An Evaluation of Adaptive Partitioning of Real-Time Workloads on Linux
An Evaluation of Adaptive Partitioning of Real-Time Workloads on LinuxAn Evaluation of Adaptive Partitioning of Real-Time Workloads on Linux
An Evaluation of Adaptive Partitioning of Real-Time Workloads on Linuxtcucinotta
 
Glusterd_thread_synchronization_using_urcu_lca2016
Glusterd_thread_synchronization_using_urcu_lca2016Glusterd_thread_synchronization_using_urcu_lca2016
Glusterd_thread_synchronization_using_urcu_lca2016Atin Mukherjee
 
Implementation and evaluation of novel scheduler of UC/OS (RTOS)
Implementation and evaluation of novel scheduler of UC/OS (RTOS)Implementation and evaluation of novel scheduler of UC/OS (RTOS)
Implementation and evaluation of novel scheduler of UC/OS (RTOS)Editor Jacotech
 
OpenHPC: Community Building Blocks for HPC Systems
OpenHPC: Community Building Blocks for HPC SystemsOpenHPC: Community Building Blocks for HPC Systems
OpenHPC: Community Building Blocks for HPC Systemsinside-BigData.com
 
Eco-friendly Linux kernel development
Eco-friendly Linux kernel developmentEco-friendly Linux kernel development
Eco-friendly Linux kernel developmentAndrea Righi
 
EdSketch: Execution-Driven Sketching for Java
EdSketch: Execution-Driven Sketching for JavaEdSketch: Execution-Driven Sketching for Java
EdSketch: Execution-Driven Sketching for JavaLisa Hua
 
HSA Memory Model Hot Chips 2013
HSA Memory Model Hot Chips 2013HSA Memory Model Hot Chips 2013
HSA Memory Model Hot Chips 2013HSA Foundation
 
RR & Docker @ MuensteR Meetup (Sep 2017)
RR & Docker @ MuensteR Meetup (Sep 2017)RR & Docker @ MuensteR Meetup (Sep 2017)
RR & Docker @ MuensteR Meetup (Sep 2017)Daniel Nüst
 
Kubernetes and OpenStack at Scale
Kubernetes and OpenStack at ScaleKubernetes and OpenStack at Scale
Kubernetes and OpenStack at ScaleStephen Gordon
 
Docker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12XDocker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12XJérôme Petazzoni
 
Concurrent programming with RTOS
Concurrent programming with RTOSConcurrent programming with RTOS
Concurrent programming with RTOSSirin Software
 
RTOS Material hfffffffffffffffffffffffffffffffffffff
RTOS Material hfffffffffffffffffffffffffffffffffffffRTOS Material hfffffffffffffffffffffffffffffffffffff
RTOS Material hfffffffffffffffffffffffffffffffffffffadugnanegero
 
Userspace RCU library : what linear multiprocessor scalability means for your...
Userspace RCU library : what linear multiprocessor scalability means for your...Userspace RCU library : what linear multiprocessor scalability means for your...
Userspace RCU library : what linear multiprocessor scalability means for your...Alexey Ivanov
 

Similar to Presentation 14 09_2012 (20)

HSA-4123, HSA Memory Model, by Ben Gaster
HSA-4123, HSA Memory Model, by Ben GasterHSA-4123, HSA Memory Model, by Ben Gaster
HSA-4123, HSA Memory Model, by Ben Gaster
 
Kernel Recipes 2019 - RCU in 2019 - Joel Fernandes
Kernel Recipes 2019 - RCU in 2019 - Joel FernandesKernel Recipes 2019 - RCU in 2019 - Joel Fernandes
Kernel Recipes 2019 - RCU in 2019 - Joel Fernandes
 
Re-engineering Eclipse MDT/OCL for Xtext
Re-engineering Eclipse MDT/OCL for XtextRe-engineering Eclipse MDT/OCL for Xtext
Re-engineering Eclipse MDT/OCL for Xtext
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Gluster d thread_synchronization_using_urcu_lca2016
Gluster d thread_synchronization_using_urcu_lca2016Gluster d thread_synchronization_using_urcu_lca2016
Gluster d thread_synchronization_using_urcu_lca2016
 
K017617786
K017617786K017617786
K017617786
 
Efficient Dynamic Scheduling Algorithm for Real-Time MultiCore Systems
Efficient Dynamic Scheduling Algorithm for Real-Time MultiCore Systems Efficient Dynamic Scheduling Algorithm for Real-Time MultiCore Systems
Efficient Dynamic Scheduling Algorithm for Real-Time MultiCore Systems
 
An Evaluation of Adaptive Partitioning of Real-Time Workloads on Linux
An Evaluation of Adaptive Partitioning of Real-Time Workloads on LinuxAn Evaluation of Adaptive Partitioning of Real-Time Workloads on Linux
An Evaluation of Adaptive Partitioning of Real-Time Workloads on Linux
 
Glusterd_thread_synchronization_using_urcu_lca2016
Glusterd_thread_synchronization_using_urcu_lca2016Glusterd_thread_synchronization_using_urcu_lca2016
Glusterd_thread_synchronization_using_urcu_lca2016
 
Implementation and evaluation of novel scheduler of UC/OS (RTOS)
Implementation and evaluation of novel scheduler of UC/OS (RTOS)Implementation and evaluation of novel scheduler of UC/OS (RTOS)
Implementation and evaluation of novel scheduler of UC/OS (RTOS)
 
OpenHPC: Community Building Blocks for HPC Systems
OpenHPC: Community Building Blocks for HPC SystemsOpenHPC: Community Building Blocks for HPC Systems
OpenHPC: Community Building Blocks for HPC Systems
 
Eco-friendly Linux kernel development
Eco-friendly Linux kernel developmentEco-friendly Linux kernel development
Eco-friendly Linux kernel development
 
EdSketch: Execution-Driven Sketching for Java
EdSketch: Execution-Driven Sketching for JavaEdSketch: Execution-Driven Sketching for Java
EdSketch: Execution-Driven Sketching for Java
 
HSA Memory Model Hot Chips 2013
HSA Memory Model Hot Chips 2013HSA Memory Model Hot Chips 2013
HSA Memory Model Hot Chips 2013
 
RR & Docker @ MuensteR Meetup (Sep 2017)
RR & Docker @ MuensteR Meetup (Sep 2017)RR & Docker @ MuensteR Meetup (Sep 2017)
RR & Docker @ MuensteR Meetup (Sep 2017)
 
Kubernetes and OpenStack at Scale
Kubernetes and OpenStack at ScaleKubernetes and OpenStack at Scale
Kubernetes and OpenStack at Scale
 
Docker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12XDocker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12X
 
Concurrent programming with RTOS
Concurrent programming with RTOSConcurrent programming with RTOS
Concurrent programming with RTOS
 
RTOS Material hfffffffffffffffffffffffffffffffffffff
RTOS Material hfffffffffffffffffffffffffffffffffffffRTOS Material hfffffffffffffffffffffffffffffffffffff
RTOS Material hfffffffffffffffffffffffffffffffffffff
 
Userspace RCU library : what linear multiprocessor scalability means for your...
Userspace RCU library : what linear multiprocessor scalability means for your...Userspace RCU library : what linear multiprocessor scalability means for your...
Userspace RCU library : what linear multiprocessor scalability means for your...
 

Recently uploaded

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 

Recently uploaded (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

Presentation 14 09_2012

  • 1. Design and Development of Real-Time Multi-Processor Bandwidth Control Mechanisms in General Purpose Operating Systems Youcheng Sun Graduate Program in Computer Science and Engineering September 14, 2012 Y. Sun (GPCSE) Master thesis September 14, 2012 1 / 26
  • 2. Outline 1 What is an ideal CPU bandwidth control mechanism for Linux? 2 A brief background 3 The OXC framework 4 Game time! 5 Conclusion Y. Sun (GPCSE) Master thesis September 14, 2012 2 / 26
  • 3. Outline 1 What is an ideal CPU bandwidth control mechanism for Linux? 2 A brief background 3 The OXC framework 4 Game time! 5 Conclusion Y. Sun (GPCSE) Master thesis September 14, 2012 3 / 26
  • 4. Four golden rules Hierarchical CPU bandwidth distribution Tasks in a Linux system can be organized in a flat or hierarchy. In modern systems, the hierarchyical way is preferred. A good mechanism should be able to distribute the CPU bandwidths hierarchically. Serve all kinds of tasks In Linux, there are different types of tasks that scheduled by different schedulers. A good mechanism should be able to serve all kinds of tasks. Support multi-processor platforms Provide real-time guaruntee Linux is used to serve various scenarios, among which some have temporal requirements. A good mechanism should be able to provide real-time guarantee. Y. Sun (GPCSE) Master thesis September 14, 2012 4 / 26
  • 5. Before our work, no existing mechanisms can satisfy all four golden rules Previous work includes RT throttling, CFS bandwdith control, AQuoSA, IRMOS real-time framework, etc. One common failure is rule 2. Y. Sun (GPCSE) Master thesis September 14, 2012 5 / 26
  • 6. Before our work, no existing mechanisms can satisfy all four golden rules Previous work includes RT throttling, CFS bandwdith control, AQuoSA, IRMOS real-time framework, etc. One common failure is rule 2. Each previous mechanism can only work for a specific type of tasks in Linux. Y. Sun (GPCSE) Master thesis September 14, 2012 5 / 26
  • 7. Before our work, no existing mechanisms can satisfy all four golden rules Previous work includes RT throttling, CFS bandwdith control, AQuoSA, IRMOS real-time framework, etc. One common failure is rule 2. Each previous mechanism can only work for a specific type of tasks in Linux. In our work, a framework that satisfies all golden rules is proposed. Y. Sun (GPCSE) Master thesis September 14, 2012 5 / 26
  • 8. Outline 1 What is an ideal CPU bandwidth control mechanism for Linux? 2 A brief background 3 The OXC framework 4 Game time! 5 Conclusion Y. Sun (GPCSE) Master thesis September 14, 2012 6 / 26
  • 9. Resource reservation The Constant Bandwidth Server (CBS) algorithm is used to reserve CPU bandwidth in the work. A CBS is characterized by an ordered pair (Q, P), where Q is called maximum budget and P is period. A CBS can reserve Q every P time units from a CPU. Y. Sun (GPCSE) Master thesis September 14, 2012 7 / 26
  • 10. Linux scheduling Linux adapts modular scheduling design. Each scheduler is an instance of the struct sched_class. s t r u c t sched_class { const s t r u c t sched_class ∗n e x t ; void (∗ enqueue_task ) ( s t r u c t r q ∗rq , s t r u c t t a s k _ s t r u c t ∗p , i n t f l a g s ) ; void (∗ dequeue_task ) ( s t r u c t r q ∗rq , s t r u c t t a s k _ s t r u c t ∗p , i n t f l a g s ) ; void (∗ y i e l d _ t a s k ) ( s t r u c t r q ∗r q ) ; bool (∗ y i e l d _ t o _ t a s k ) ( s t r u c t r q ∗rq , s t r u c t t a s k _ s t r u c t ∗p , b o o l preempt ) ; void (∗ check_preempt_curr ) ( s t r u c t r q ∗rq , s t r u c t t a s k _ s t r u c t ∗p , i n t f l a g s ) ; s t r u c t t a s k _ s t r u c t ∗ (∗ p i c k _ n e x t _ t a s k ) ( s t r u c t r q ∗r q ) ; void (∗ p u t _ p r e v _ t a s k ) ( s t r u c t r q ∗rq , s t r u c t t a s k _ s t r u c t ∗p ) ; ... }; These hooks are all scheduling operations for a scheduler. Y. Sun (GPCSE) Master thesis September 14, 2012 8 / 26
  • 11. Linux scheduling Linux adapts modular scheduling design. Each scheduler is an instance of the struct sched_class. s t r u c t sched_class { const s t r u c t sched_class ∗n e x t ; void (∗ enqueue_task ) ( struct rq *rq , s t r u c t t a s k _ s t r u c t ∗p , i n t f l a g s ) ; void (∗ dequeue_task ) ( struct rq *rq , s t r u c t t a s k _ s t r u c t ∗p , i n t f l a g s ) ; void (∗ y i e l d _ t a s k ) ( struct rq *rq ) ; b o o l (∗ y i e l d _ t o _ t a s k ) ( struct rq *rq , s t r u c t t a s k _ s t r u c t ∗p , b o o l preempt ) ; void (∗ check_preempt_curr ) ( struct rq *rq , s t r u c t t a s k _ s t r u c t ∗p , i n t f l a g s ) ; s t r u c t t a s k _ s t r u c t ∗ (∗ p i c k _ n e x t _ t a s k ) ( struct rq *rq ) ; void (∗ p u t _ p r e v _ t a s k ) ( struct rq *rq , s t r u c t t a s k _ s t r u c t ∗p ) ; ... }; These hooks are all scheduling operations for a scheduler. Y. Sun (GPCSE) Master thesis September 14, 2012 9 / 26
  • 12. The Linux scheduling is runqueue centered Every hook in a scheduling class deals with the struct rq. A struct rq instance is called runqueue in Linux. The struct rq is a per CPU structure. That is, there is a runqueue per CPU in Linux. A scheduling system is built around the runqueue in each CPU. Different per CPU scheduling systems cooperate with each other through task migration strategy defined by schedulers. Y. Sun (GPCSE) Master thesis September 14, 2012 10 / 26
  • 13. The scheme of per CPU scheduling in Linux Y. Sun (GPCSE) Master thesis September 14, 2012 11 / 26
  • 14. Outline 1 What is an ideal CPU bandwidth control mechanism for Linux? 2 A brief background 3 The OXC framework 4 Game time! 5 Conclusion Y. Sun (GPCSE) Master thesis September 14, 2012 12 / 26
  • 15. The Open Extension Container (OXC) structure The idea of ox container is simple: any data structure that contains a runqueue inside is regarded as the ox container Y. Sun (GPCSE) Master thesis September 14, 2012 13 / 26
  • 16. Pass an ox container’s local runqueue to a scheduling operation For a scheduler, it needs a runqueue so as to deal with its tasks. This runqueue can be the per CPU runqueue or an ox container’s local runqueue. When an ox container’s local runqueue is used by a scheduler, tasks will run in this local runqueue. Now, besides per CPU scheduling system, there is the per ox container scheduling system in Linux. Y. Sun (GPCSE) Master thesis September 14, 2012 14 / 26
  • 17. Per oxc scheduling + per CPU scheduling coexist in Linux Y. Sun (GPCSE) Master thesis September 14, 2012 15 / 26
  • 18. The oxc scheduling can be structured in a hierarchy Y. Sun (GPCSE) Master thesis September 14, 2012 16 / 26
  • 19. To allocate CPU bandwidth for an ox container Different schedulers can use an ox container to enqueue, operate and dequeue their tasks. Suppose a fraction of CPU bandiwdth is allocated to an ox container, all kinds of tasks inside the container will use it as if running on a less powerful CPU. Y. Sun (GPCSE) Master thesis September 14, 2012 17 / 26
  • 20. To allocate CPU bandwidth for an ox container Different schedulers can use an ox container to enqueue, operate and dequeue their tasks. Suppose a fraction of CPU bandiwdth is allocated to an ox container, all kinds of tasks inside the container will use it as if running on a less powerful CPU. Based on this idea, the oxc (scheduling) framework is developed to control CPU bandwidth allocated to tasks, which can be any type, in a real-time way. Y. Sun (GPCSE) Master thesis September 14, 2012 17 / 26
  • 21. A concrete ox container that can reserve CPU bandwidth This an ox container that can reserve bandwidth from a CPU according to CBS rules. oxc_runtime and oxc_period are the maximum budget and pe- s t r u c t oxc_rq { riod parameters in CBS. unsigned long o x c _ n r _ r u n n i n g ; int oxc_throttled ; u64 oxc_runtime ; ktime_t oxc_period ; u64 o x c _ d e a d l i n e ; u64 oxc_time ; u64 o x c _ s t a r t _ t i m e ; struct hrtimer oxc_period_timer ; raw_spinlock_t oxc_runtime_lock ; b o o l oxc_needs_resync ; s t r u c t r q rq_ ; s t r u c t r q ∗r q ; s t r u c t rb_node rb_node ; }; Y. Sun (GPCSE) Master thesis September 14, 2012 18 / 26
  • 22. A concrete ox container that can reserve CPU bandwidth This an ox container that can reserve bandwidth from a CPU oxc_runtime and oxc_period are the maximum budget and pe- according to CBS rules. riod parameters in CBS. s t r u c t oxc_rq { unsigned long o x c _ n r _ r u n n i n g ; int oxc_throttled ; u64 oxc_runtime ; ktime_t oxc_period ; u64 o x c _ d e a d l i n e ; u64 oxc_time ; u64 o x c _ s t a r t _ t i m e ; struct hrtimer oxc_period_timer ; raw_spinlock_t oxc_runtime_lock ; b o o l oxc_needs_resync ; s t r u c t r q rq_ ; the local runqueue of an ox con- s t r u c t r q ∗r q ; s t r u c t rb_node rb_node ; tainer }; Y. Sun (GPCSE) Master thesis September 14, 2012 18 / 26
  • 23. SMP support An ox container can only reserve CPU bandwidth from a CPU. cpus_allowed specifies the CPU that bandwidths are reserved from. The hyper ox container structure is defined for reserving bandwidths from multiple processors. s t r u c t hyper_oxc_rq { cpumask_var_t cpus_allowed ; s t r u c t oxc_rq ∗∗ oxc_rq ; }; Y. Sun (GPCSE) Master thesis September 14, 2012 19 / 26
  • 24. SMP support An ox container can only reserve CPU bandwidth from a cpus_allowed specifies the CPU that bandwidths are reserved from. CPU. The hyper ox container structure is defined for reserving bandwidths from multiple processors. s t r u c t hyper_oxc_rq { The ox containers to reserve band- cpumask_var_t cpus_allowed ; widths from corresponding CPUs s t r u c t oxc_rq ∗∗ oxc_rq ; }; Y. Sun (GPCSE) Master thesis September 14, 2012 19 / 26
  • 25. Outline 1 What is an ideal CPU bandwidth control mechanism for Linux? 2 A brief background 3 The OXC framework 4 Game time! 5 Conclusion Y. Sun (GPCSE) Master thesis September 14, 2012 20 / 26
  • 26. Experiment set-ups Candidates : RT throttling : CPU bandwidth control work, without real-time guarantee, for RT tasks. CFS bandwidth control : CPU bandwidth control work, without real-time guarantee, for CFS tasks. oxc control : Our CPU bandwidth control work, with real-time guarantee, for any type of tasks. Experiment rules: Two tbench connections will be set up in the system; each connection is dedicated to one CPU in a dual processor platform. The CPU bandwidth allocated to tbench traffic is restricted using the above work individually. Y. Sun (GPCSE) Master thesis September 14, 2012 21 / 26
  • 27. Results: oxc control vs. RT throttling Y. Sun (GPCSE) Master thesis September 14, 2012 22 / 26
  • 28. Results: oxc control vs. CFS bandwidth control Y. Sun (GPCSE) Master thesis September 14, 2012 23 / 26
  • 29. Results Given that our work is still a prototype, such results are very encouraging. Y. Sun (GPCSE) Master thesis September 14, 2012 24 / 26
  • 30. Results Given that our work is still a prototype, such results are very encouraging. In addition: we can provide real-time gurantee ;-) Y. Sun (GPCSE) Master thesis September 14, 2012 24 / 26
  • 31. Results Given that our work is still a prototype, such results are very encouraging. In addition: we can provide real-time gurantee ;-) What I am really trying to sell : Our one-for-all solution for CPU bandwidth control in Linux is feasible!!! Y. Sun (GPCSE) Master thesis September 14, 2012 24 / 26
  • 32. Outline 1 What is an ideal CPU bandwidth control mechanism for Linux? 2 A brief background 3 The OXC framework 4 Game time! 5 Conclusion Y. Sun (GPCSE) Master thesis September 14, 2012 25 / 26
  • 33. Conclusion In mainline Linux there are two schedulers. Numerous schedulers have been or will be implemented based on Linux for various reasons. There exists CPU bandwidth control work dealing with some of these schedulers. But each such mechanism can only work with for one scheduler (one specific type of tasks). Y. Sun (GPCSE) Master thesis September 14, 2012 26 / 26
  • 34. Conclusion In mainline Linux there are two schedulers. Numerous schedulers have been or will be implemented based on Linux for various reasons. There exists CPU bandwidth control work dealing with some of these schedulers. But each such mechanism can only work with for one scheduler (one specific type of tasks). The oxc framework can provide real-time CPU bandwidth control for tasks of all these schedulers! The project is just started; more work is coming. Y. Sun (GPCSE) Master thesis September 14, 2012 26 / 26