From owner-cvs-all Mon Jan 15 13:54:50 2001 Delivered-To: cvs-all@freebsd.org Received: from meow.osd.bsdi.com (meow.osd.bsdi.com [204.216.28.88]) by hub.freebsd.org (Postfix) with ESMTP id 2945637B404; Mon, 15 Jan 2001 13:54:30 -0800 (PST) Received: from laptop.baldwin.cx (john@jhb-laptop.osd.bsdi.com [204.216.28.241]) by meow.osd.bsdi.com (8.11.1/8.9.3) with ESMTP id f0FLoJ194176; Mon, 15 Jan 2001 13:50:19 -0800 (PST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200101152138.f0FLcLs61722@aslan.scsiguy.com> Date: Mon, 15 Jan 2001 13:51:52 -0800 (PST) From: John Baldwin To: "Justin T. Gibbs" Subject: Re: cvs commit: src/sys/i386/conf GENERIC Cc: Peter Wemm Cc: Peter Wemm , Poul-Henning Kamp , Wilko Bulte , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org, Bruce Evans Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 15-Jan-01 Justin T. Gibbs wrote: >>> All that is required in the userland implementation is the setting of a >>> flag so the userland thread scheduler does not perform a thread switch. >>> Having an interrupt fire does not have the same consequences on a userland >>> program as it does for the kernel. >> >>Actually, the process needs to not be switched. This is part of KSE, so you >>would have to set a kernel flag in the kse for this, but yes, that would >>work. >> >>Granted, it pessimizes the non-i386 case, but not that badly. The kernel >>trap >>to emulate only pessimizes the i386 case (though the 386 could do without >>extr >>a pessimizations, and it is a bigger pessimization.) > > I suppose I haven't read enough of the KSE stuff to understand why > you need to not change processes (or is a process the "unit" used > to represent a KSE?). Doesn't the userland scheduler decide what > to do with any KSE it is given? KSE doesn't have a userland scheduler. It's all in the kernel. But yes, you are right, it is just the KSE, and not the process switch that needs to be prevented. > Anyway, if you use the "patch up the atomic operation" approach, you > don't pessimize anyone except on the first run through a particular > atomic operation. Actually, the easiest way I can think of to do this would be to have an internal cmpset() function: int cmpset(dst, exp, src) { if (on_a_386) { set_no_switch_flag; if (*dst == exp) { *dst = src; return 1; } else return 0; } else return atomic_cmpset(dst, exp, src); } Then change ast() in the kernel to check the per-KSE flag. > -- > Justin -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "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