From owner-cvs-all@FreeBSD.ORG Sun Nov 9 23:14:24 2003 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 42B3616A4CE; Sun, 9 Nov 2003 23:14:24 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id DD90443FE5; Sun, 9 Nov 2003 23:14:21 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id SAA12549; Mon, 10 Nov 2003 18:14:16 +1100 Date: Mon, 10 Nov 2003 18:14:14 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: John Baldwin In-Reply-To: Message-ID: <20031110180540.P2148@gamplex.bde.org> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org cc: Seigo Tanimura Subject: RE: cvs commit: src/sys/cam/scsi scsi_target.c src/sys/codacoda_psdev.csrc/sys/dev/firewire firewire.c src/sys/dev/kbd kbd.c src/sys/dev/nmdm nmdm. 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: Mon, 10 Nov 2003 07:14:24 -0000 On Sun, 9 Nov 2003, John Baldwin wrote: > On 09-Nov-2003 Seigo Tanimura wrote: > > tanimura 2003/11/09 01:17:26 PST > > > > FreeBSD src repository > > > > Modified files: > > sys/cam/scsi scsi_target.c > > sys/coda coda_psdev.c > > ... > > Log: > > - Implement selwakeuppri() which allows raising the priority of a > > thread being waken up. The thread waken up can run at a priority as > > high as after tsleep(). > > > > - Replace selwakeup()s with selwakeuppri()s and pass appropriate > > priorities. > > > > - Add cv_broadcastpri() which raises the priority of the broadcast > > threads. Used by selwakeuppri() if collision occurs. > > > > Not objected in: -arch, -current > > Sorry I didn't speak up on arch@, just too busy. But, why do you need > to bump up the priority of the thread you are waking up? I left the reply to someone else :-). The priority may need to be bumped because the thread is a user thread that is sleeping at a low user priority. As I understand this change, the thread priority may be low for cases that don't use tsleep() so they can't set the thread priority using that. So this changes is needed to get the same behaviour as using tsleep(). However, I think that behaviour is not quite right -- if the thread is a user thread then it waking it up is only urgent if it needs to do some urgent things in kernel mode on wakeup. It should not return to user mode until its user priority permits its scheduling. However2, we still have the bugfeature that user threads keep the kernel priority that they wake up at all the way back to user mode, and this may be necessary for interactivity. Bruce