Skip to main content
updated link.
Source Link
tk421
  • 317
  • 3
  • 9

It looks like it is:

oom_score = badness * 1000 / totalpages

based on the kernel code https://github.com/torvalds/linux/blob/master/fs/proc/base.c#L497https://github.com/torvalds/linux/blob/master/fs/proc/base.c#L549.

static int proc_oom_score(struct seq_file *m, struct pid_namespace *ns, struct pid *pid, struct task_struct *task) { unsigned long totalpages = totalram_pages + total_swap_pages; unsigned long points = 0; points = oom_badness(task, NULL, NULL, totalpages) * 1000 / totalpages; seq_printf(m, "%lu\n", points); return 0; } 

It looks like it is:

oom_score = badness * 1000 / totalpages

based on the kernel code https://github.com/torvalds/linux/blob/master/fs/proc/base.c#L497.

static int proc_oom_score(struct seq_file *m, struct pid_namespace *ns, struct pid *pid, struct task_struct *task) { unsigned long totalpages = totalram_pages + total_swap_pages; unsigned long points = 0; points = oom_badness(task, NULL, NULL, totalpages) * 1000 / totalpages; seq_printf(m, "%lu\n", points); return 0; } 

It looks like it is:

oom_score = badness * 1000 / totalpages

based on the kernel code https://github.com/torvalds/linux/blob/master/fs/proc/base.c#L549.

static int proc_oom_score(struct seq_file *m, struct pid_namespace *ns, struct pid *pid, struct task_struct *task) { unsigned long totalpages = totalram_pages + total_swap_pages; unsigned long points = 0; points = oom_badness(task, NULL, NULL, totalpages) * 1000 / totalpages; seq_printf(m, "%lu\n", points); return 0; } 
Source Link
tk421
  • 317
  • 3
  • 9

It looks like it is:

oom_score = badness * 1000 / totalpages

based on the kernel code https://github.com/torvalds/linux/blob/master/fs/proc/base.c#L497.

static int proc_oom_score(struct seq_file *m, struct pid_namespace *ns, struct pid *pid, struct task_struct *task) { unsigned long totalpages = totalram_pages + total_swap_pages; unsigned long points = 0; points = oom_badness(task, NULL, NULL, totalpages) * 1000 / totalpages; seq_printf(m, "%lu\n", points); return 0; }