All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Dike <jdike@addtoit.com>
To: Blaisorblade <blaisorblade@yahoo.it>
Cc: user-mode-linux-devel@lists.sourceforge.net,
	Werner Almesberger <wa@almesberger.net>,
	Rob Landley <rob@landley.net>
Subject: Re: [uml-devel] Occasional hang starting up.
Date: Mon, 20 Mar 2006 20:00:25 -0500	[thread overview]
Message-ID: <20060321010025.GC7860@ccure.user-mode-linux.org> (raw)
In-Reply-To: <200603172036.59218.blaisorblade@yahoo.it>

On Fri, Mar 17, 2006 at 08:36:58PM +0100, Blaisorblade wrote:
> 2) write_sigio_thread should do a "down" on a semaphore/mutex and the first 
> update_thread should "up" it. As usually, this semaphore would be indeed 
> implemented as a pipe.

Is there anything wrong with this:

Index: linux-2.6.15/arch/um/os-Linux/sigio.c
===================================================================
--- linux-2.6.15.orig/arch/um/os-Linux/sigio.c	2006-03-20 19:48:51.000000000 -0500
+++ linux-2.6.15/arch/um/os-Linux/sigio.c	2006-03-20 19:49:55.000000000 -0500
@@ -271,6 +271,10 @@ void write_sigio_workaround(void)
 	if(write_sigio_pid != -1)
 		goto out_unlock;
 
+	current_poll = ((struct pollfds) { .poll 	= p,
+					   .used 	= 1,
+					   .size 	= 1 });
+
 	write_sigio_pid = run_helper_thread(write_sigio_thread, NULL,
 					    CLONE_FILES | CLONE_VM, &stack, 0);
 
@@ -284,10 +288,6 @@ void write_sigio_workaround(void)
 	memcpy(write_sigio_fds, l_write_sigio_fds, sizeof(l_write_sigio_fds));
 	memcpy(sigio_private, l_sigio_private, sizeof(l_sigio_private));
 
-	current_poll = ((struct pollfds) { .poll 	= p,
-					   .used 	= 1,
-					   .size 	= 1 });
-
 	sigio_unlock();
 	return;
 
That seems to me to fix the basic problem - the thread is using data
that hasn't been set up yet, and I don't see that moving it up breaks
anything.

				Jeff


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

  parent reply	other threads:[~2006-03-21  1:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-11 18:01 [uml-devel] Occasional hang starting up Rob Landley
2006-03-12 20:33 ` Blaisorblade
2006-03-14 20:22 ` Jeff Dike
2006-03-14 21:31   ` Rob Landley
2006-03-16 14:22   ` Werner Almesberger
2006-03-17 19:36     ` Blaisorblade
2006-03-17 21:27       ` Werner Almesberger
2006-03-17 22:14         ` Blaisorblade
2006-03-17 23:54           ` Werner Almesberger
2006-03-20 10:20       ` Werner Almesberger
2006-03-21  1:00       ` Jeff Dike [this message]
2006-03-21  1:21         ` Blaisorblade
2006-03-23 18:45           ` Jeff Dike
2006-03-23 19:05             ` Werner Almesberger
2006-03-23 20:13               ` Jeff Dike
2006-03-23 21:23                 ` Werner Almesberger
2006-03-23 21:43                   ` Jeff Dike
2006-03-24  0:37             ` Blaisorblade
2006-03-24  2:26               ` Jeff Dike

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060321010025.GC7860@ccure.user-mode-linux.org \
    --to=jdike@addtoit.com \
    --cc=blaisorblade@yahoo.it \
    --cc=rob@landley.net \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    --cc=wa@almesberger.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.