提交 75b7f801 编写于 作者: Y Yang Yingliang 提交者: Xie XiuQi

Revert "kernel:mm: Support disable oom-killer and report oom events"

ascend inclusion
category: feature
bugzilla: NA
CVE: NA

------------

It's specific code for ascend, so remove it.

This reverts commit 9901c4bfc156fc8eb812decb1fa58fa5706c7454.
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 7fa1a48c
...@@ -117,18 +117,4 @@ extern struct task_struct *find_lock_task_mm(struct task_struct *p); ...@@ -117,18 +117,4 @@ extern struct task_struct *find_lock_task_mm(struct task_struct *p);
extern int sysctl_oom_dump_tasks; extern int sysctl_oom_dump_tasks;
extern int sysctl_oom_kill_allocating_task; extern int sysctl_oom_kill_allocating_task;
extern int sysctl_panic_on_oom; extern int sysctl_panic_on_oom;
#ifdef CONFIG_ARCH_ASCEND
extern int sysctl_enable_oom_killer;
extern int register_hisi_oom_notifier(struct notifier_block *nb);
extern int hisi_oom_notifier_call(unsigned long val, void *v);
extern int unregister_hisi_oom_notifier(struct notifier_block *nb);
#else
#define sysctl_enable_oom_killer 1
#define hisi_oom_notifier_call(val, p) ({NOTIFY_DONE; })
#endif
#endif /* _INCLUDE_LINUX_OOM_H */ #endif /* _INCLUDE_LINUX_OOM_H */
...@@ -1264,17 +1264,6 @@ static struct ctl_table vm_table[] = { ...@@ -1264,17 +1264,6 @@ static struct ctl_table vm_table[] = {
.extra1 = &zero, .extra1 = &zero,
.extra2 = &two, .extra2 = &two,
}, },
#ifdef CONFIG_ARCH_ASCEND
{
.procname = "enable_oom_killer",
.data = &sysctl_enable_oom_killer,
.maxlen = sizeof(sysctl_enable_oom_killer),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.extra1 = &zero,
.extra2 = &one,
},
#endif
{ {
.procname = "oom_kill_allocating_task", .procname = "oom_kill_allocating_task",
.data = &sysctl_oom_kill_allocating_task, .data = &sysctl_oom_kill_allocating_task,
......
...@@ -1047,40 +1047,6 @@ int unregister_oom_notifier(struct notifier_block *nb) ...@@ -1047,40 +1047,6 @@ int unregister_oom_notifier(struct notifier_block *nb)
} }
EXPORT_SYMBOL_GPL(unregister_oom_notifier); EXPORT_SYMBOL_GPL(unregister_oom_notifier);
#ifdef CONFIG_ARCH_ASCEND
int sysctl_enable_oom_killer;
static BLOCKING_NOTIFIER_HEAD(hisi_oom_notify_list);
int register_hisi_oom_notifier(struct notifier_block *nb)
{
return blocking_notifier_chain_register(&hisi_oom_notify_list, nb);
}
EXPORT_SYMBOL_GPL(register_hisi_oom_notifier);
static unsigned long last_jiffies;
int hisi_oom_notifier_call(unsigned long val, void *v)
{
/* Print time interval to 10 seconds */
if (time_after(jiffies, last_jiffies + 10 * HZ)) {
pr_warn("HISI_OOM_NOTIFIER: oom type %lu\n", val);
dump_stack();
show_mem(SHOW_MEM_FILTER_NODES, NULL);
dump_tasks(NULL, 0);
last_jiffies = jiffies;
}
return blocking_notifier_call_chain(&hisi_oom_notify_list, val, v);
}
EXPORT_SYMBOL_GPL(hisi_oom_notifier_call);
int unregister_hisi_oom_notifier(struct notifier_block *nb)
{
return blocking_notifier_chain_unregister(&hisi_oom_notify_list, nb);
}
EXPORT_SYMBOL_GPL(unregister_hisi_oom_notifier);
#endif
/** /**
* out_of_memory - kill the "best" process when we run out of memory * out_of_memory - kill the "best" process when we run out of memory
* @oc: pointer to struct oom_control * @oc: pointer to struct oom_control
...@@ -1098,11 +1064,6 @@ bool out_of_memory(struct oom_control *oc) ...@@ -1098,11 +1064,6 @@ bool out_of_memory(struct oom_control *oc)
if (oom_killer_disabled) if (oom_killer_disabled)
return false; return false;
if (!sysctl_enable_oom_killer) {
hisi_oom_notifier_call(0, NULL);
return false;
}
if (!is_memcg_oom(oc)) { if (!is_memcg_oom(oc)) {
blocking_notifier_call_chain(&oom_notify_list, 0, &freed); blocking_notifier_call_chain(&oom_notify_list, 0, &freed);
if (freed > 0) if (freed > 0)
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include <asm/sections.h> #include <asm/sections.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/oom.h>
#include "internal.h" #include "internal.h"
...@@ -727,7 +726,6 @@ int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin) ...@@ -727,7 +726,6 @@ int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin)
if (percpu_counter_read_positive(&vm_committed_as) < allowed) if (percpu_counter_read_positive(&vm_committed_as) < allowed)
return 0; return 0;
error: error:
hisi_oom_notifier_call(1, NULL);
vm_unacct_memory(pages); vm_unacct_memory(pages);
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册