All of lore.kernel.org
 help / color / mirror / Atom feed
From: Abel Wu <wuyun.abel@bytedance.com>
To: Michal Hocko <mhocko@suse.com>,
	Roman Gushchin <roman.gushchin@linux.dev>
Cc: Chuyi Zhou <zhouchuyi@bytedance.com>,
	hannes@cmpxchg.org, ast@kernel.org, daniel@iogearbox.net,
	andrii@kernel.org, muchun.song@linux.dev, bpf@vger.kernel.org,
	linux-kernel@vger.kernel.org, robin.lu@bytedance.com
Subject: Re: Re: [RFC PATCH 1/2] mm, oom: Introduce bpf_select_task
Date: Thu, 10 Aug 2023 12:00:36 +0800	[thread overview]
Message-ID: <fdec0f4c-a65f-df16-b4ee-7cfd977c8d7f@bytedance.com> (raw)
In-Reply-To: <ZNNGFzwlv1dC866j@dhcp22.suse.cz>

On 8/9/23 3:53 PM, Michal Hocko wrote:
> On Tue 08-08-23 14:41:17, Roman Gushchin wrote:
>> It would be also nice to come up with some practical examples of bpf programs.
>> What are meaningful scenarios which can be covered with the proposed approach
>> and are not covered now with oom_score_adj.
> 
> Agreed here as well. This RFC serves purpose of brainstorming on all of
> this.
> 
> There is a fundamental question whether we need BPF for this task in the
> first place. Are there any huge advantages to export the callback and
> allow a kernel module to hook into it?

The ancient oom-killer largely depends on memory usage when choosing
victims, which might not fit the need of modern scenarios. It's common
nowadays that multiple workloads (tenants) with different 'priorities'
run together, and the decisions made by the oom-killer doesn't always
obey the service level agreements.

While the oom_score_adj only adjusts the usage-based decisions, so it
can hardly be translated into 'priority' semantic. How can we properly
configure it given that we don't know how much memory the workloads
will use? It's really hard for a static strategy to deal with dynamic
provision. IMHO the oom_score_adj is just another demon.

Reworking the oom-killer's internal algorithm or patching some random
metrics may satisfy the immediate needs, but for the next 10 years? I
doubt it. So I think we do need the flexibility to bypass the legacy
usage-based algorithm, through bpf or pre-select interfaces.

Regards,
	Abel

  reply	other threads:[~2023-08-10  4:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-04  9:38 [RFC PATCH 0/2] mm: Select victim using bpf_select_task Chuyi Zhou
2023-08-04  9:38 ` [RFC PATCH 1/2] mm, oom: Introduce bpf_select_task Chuyi Zhou
2023-08-04 11:29   ` Michal Hocko
2023-08-04 13:15     ` Chuyi Zhou
2023-08-04 13:34       ` Michal Hocko
2023-08-07  2:21         ` Chuyi Zhou
2023-08-07  7:04           ` Michal Hocko
2023-08-07 17:28             ` Roman Gushchin
2023-08-08  8:18               ` Michal Hocko
2023-08-08 21:41                 ` Roman Gushchin
2023-08-09  7:53                   ` Michal Hocko
2023-08-10  4:00                     ` Abel Wu [this message]
2023-08-15 19:52                       ` Roman Gushchin
2023-08-10 19:41                     ` Martin KaFai Lau
2023-08-15 19:03                       ` Roman Gushchin
2023-08-14 11:25                     ` Chuyi Zhou
2023-08-22 12:42                       ` Michal Hocko
2023-08-04 11:34   ` Alan Maguire
2023-08-04 23:55     ` Chuyi Zhou
2023-08-07  8:32       ` Michal Hocko
2023-08-04  9:38 ` [RFC PATCH 2/2] bpf: Add OOM policy test Chuyi Zhou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fdec0f4c-a65f-df16-b4ee-7cfd977c8d7f@bytedance.com \
    --to=wuyun.abel@bytedance.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@suse.com \
    --cc=muchun.song@linux.dev \
    --cc=robin.lu@bytedance.com \
    --cc=roman.gushchin@linux.dev \
    --cc=zhouchuyi@bytedance.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.