[PATCH 0/4] sched_ext: Compatible testing of SCX_ENQ_CPU_SELECTED

Changwoo Min posted 4 patches 1 year ago
tools/sched_ext/include/scx/common.bpf.h      |   1 +
tools/sched_ext/include/scx/common.h          |   1 +
tools/sched_ext/include/scx/compat.bpf.h      |  52 ++++++++
.../sched_ext/include/scx/enum_defs.autogen.h | 120 ++++++++++++++++++
tools/sched_ext/scx_qmap.bpf.c                |   2 +-
5 files changed, 175 insertions(+), 1 deletion(-)
create mode 100644 tools/sched_ext/include/scx/enum_defs.autogen.h
[PATCH 0/4] sched_ext: Compatible testing of SCX_ENQ_CPU_SELECTED
Posted by Changwoo Min 1 year ago
This patchset is for testing `SCX_ENQ_CPU_SELECTED` in a compatible way.
More specifically, it handles two cases:
  1. a BPF scheduler is compiled against vmlinux.h where
  SCX_ENQ_CPU_SELECTED is defined, but it runs on a kernel that does not
  have SCX_ENQ_CPU_SELECTED.
  2. a BPF scheduler is compiling against vmlinux.h where
  SCX_ENQ_CPU_SELECTED is not defined.

The patch consists of three parts:
  1. Add enum_defs.autogen.h, which has macros denoting whether SCX
  enums are defined in the vmlinux.h or not.
  2. Implement __COMPAT_is_enq_cpu_selected(), which provide the test of
  SCX_ENQ_CPU_SELECTED in a compatible way.
  3. Use  __COMPAT_is_enq_cpu_selected() in scx_qmap.

Also, this patchset is a sync of the relevant PR [1] in the scx repo.

[1] https://github.com/sched-ext/scx/pull/1314

Changwoo Min (4):
  sched_ext: Add enum_defs.autogen.h
  sched_ext: Include enum_defs.autogen.h from common/common.bpf.h
  sched_ext: Add __COMPAT_is_enq_cpu_selected() for BPF compatability
  sched_ext: Use __COMPAT_is_enq_cpu_selected() in scx_qmap

 tools/sched_ext/include/scx/common.bpf.h      |   1 +
 tools/sched_ext/include/scx/common.h          |   1 +
 tools/sched_ext/include/scx/compat.bpf.h      |  52 ++++++++
 .../sched_ext/include/scx/enum_defs.autogen.h | 120 ++++++++++++++++++
 tools/sched_ext/scx_qmap.bpf.c                |   2 +-
 5 files changed, 175 insertions(+), 1 deletion(-)
 create mode 100644 tools/sched_ext/include/scx/enum_defs.autogen.h

-- 
2.48.1
Re: [PATCH 0/4] sched_ext: Compatible testing of SCX_ENQ_CPU_SELECTED
Posted by Tejun Heo 12 months ago
On Sat, Feb 08, 2025 at 01:43:28PM +0900, Changwoo Min wrote:
> This patchset is for testing `SCX_ENQ_CPU_SELECTED` in a compatible way.
> More specifically, it handles two cases:
>   1. a BPF scheduler is compiled against vmlinux.h where
>   SCX_ENQ_CPU_SELECTED is defined, but it runs on a kernel that does not
>   have SCX_ENQ_CPU_SELECTED.
>   2. a BPF scheduler is compiling against vmlinux.h where
>   SCX_ENQ_CPU_SELECTED is not defined.
> 
> The patch consists of three parts:
>   1. Add enum_defs.autogen.h, which has macros denoting whether SCX
>   enums are defined in the vmlinux.h or not.
>   2. Implement __COMPAT_is_enq_cpu_selected(), which provide the test of
>   SCX_ENQ_CPU_SELECTED in a compatible way.
>   3. Use  __COMPAT_is_enq_cpu_selected() in scx_qmap.
> 
> Also, this patchset is a sync of the relevant PR [1] in the scx repo.
> 
> [1] https://github.com/sched-ext/scx/pull/1314
> 
> Changwoo Min (4):
>   sched_ext: Add enum_defs.autogen.h
>   sched_ext: Include enum_defs.autogen.h from common/common.bpf.h
>   sched_ext: Add __COMPAT_is_enq_cpu_selected() for BPF compatability
>   sched_ext: Use __COMPAT_is_enq_cpu_selected() in scx_qmap

Can you collapse the four patches into a single patch? I don't think this
needs to be split this granularly.

Thanks.

-- 
tejun
Re: [PATCH 0/4] sched_ext: Compatible testing of SCX_ENQ_CPU_SELECTED
Posted by Changwoo Min 12 months ago
Hello,

Thanks for the quick review!

On 25. 2. 8. 17:13, Tejun Heo wrote:
> On Sat, Feb 08, 2025 at 01:43:28PM +0900, Changwoo Min wrote:
>> Changwoo Min (4):
>>    sched_ext: Add enum_defs.autogen.h
>>    sched_ext: Include enum_defs.autogen.h from common/common.bpf.h
>>    sched_ext: Add __COMPAT_is_enq_cpu_selected() for BPF compatability
>>    sched_ext: Use __COMPAT_is_enq_cpu_selected() in scx_qmap
> 
> Can you collapse the four patches into a single patch? I don't think this
> needs to be split this granularly.

Sure, I will send out a collapsed version.

Regards,
Changwoo Min