From owner-freebsd-current Thu Feb 4 19:09:51 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA13240 for freebsd-current-outgoing; Thu, 4 Feb 1999 19:09:51 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from iquest3.iquest.net (iquest3.iquest.net [209.43.20.203]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id TAA13233 for ; Thu, 4 Feb 1999 19:09:50 -0800 (PST) (envelope-from toor@y.dyson.net) Received: (qmail 2980 invoked from network); 5 Feb 1999 03:09:46 -0000 Received: from dyson.iquest.net (HELO y.dyson.net) (198.70.144.127) by iquest3.iquest.net with SMTP; 5 Feb 1999 03:09:46 -0000 Received: (from root@localhost) by y.dyson.net (8.9.1/8.9.1) id WAA00824; Thu, 4 Feb 1999 22:09:36 -0500 (EST) Message-Id: <199902050309.WAA00824@y.dyson.net> Subject: Re: more about yield() versus sched_yield() In-Reply-To: <19990131094029.D29670@tar.com> from "Richard Seaman, Jr." at "Jan 31, 99 09:40:29 am" To: dick@tar.com (Richard Seaman, Jr.) Date: Thu, 4 Feb 1999 22:09:36 -0500 (EST) Cc: dufault@hda.com, jb@cimlogic.com.au, current@FreeBSD.ORG, bde@zeta.org.au From: "John S. Dyson" Reply-To: dyson@iquest.net X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Richard Seaman, Jr. said: > > As I indicated to you several weeks ago, I think it is possible to have > a priority inversion problem in spinlocks that spin on sched_yield. > The yield call, as implemented, partly addresses the issue. However, > as you commented to me, it does so poorly. > > If the consensus is to drop or modify SYS_yield, my vote would be to > give consideration to changing the call to more correctly address the > priority inversion issue. Possibly a yield (pid_t pid) where the > pid passed in is the pid of the thread (process) holding a lock. The > system could then check the credentials of the pid to see if there > is permission (eg. its a kernel thread of the same process) and if > so, raise the priority of pid to that of the calling process for one > time slice so pid has a chance to execute and free the lock. > I didn't add the system call to the library (yet), because wasn't sure if it was working the way that I wanted. I do suggest that there be only one (yield) type system call, and if special behavior is desired, then give an argument describing the special behavior. I suggest that the yield that is kept should be the one where there is a current maintainer for it :-). -- John | Never try to teach a pig to sing, dyson@iquest.net | it makes one look stupid jdyson@nc.com | and it irritates the pig. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message