From owner-freebsd-current@FreeBSD.ORG Mon Mar 1 21:15:57 2010 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B33051065745; Mon, 1 Mar 2010 21:15:57 +0000 (UTC) (envelope-from rrs@lakerest.net) Received: from lakerest.net (unknown [IPv6:2001:240:585:2:213:d4ff:fef3:2d8d]) by mx1.freebsd.org (Postfix) with ESMTP id 626048FC08; Mon, 1 Mar 2010 21:15:57 +0000 (UTC) Received: from [10.1.1.53] ([10.1.1.53]) (authenticated bits=0) by lakerest.net (8.14.3/8.14.3) with ESMTP id o21LFuj6074225 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 1 Mar 2010 16:15:56 -0500 (EST) (envelope-from rrs@lakerest.net) Message-Id: From: Randall Stewart To: Jeff Roberson , kib@FreeBSD.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Date: Mon, 1 Mar 2010 13:15:56 -0800 X-Mailer: Apple Mail (2.936) Cc: FreeBSD Current Subject: Patch to make ksched work right.. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2010 21:15:57 -0000 Jeff/Kib: I have made a small patch to make it so you can properly use the sched_getparam and sched_setscheduler() have them work properly for time-share classes. There were comments in the code about rejecting the idea of using it, but that is really not a good idea IMO since you need to be able to use a common posix method for this... at least to be somewhat compatible. Note that sched_getparam() right now returns garbage for a time share class... ;-o The patch is at: http://www.freebsd.org/~rrs/ksched_patch.txt For when a Time Share class is moved up to real-time I just return the posix max priority for it... now that leads me to... The one question I have, has I have dug through looking at the scheduler to figure this all out is: why does a TimeShare class process get a Real Time priority when its being good...i.e. sleeping a lot etc. It seems to me you would want to have true realtime processes be real time and be ahead of all timeshare not equal sharing with realtime i.e. they would time share with a priority between 223-160... Is there some reason that this works this way that I can't puzzle out with my quick review of the sched_ule code? For some of the things I am planning at my day job I really need to have T-S processes be separate from the real time unless you know of some pitfall there?? If you have no objections I will commit this.. Thanks R ------------------------------ Randall Stewart 803-317-4952 (cell) 803-345-0391(direct)