From owner-cvs-all Tue Jul 30 6:48:42 2002 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 A111837B406 for ; Tue, 30 Jul 2002 06:48:22 -0700 (PDT) Received: from mail.speakeasy.net (mail13.speakeasy.net [216.254.0.213]) by mx1.FreeBSD.org (Postfix) with ESMTP id AFE1943E42 for ; Tue, 30 Jul 2002 06:48:21 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 11505 invoked from network); 30 Jul 2002 13:48:18 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail13.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 30 Jul 2002 13:48:18 -0000 Received: from laptop.baldwin.cx (laptop.baldwin.cx [192.168.0.4]) by server.baldwin.cx (8.12.5/8.12.5) with ESMTP id g6UDmDuR053724; Tue, 30 Jul 2002 09:48:13 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200207300826.g6U8Q9hh055075@silver.carrots.uucp.r.dl.itc.u-tokyo.ac.jp> Date: Tue, 30 Jul 2002 09:48:17 -0400 (EDT) From: John Baldwin To: Seigo Tanimura Subject: Re: cvs commit: src/sys/kern kern_condvar.c kern_switch.c kern_s Cc: cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, Seigo Tanimura , David Xu Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 30-Jul-2002 Seigo Tanimura wrote: > On Tue, 30 Jul 2002 16:12:55 +0800, > David Xu said: > > David> could you look carefully timeout handing function? for example, > David> cv_timedwait_end(), it has same problem with swapping. > > Do you mean, for instance, this fragment? > > [sys/kern/kern_synch.c] > static void > endtsleep(arg) > void *arg; > { > (snip) > if ((td->td_flags & TDF_TIMEOUT) != 0) { > td->td_flags &= ~TDF_TIMEOUT; > setrunqueue(td); /* <- XXX! */ > > Yes, as the state of the thread in question is TDS_SLP, it can be > swapped out. That state is wrong. We are not on a sleep queue. We are about to be woken up again by another CPU (the timeout has to be running on another CPU for this code to be executing) so we should not be swapped out while we are waiting to be resumed. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message