From: Zhiguo Jiang <justinjiang@vivo.com>
To: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Will Deacon <will@kernel.org>,
"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
Nick Piggin <npiggin@gmail.com>,
Peter Zijlstra <peterz@infradead.org>,
Arnd Bergmann <arnd@arndb.de>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
Shakeel Butt <shakeel.butt@linux.dev>,
Muchun Song <muchun.song@linux.dev>,
linux-arch@vger.kernel.org, cgroups@vger.kernel.org,
Barry Song <21cnbao@gmail.com>,
David Hildenbrand <david@redhat.com>,
Zhiguo Jiang <justinjiang@vivo.com>
Cc: opensource.kernel@vivo.com
Subject: [PATCH v3 1/2] mm: move task_is_dying to h headfile
Date: Mon, 5 Aug 2024 23:36:37 +0800 [thread overview]
Message-ID: <20240805153639.1057-2-justinjiang@vivo.com> (raw)
In-Reply-To: <20240805153639.1057-1-justinjiang@vivo.com>
Move task_is_dying() to include/linux/oom.h so that it can be
referenced elsewhere.
Signed-off-by: Zhiguo Jiang <justinjiang@vivo.com>
---
include/linux/oom.h | 6 ++++++
mm/memcontrol.c | 6 ------
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/linux/oom.h b/include/linux/oom.h
index 7d0c9c48a0c5..a3a58463c0d5
--- a/include/linux/oom.h
+++ b/include/linux/oom.h
@@ -77,6 +77,12 @@ static inline bool tsk_is_oom_victim(struct task_struct * tsk)
return tsk->signal->oom_mm;
}
+static inline bool task_is_dying(void)
+{
+ return tsk_is_oom_victim(current) || fatal_signal_pending(current) ||
+ (current->flags & PF_EXITING);
+}
+
/*
* Checks whether a page fault on the given mm is still reliable.
* This is no longer true if the oom reaper started to reap the
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index e1ffd2950393..37054c94031a
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -98,12 +98,6 @@ static DECLARE_WAIT_QUEUE_HEAD(memcg_cgwb_frn_waitq);
#define THRESHOLDS_EVENTS_TARGET 128
#define SOFTLIMIT_EVENTS_TARGET 1024
-static inline bool task_is_dying(void)
-{
- return tsk_is_oom_victim(current) || fatal_signal_pending(current) ||
- (current->flags & PF_EXITING);
-}
-
/* Some nice accessors for the vmpressure. */
struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg)
{
--
2.39.0
next prev parent reply other threads:[~2024-08-05 15:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-05 15:36 [PATCH v3 0/2] mm: tlb swap entries batch async release Zhiguo Jiang
2024-08-05 15:36 ` Zhiguo Jiang [this message]
2024-08-05 15:36 ` [PATCH v3 2/2] mm: tlb: add " Zhiguo Jiang
2024-09-04 9:16 ` Barry Song
2024-09-04 11:26 ` zhiguojiang
2024-09-04 11:38 ` zhiguojiang
2024-09-09 1:59 ` Barry Song
2024-09-09 14:39 ` zhiguojiang
2024-09-10 4:18 ` Barry Song
2024-09-10 9:22 ` zhiguojiang
2024-09-10 10:11 ` Barry Song
2024-09-12 7:30 ` zhiguojiang
2024-09-09 6:49 ` David Hildenbrand
2024-09-09 14:43 ` zhiguojiang
2024-09-10 4:22 ` Barry Song
2024-09-10 8:52 ` David Hildenbrand
2024-09-10 9:27 ` zhiguojiang
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=20240805153639.1057-2-justinjiang@vivo.com \
--to=justinjiang@vivo.com \
--cc=21cnbao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@kernel.org \
--cc=arnd@arndb.de \
--cc=cgroups@vger.kernel.org \
--cc=david@redhat.com \
--cc=hannes@cmpxchg.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=muchun.song@linux.dev \
--cc=npiggin@gmail.com \
--cc=opensource.kernel@vivo.com \
--cc=peterz@infradead.org \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=will@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox