From owner-freebsd-stable@FreeBSD.ORG Fri May 23 16:16:25 2008 Return-Path: Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEF7A106566B for ; Fri, 23 May 2008 16:16:25 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (unknown [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id 088C38FC0C for ; Fri, 23 May 2008 16:16:24 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.1/8.14.1) with ESMTP id m4NGGNcx026612; Fri, 23 May 2008 18:16:23 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.1/8.14.1/Submit) id m4NGGNkK026611; Fri, 23 May 2008 18:16:23 +0200 (CEST) (envelope-from olli) Date: Fri, 23 May 2008 18:16:23 +0200 (CEST) Message-Id: <200805231616.m4NGGNkK026611@lurza.secnetix.de> From: Oliver Fromme To: freebsd-stable@FreeBSD.ORG, unga888@yahoo.com In-Reply-To: <69853.16097.qm@web57006.mail.re3.yahoo.com> X-Newsgroups: list.freebsd-stable User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.2-STABLE-20070808 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Fri, 23 May 2008 18:16:24 +0200 (CEST) Cc: Subject: Re: sched_ule performance on single CPU X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-stable@FreeBSD.ORG, unga888@yahoo.com List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2008 16:16:25 -0000 Unga wrote: > Idle-prio process which generates lot of I/O is > understandable. > > But when you either record or playback audio as > realtime-prio and you opened up a pdf document as > normal-prio, can the pdf rendering in normal-prio > breaks down the realtime audio process? I don't think > pdf rendering is I/O intensive. I think it can. Opening a PDF causes quite a lot of I/O. The viewer application has to be paged in from disk, all the libraries and configuration files it uses, possibly even parts of the X server have to be paged in, depending on what features of the X protocol and which extensions the viewer application uses. And of course the PDF itself has to be loaded (which might be not small), and finally all fonts used by the PDF have to be loaded by the viewer application. On the other hand, the default buffer space of the audio driver is quite small (the reason for that is to reduce latency for sound effects in games). So even a very short I/O congestion can cause an audible hiccup in audio playback or recording. > Using a faster processor or multi-core may solve this > problem, No, faster I/O hardware will solve it, or hardware that better supports concurrent access. It's also quite possible that improvements in FreeBSD's disk system might solve the problem, i.e. by reordering disk access in a more efficient manner, but this is very non-trivial. But all of that is not a matter of the process scheduler. Anotehr solution is to use more aggressive buffering by either the audio application or the audio driver. The latter can be set via sysctl. The former is a matter of your audio application. I use mpg123 for mp3 playback on a 3-year old UP machine. It has a buffer option which I use. E.g. "mpg123 -b5000" will use 5 MB buffer; that's enough for half a minute of audio. I do not use renice, idprio, rtprio or anything, but still audio playback works perfectly fine, even during a buildworld. Or when opening a PDF. No hiccups. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead." -- RFC 1925