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

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 

Recently uploaded (20)

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

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