All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: numa: ksm: fix oops in task_numa_placment()
@ 2012-12-20  1:42 ` Hugh Dickins
  0 siblings, 0 replies; 22+ messages in thread
From: Hugh Dickins @ 2012-12-20  1:42 UTC (permalink / raw)
  To: Mel Gorman
  Cc: Linus Torvalds, Andrew Morton, Ingo Molnar, Sasha Levin,
	Petr Holasek, linux-kernel, linux-mm

task_numa_placement() oopsed on NULL p->mm when task_numa_fault()
got called in the handling of break_ksm() for ksmd.  That might be a
peculiar case, which perhaps KSM could takes steps to avoid? but it's
more robust if task_numa_placement() allows for such a possibility.

Signed-off-by: Hugh Dickins <hughd@google.com>
---

 kernel/sched/fair.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- 3.7+git/kernel/sched/fair.c	2012-12-16 16:35:08.724441527 -0800
+++ linux/kernel/sched/fair.c	2012-12-18 21:37:24.727964195 -0800
@@ -793,8 +793,11 @@ unsigned int sysctl_numa_balancing_scan_
 
 static void task_numa_placement(struct task_struct *p)
 {
-	int seq = ACCESS_ONCE(p->mm->numa_scan_seq);
+	int seq;
 
+	if (!p->mm)	/* for example, ksmd faulting in a user's mm */
+		return;
+	seq = ACCESS_ONCE(p->mm->numa_scan_seq);
 	if (p->numa_scan_seq == seq)
 		return;
 	p->numa_scan_seq = seq;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2012-12-21  2:35 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-20  1:42 [PATCH] sched: numa: ksm: fix oops in task_numa_placment() Hugh Dickins
2012-12-20  1:42 ` Hugh Dickins
2012-12-20  1:44 ` [PATCH] ksm: make rmap walks more scalable Hugh Dickins
2012-12-20  1:44   ` Hugh Dickins
2012-12-20 11:17   ` Mel Gorman
2012-12-20 11:17     ` Mel Gorman
2012-12-20 21:49   ` Sasha Levin
2012-12-20 21:49     ` Sasha Levin
2012-12-20 22:26     ` Linus Torvalds
2012-12-20 22:26       ` Linus Torvalds
2012-12-20 22:40       ` Hugh Dickins
2012-12-20 22:40         ` Hugh Dickins
2012-12-20 22:37     ` Hugh Dickins
2012-12-20 22:37       ` Hugh Dickins
2012-12-20 22:43       ` Sasha Levin
2012-12-20 22:43         ` Sasha Levin
2012-12-21  0:36         ` Petr Holasek
2012-12-21  0:36           ` Petr Holasek
2012-12-21  2:35           ` Hugh Dickins
2012-12-21  2:35             ` Hugh Dickins
2012-12-20 11:14 ` [PATCH] sched: numa: ksm: fix oops in task_numa_placment() Mel Gorman
2012-12-20 11:14   ` Mel Gorman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.