From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: "Luis Claudio R. Goncalves" <lclaudio@uudg.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-mm <linux-mm@kvack.org>, Oleg Nesterov <oleg@redhat.com>,
David Rientjes <rientjes@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Nick Piggin <npiggin@suse.de>,
Minchan Kim <minchan.kim@gmail.com>
Cc: kosaki.motohiro@jp.fujitsu.com
Subject: [PATCH 03/10] oom: rename badness() to oom_badness()
Date: Tue, 8 Jun 2010 20:56:29 +0900 (JST) [thread overview]
Message-ID: <20100608205536.7683.A69D9226@jp.fujitsu.com> (raw)
In-Reply-To: <20100608204621.767A.A69D9226@jp.fujitsu.com>
badness() is wrong name because it's too generic name.
rename it.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
---
fs/proc/base.c | 4 +---
include/linux/oom.h | 2 ++
mm/oom_kill.c | 10 +++++-----
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 2222102..c099f03 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -427,8 +427,6 @@ static const struct file_operations proc_lstats_operations = {
#endif
-/* The badness from the OOM killer */
-unsigned long badness(struct task_struct *p, unsigned long uptime);
static int proc_oom_score(struct task_struct *task, char *buffer)
{
unsigned long points = 0;
@@ -437,7 +435,7 @@ static int proc_oom_score(struct task_struct *task, char *buffer)
do_posix_clock_monotonic_gettime(&uptime);
read_lock(&tasklist_lock);
if (pid_alive(task))
- points = badness(task, uptime.tv_sec);
+ points = oom_badness(task, uptime.tv_sec);
read_unlock(&tasklist_lock);
return sprintf(buffer, "%lu\n", points);
}
diff --git a/include/linux/oom.h b/include/linux/oom.h
index 5376623..effb223 100644
--- a/include/linux/oom.h
+++ b/include/linux/oom.h
@@ -14,6 +14,7 @@
struct zonelist;
struct notifier_block;
+struct task_struct;
/*
* Types of limitations to the nodes from which allocations may occur
@@ -29,6 +30,7 @@ extern void clear_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags);
extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask,
int order, nodemask_t *mask);
+extern unsigned long oom_badness(struct task_struct *p, unsigned long uptime);
extern int register_oom_notifier(struct notifier_block *nb);
extern int unregister_oom_notifier(struct notifier_block *nb);
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 3c83fba..80492ff 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -66,7 +66,7 @@ static struct task_struct *find_lock_task_mm(struct task_struct *p)
}
/**
- * badness - calculate a numeric value for how bad this task has been
+ * oom_badness - calculate a numeric value for how bad this task has been
* @p: task struct of which task we should calculate
* @uptime: current uptime in seconds
*
@@ -84,7 +84,7 @@ static struct task_struct *find_lock_task_mm(struct task_struct *p)
* of least surprise ... (be careful when you change it)
*/
-unsigned long badness(struct task_struct *p, unsigned long uptime)
+unsigned long oom_badness(struct task_struct *p, unsigned long uptime)
{
unsigned long points, cpu_time, run_time;
struct task_struct *c;
@@ -302,7 +302,7 @@ static struct task_struct *select_bad_process(unsigned long *ppoints,
if (test_tsk_thread_flag(p, TIF_MEMDIE))
return ERR_PTR(-1UL);
- points = badness(p, uptime.tv_sec);
+ points = oom_badness(p, uptime.tv_sec);
if (points > *ppoints || !chosen) {
chosen = p;
*ppoints = points;
@@ -438,8 +438,8 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
if (oom_unkillable(c, mem))
continue;
- /* badness() returns 0 if the thread is unkillable */
- cpoints = badness(c, uptime.tv_sec);
+ /* oom_badness() returns 0 if the thread is unkillable */
+ cpoints = oom_badness(c, uptime.tv_sec);
if (cpoints > victim_points) {
victim = c;
victim_points = cpoints;
--
1.6.5.2
next prev parent reply other threads:[~2010-06-08 11:56 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-08 11:53 [0/10] 3rd pile of OOM patch series KOSAKI Motohiro
2010-06-08 11:54 ` [PATCH 01/10] oom: don't try to kill oom_unkillable child KOSAKI Motohiro
2010-06-08 19:10 ` David Rientjes
2010-06-08 11:55 ` [PATCH 02/10] oom: remove verbose argument from __oom_kill_process() KOSAKI Motohiro
2010-06-08 19:09 ` David Rientjes
2010-06-08 11:56 ` KOSAKI Motohiro [this message]
2010-06-08 19:09 ` [PATCH 03/10] oom: rename badness() to oom_badness() David Rientjes
2010-06-08 11:57 ` [PATCH 04/10] oom: move sysctl declarations to oom.h KOSAKI Motohiro
2010-06-08 11:58 ` [PATCH 05/10] oom: enable oom tasklist dump by default KOSAKI Motohiro
2010-06-08 11:59 ` [PATCH 06/10] oom: cleanup has_intersects_mems_allowed() KOSAKI Motohiro
2010-06-08 19:07 ` David Rientjes
2010-06-08 11:59 ` [PATCH 07/10] oom: kill useless debug print KOSAKI Motohiro
2010-06-08 19:01 ` David Rientjes
2010-06-08 12:01 ` [PATCH 08/10] oom: use send_sig() instead force_sig() KOSAKI Motohiro
2010-06-08 18:41 ` Oleg Nesterov
2010-06-10 0:59 ` [PATCH 0/1] signals: introduce send_sigkill() helper Oleg Nesterov
2010-06-10 1:00 ` [PATCH 1/1] " Oleg Nesterov
2010-06-11 0:40 ` KAMEZAWA Hiroyuki
2010-06-13 11:24 ` KOSAKI Motohiro
2010-06-13 15:29 ` Oleg Nesterov
2010-06-16 10:00 ` KOSAKI Motohiro
2010-06-13 11:24 ` [PATCH 08/10] oom: use send_sig() instead force_sig() KOSAKI Motohiro
2010-06-08 12:02 ` [PATCH 09/10] oom: filter tasks not sharing the same cpuset KOSAKI Motohiro
2010-06-08 19:05 ` David Rientjes
2010-06-08 12:04 ` [PATCH 10/10] oom: select task from tasklist for mempolicy ooms KOSAKI Motohiro
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=20100608205536.7683.A69D9226@jp.fujitsu.com \
--to=kosaki.motohiro@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=lclaudio@uudg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan.kim@gmail.com \
--cc=npiggin@suse.de \
--cc=oleg@redhat.com \
--cc=rientjes@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®