Re: [RFC PATCH v2 1/5] mm, oom: Introduce bpf_oom_evaluate_task

From: Bixuan Cui
Date: Wed Sep 13 2023 - 07:24:32 EST




在 2023/8/10 16:13, Chuyi Zhou 写道:
+ +__weak noinline int bpf_oom_evaluate_task(struct task_struct *task, struct oom_control *oc) +{ + return NO_BPF_POLICY; +} + +BTF_SET8_START(oom_bpf_fmodret_ids) +BTF_ID_FLAGS(func, bpf_oom_evaluate_task) +BTF_SET8_END(oom_bpf_fmodret_ids)
I have a question here, why use __weak? Is there other modules that can redefine bpf_oom_evaluate_task? why not use __bpf_kfunc (Documentation/bpf/kfuncs.rst) ?

Thanks
Bixuan Cui