From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org, wangkefeng.wang@huawei.com,
sunnanyong@huawei.com, shakeelb@google.com, mhocko@suse.com,
zhangpeng362@huawei.com, akpm@linux-foundation.org
Subject: + mm-oom-terminate-the-oom_evaluate_task-loop-early.patch added to mm-unstable branch
Date: Mon, 14 Aug 2023 12:30:14 -0700 [thread overview]
Message-ID: <20230814193015.93E2EC433C7@smtp.kernel.org> (raw)
The patch titled
Subject: mm: oom: terminate the oom_evaluate_task() loop early
has been added to the -mm mm-unstable branch. Its filename is
mm-oom-terminate-the-oom_evaluate_task-loop-early.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-oom-terminate-the-oom_evaluate_task-loop-early.patch
This patch will later appear in the mm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: ZhangPeng <zhangpeng362@huawei.com>
Subject: mm: oom: terminate the oom_evaluate_task() loop early
Date: Mon, 14 Aug 2023 14:34:28 +0800
If task is allocating a lot of memory and has been marked to be killed
first, then it gets the highest score (LONG_MAX). Therefore, there is no
need to continue to calculate the points of other tasks. Just terminate
the oom_evaluate_task() loop early, when the task with the highest score
is found. By doing this, we can get some performance gains in
select_bad_process().
To implement it, the return value of oom_evaluate_task() is modified.
When the task with the highest score is found (points == LONG_MAX),
oom_evaluate_task() will return 1 and the loop will terminate early.
Link: https://lkml.kernel.org/r/20230814063428.4111206-3-zhangpeng362@huawei.com
Signed-off-by: ZhangPeng <zhangpeng362@huawei.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Nanyong Sun <sunnanyong@huawei.com>
Cc: Shakeel Butt <shakeelb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/oom_kill.c | 2 ++
1 file changed, 2 insertions(+)
--- a/mm/oom_kill.c~mm-oom-terminate-the-oom_evaluate_task-loop-early
+++ a/mm/oom_kill.c
@@ -346,6 +346,8 @@ static int oom_evaluate_task(struct task
get_task_struct(task);
oc->chosen = task;
oc->chosen_points = points;
+ if (points == LONG_MAX)
+ return 1;
next:
return 0;
abort:
_
Patches currently in -mm which might be from zhangpeng362@huawei.com are
mm-kmsan-use-helper-function-page_size.patch
mm-kmsan-use-helper-macro-offset_in_page.patch
mm-kmsan-use-helper-macros-page_align-and-page_align_down.patch
mm-remove-redundant-k-macro-definition.patch
mm-swapfilec-use-helper-macro-k.patch
mm-swap_statec-use-helper-macro-k.patch
mm-shmemc-use-helper-macro-k.patch
mm-nommuc-use-helper-macro-k.patch
mm-mmapc-use-helper-macro-k.patch
mm-hugetlbc-use-helper-macro-k.patch
mm-page_alloc-remove-unused-parameter-from-reserve_highatomic_pageblock.patch
mm-oom-remove-unnecessary-goto-in-oom_evaluate_task.patch
mm-oom-terminate-the-oom_evaluate_task-loop-early.patch
reply other threads:[~2023-08-14 19:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20230814193015.93E2EC433C7@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@suse.com \
--cc=mm-commits@vger.kernel.org \
--cc=shakeelb@google.com \
--cc=sunnanyong@huawei.com \
--cc=wangkefeng.wang@huawei.com \
--cc=zhangpeng362@huawei.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.