linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/oom_kill.c: fix initial value of victim_points variable
@ 2016-11-24 13:11 Адыгжы Ондар
  2016-11-24 14:21 ` Michal Hocko
  0 siblings, 1 reply; 2+ messages in thread
From: Адыгжы Ондар @ 2016-11-24 13:11 UTC (permalink / raw)
  To: linux-mm

[-- Attachment #1: Type: text/plain, Size: 939 bytes --]

If the initial value of victim_points variable is equal to 0,
oom killer may choose a victim incorrectly.
For example, parent points > 0, 0 < child_points < parent points
(chosen_points).
In this example, current oom killer chooses this child, not parent.

To apply the patch, in the root of a kernel tree use:
patch -p1 <this_fix.patch

Signed-off-by: Adygzhy Ondar <ondar07@gmail.com>

------------------------------------------------------------------------------------
--- linux/mm/oom_kill.c.orig 2016-11-24 15:03:43.711235386 +0300
+++ linux/mm/oom_kill.c 2016-11-24 15:04:00.851942474 +0300
@@ -812,7 +812,7 @@ static void oom_kill_process(struct oom_
  struct task_struct *child;
  struct task_struct *t;
  struct mm_struct *mm;
- unsigned int victim_points = 0;
+ unsigned int victim_points = points;
  static DEFINE_RATELIMIT_STATE(oom_rs, DEFAULT_RATELIMIT_INTERVAL,
       DEFAULT_RATELIMIT_BURST);
  bool can_oom_reap = true;

[-- Attachment #2: Type: text/html, Size: 1904 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-24 14:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-24 13:11 [PATCH] mm/oom_kill.c: fix initial value of victim_points variable Адыгжы Ондар
2016-11-24 14:21 ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox