[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZMz+aBHFvfcr0oIe@dhcp22.suse.cz>
Date: Fri, 4 Aug 2023 15:34:32 +0200
From: Michal Hocko <mhocko@...e.com>
To: Chuyi Zhou <zhouchuyi@...edance.com>
Cc: hannes@...xchg.org, roman.gushchin@...ux.dev, ast@...nel.org,
daniel@...earbox.net, andrii@...nel.org, muchun.song@...ux.dev,
bpf@...r.kernel.org, linux-kernel@...r.kernel.org,
wuyun.abel@...edance.com, robin.lu@...edance.com
Subject: Re: [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
Powered by blists - more mailing lists