All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] [PATCH v2] Fix for occasional userspace process in D/Z state
@ 2014-09-26 13:18 anton.ivanov
  0 siblings, 0 replies; only message in thread
From: anton.ivanov @ 2014-09-26 13:18 UTC (permalink / raw)
  To: user-mode-linux-devel; +Cc: richard

From: Anton Ivanov <antivano@cisco.com>

Occasionally, under very heavy load inside UML, on host
or both one of the processes in UML will remain in D state
or will fail to reap a child which will sit in Z state.

This is very difficult to reproduce with stock UML because
the lseek()/read()|write()|fsync() in the ubd driver will
cause a constant "trickle" of memory synchronization regardless
of what UML is doing. It is possible though (3-4 hours of
loadavg >6 stress load with low memory can trigger it).

If lseek()/read()|write() are replaced with its equivalent
pread()|pwrite() the original bug becomes much easier to
reproduce. It now takes 5-10 minutes of heavy IO to cause it.

This fix seems to cure it. I am not sure if this is the best
place to invoke a memory barrier, this one works.

Signed-off-by: Anton Ivanov <antivano@cisco.com>
---

This version takes into account the fact that uml picks up the 
correct define out of arch/x86/um/barrier.h so no need to invoke it 
directly - noted by Richard Weinberger

I still do not know if this is the correct location to hit it with a
mb(). This one seems to cure it.

 arch/um/kernel/exec.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/um/kernel/exec.c b/arch/um/kernel/exec.c
index 0d7103c..86b1dc1 100644
--- a/arch/um/kernel/exec.c
+++ b/arch/um/kernel/exec.c
@@ -27,6 +27,7 @@ void flush_thread(void)
 	ret = unmap(&current->mm->context.id, 0, STUB_START, 0, &data);
 	ret = ret || unmap(&current->mm->context.id, STUB_END,
 			   host_task_size - STUB_END, 1, &data);
+	mb();
 	if (ret) {
 		printk(KERN_ERR "flush_thread - clearing address space failed, "
 		       "err = %d\n", ret);
-- 
1.7.10.4


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-09-26 13:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-26 13:18 [uml-devel] [PATCH v2] Fix for occasional userspace process in D/Z state anton.ivanov

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.