• W
    sched: smart grid: init sched_grid_qos structure on QOS purpose · ce35ded5
    Wang ShaoBo 提交于
    hulk inclusion
    category: feature
    bugzilla: https://gitee.com/openeuler/kernel/issues/I7BQZ0
    CVE: NA
    
    ----------------------------------------
    
    As smart grid scheduling (SGS) may shrink resources and affect task QOS,
    We provide methods for evaluating task QOS in divided grid, we mainly
    focus on the following two aspects:
    
       1. Evaluate whether (such as CPU or memory) resources meet our demand
       2. Ensure the least impact when working with (cpufreq and cpuidle) governors
    
    For tackling this questions, we have summarized several sampling methods
    to obtain tasks' characteristics at same time reducing scheduling noise
    as much as possible:
    
      1. we detected the key factors that how sensitive a process is in cpufreq
         or cpuidle adjustment, and to guide the cpufreq/cpuidle governor
      2. We dynamically monitor process memory bandwidth and adjust memory
         allocation to minimize cross-remote memory access
      3. We provide a variety of load tracking mechanisms to adapt to different
         types of task's load change
    
         ---------------------------------     -----------------
        |            class A              |   |     class B     |
        |    --------        --------     |   |     --------    |
        |   | group0 |      | group1 |    |---|    | group2 |   |----------+
        |    --------        --------     |   |     --------    |          |
        |    CPU/memory sensitive type    |   |   balance type  |          |
         ----------------+----------------     --------+--------           |
                         v                             v                   | (target cpufreq)
         -------------------------------------------------------           | (sensitivity)
        |              Not satisfied with QOS?                  |          |
         --------------------------+----------------------------           |
                                   v                                       v
         -------------------------------------------------------     ----------------
        |              expand or shrink resource                |<--|  energy model  |
         ----------------------------+--------------------------     ----------------
                                     v                                     |
         -----------          -----------          ------------            v
        |           |        |           |        |            |     ---------------
        |   GRID0   +--------+   GRID1   +--------+   GRID2    |<-- |   governor    |
        |           |        |           |        |            |     ---------------
         -----------          -----------          ------------
                       \            |            /
                        \  -------------------  /
                          |  pages migration  |
                           -------------------
    
    We will introduce the energy model in the follow-up implementation, and consider
    the dynamic affinity adjustment between each divided grid in the runtime.
    Signed-off-by: NWang ShaoBo <bobo.shaobowang@huawei.com>
    Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
    Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
    Signed-off-by: NZhang Changzhong <zhangchangzhong@huawei.com>
    ce35ded5
fair.c 304.1 KB