Date: Tue, 9 Oct 2007 16:33:00 -0700 (PDT) From: Matthew Dillon <dillon@apollo.backplane.com> To: Kostik Belousov <kostikbel@gmail.com> Cc: arch@freebsd.org Subject: Re: Abolishing sleeps in issignal() Message-ID: <200710092333.l99NX0qZ073285@apollo.backplane.com> References: <20071008142928.Y912@10.0.0.1> <20071009100259.GW2180@deviant.kiev.zoral.com.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
I noticed the sigstop cascade with NFS a year or two ago and changed the way DragonFly handles SIGSTOP to no longer actually stop the process in the sleep code. What it does instead is set the process (or thread) state to SSTOP, but does not actually stop the process until the process tries to return to userland. All the stop handling was moved to userret(). It works just dandy, The only issue that cropped up from doing things this way is that when you ^Z a program that is blocked on I/O, the program will complete the I/O before actually going to sleep. This seems to only have a visible effect for programs outputting a lot of junk to stdout. One additional line will be written to stdout after the ^Z is delivered before the process actually stops. 'ps' output will also show the process not go into an immediate stop state but since the condition has to be flagged it is really easy to adjust ps to report that the process is stopped even though it isn't quite stopped yet. This change saved us a lot of headaches and simplified a number of code paths. Frankly, userret is the ONLY safe place where you can actually stop a process these days. -Matt
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200710092333.l99NX0qZ073285>