From owner-cvs-all@FreeBSD.ORG Fri Mar 4 00:25:36 2005 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B76F816A4CE; Fri, 4 Mar 2005 00:25:36 +0000 (GMT) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by mx1.FreeBSD.org (Postfix) with SMTP id 1374E43D5A; Fri, 4 Mar 2005 00:25:35 +0000 (GMT) (envelope-from iedowse@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 4 Mar 2005 00:25:34 +0000 (GMT) To: David Xu In-Reply-To: Your message of "Fri, 04 Mar 2005 07:23:30 +0800." <42279C72.2000208@freebsd.org> Date: Fri, 04 Mar 2005 00:25:33 +0000 From: Ian Dowse Message-ID: <200503040025.aa49207@salmon.maths.tcd.ie> cc: src-committers@freebsd.org cc: John Baldwin cc: cvs-src@freebsd.org cc: cvs-all@freebsd.org cc: Julian Elischer cc: David Schultz Subject: Re: cvs commit: src/sys/kern kern_sig.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Mar 2005 00:25:37 -0000 In message <42279C72.2000208@freebsd.org>, David Xu writes: >how about adding a PNOSWAP to msleep ? but I won't trust the kernel >under swapping, because they can not give me 100% guarantee, my >machine crashes several times per-month, even when fscking at boot time, >mostly it is a page fault. I haven't been following the discussion very carefully, but it does seem that when we are doing something that is unexpected to a C programmer it is very helpful if there is an clear reminder in the source code at the point where it matters. That would suggest having a flag passed to msleep that enables swapping of the thread while it sleeps rather than one to disable the swapping. It may be that there are relatively few msleep calls that are expected to sleep for long enough to make swapping the thread beneficial. BTW, one very useful technique that is incompatible with stack swapping is the insertion of a marker into a linked list to avoid having to restart a scan if the list changes. See vm_pageout_scan() in vm_pageout.c for an example. There are probably quite a few pieces of code that could use this to avoid a "goto restart;" case. Of course the marker could be malloc'd if necessary so it is not a particularly strong argument. Ian