1. 21 9月, 2022 1 次提交
  2. 31 8月, 2022 2 次提交
  3. 24 8月, 2022 22 次提交
  4. 22 8月, 2022 9 次提交
  5. 27 7月, 2022 2 次提交
    • R
      bpf: sched: add convenient helpers to identify sched entities · 628738d6
      Roman Gushchin 提交于
      maillist inclusion
      category: feature
      bugzilla: https://gitee.com/openeuler/kernel/issues/I5F6X6
      CVE: NA
      
      Reference: https://lore.kernel.org/all/20210916162451.709260-1-guro@fb.com/
      
      -------------------
      
      This patch adds 3 helpers useful for dealing with sched entities:
        u64 bpf_sched_entity_to_tgidpid(struct sched_entity *se);
        u64 bpf_sched_entity_to_cgrpid(struct sched_entity *se);
        long bpf_sched_entity_belongs_to_cgrp(struct sched_entity *se,
        	u64 cgrpid);
      
      Sched entity is a basic structure used by the scheduler to represent
      schedulable objects: tasks and cgroups (if CONFIG_FAIR_GROUP_SCHED
      is enabled). It will be passed as an argument to many bpf hooks, so
      scheduler bpf programs need a convenient way to deal with it.
      
      bpf_sched_entity_to_tgidpid() and bpf_sched_entity_to_cgrpid() are
      useful to identify a sched entity in userspace terms (pid, tgid and
      cgroup id). bpf_sched_entity_belongs_to_cgrp() allows to check whether
      a sched entity belongs to sub-tree of a cgroup. It allows to write
      cgroup-specific scheduler policies even without enabling the cgroup
      cpu controller.
      Signed-off-by: NRoman Gushchin <guro@fb.com>
      Signed-off-by: NChen Hui <judy.chenhui@huawei.com>
      Signed-off-by: NRen Zhijie <renzhijie2@huawei.com>
      628738d6
    • R
      bpf: sched: basic infrastructure for scheduler bpf · d93afd18
      Roman Gushchin 提交于
      maillist inclusion
      category: feature
      bugzilla: https://gitee.com/openeuler/kernel/issues/I5F6X6
      CVE: NA
      
      Reference: https://lore.kernel.org/all/20210916162451.709260-1-guro@fb.com/
      
      -------------------
      
      This commit introduces basic definitions and infrastructure for
      scheduler bpf programs. It defines the BPF_PROG_TYPE_SCHED program
      type and the BPF_SCHED attachment type.
      
      The implementation is inspired by lsm bpf programs and is based on
      kretprobes. This will allow to add new hooks with a minimal changes to
      the kernel code and without any changes to libbpf/bpftool.
      It's very convenient as I anticipate a large number of private patches
      being used for a long time before (or if at all) reaching upstream.
      
      Sched programs are expected to return an int, which meaning will be
      context defined.
      
      This patch doesn't add any real scheduler hooks (only a stub), it will
      be done by following patches in the series.
      
      Scheduler bpf programs as now are very restricted in what they can do:
      only the bpf_printk() helper is available. The scheduler context can
      impose significant restrictions on what's safe and what's not. So
      let's extend their abilities on case by case basis when a need arise.
      Signed-off-by: NRoman Gushchin <guro@fb.com>
      Signed-off-by: NChen Hui <judy.chenhui@huawei.com>
      Signed-off-by: NRen Zhijie <renzhijie2@huawei.com>
      d93afd18
  6. 18 7月, 2022 1 次提交
  7. 06 7月, 2022 2 次提交
  8. 10 5月, 2022 1 次提交