lkml.org 
[lkml]   [2023]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 1/2] mm, oom: Introduce bpf_select_task
On Fri 04-08-23 21:15:57, Chuyi Zhou wrote:
[...]
> > + switch (bpf_oom_evaluate_task(task, oc, &points)) {
> > + case -EOPNOTSUPP: break; /* No BPF policy */
> > + case -EBUSY: goto abort; /* abort search process */
> > + case 0: goto next; /* ignore process */
> > + default: goto select; /* note the task */
> > + }
>
> Why we need to change the *points* value if we do not care about oom_badness
> ? Is it used to record some state? If so, we could record it through bpf
> map.

Strictly speaking we do not need to. That would require BPF to keep the
state internally. Many will do I suppose but we have to keep track of
the victim so that the oom killer knows what to kill so I thought that
it doesn't hurt to keep track of an abstract concept of points as well.
If you think this is not needed then oc->points could be always 0 for
bpf selected victims. The value is not used anyway in the proposed
scheme.

Btw. we will need another hook or metadata for the reporting side of
things. Generally dump_header() to know what has been the selection
policy.

--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2023-08-04 15:35    [W:0.043 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site