[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240805153639.1057-2-justinjiang@vivo.com>
Date: Mon, 5 Aug 2024 23:36:37 +0800
From: Zhiguo Jiang <justinjiang@...o.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Will Deacon <will@...nel.org>,
"Aneesh Kumar K.V" <aneesh.kumar@...nel.org>,
Nick Piggin <npiggin@...il.com>,
Peter Zijlstra <peterz@...radead.org>,
Arnd Bergmann <arnd@...db.de>,
Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...nel.org>,
Roman Gushchin <roman.gushchin@...ux.dev>,
Shakeel Butt <shakeel.butt@...ux.dev>,
Muchun Song <muchun.song@...ux.dev>,
linux-arch@...r.kernel.org,
cgroups@...r.kernel.org,
Barry Song <21cnbao@...il.com>,
David Hildenbrand <david@...hat.com>,
Zhiguo Jiang <justinjiang@...o.com>
Cc: opensource.kernel@...o.com
Subject: [PATCH v3 1/2] mm: move task_is_dying to h headfile
Move task_is_dying() to include/linux/oom.h so that it can be
referenced elsewhere.
Signed-off-by: Zhiguo Jiang <justinjiang@...o.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
Powered by blists - more mailing lists