From owner-freebsd-performance@FreeBSD.ORG Fri Nov 19 01:33:21 2010 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A1891065679 for ; Fri, 19 Nov 2010 01:33:21 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 5C5DA8FC2C; Fri, 19 Nov 2010 01:33:21 +0000 (UTC) Received: from xyf.my.dom (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id oAJ1XJqE089239; Fri, 19 Nov 2010 01:33:20 GMT (envelope-from davidxu@freebsd.org) Message-ID: <4CE64463.3050508@freebsd.org> Date: Fri, 19 Nov 2010 09:33:23 +0000 From: David Xu User-Agent: Thunderbird 2.0.0.24 (X11/20100630) MIME-Version: 1.0 To: Lucius Windschuh References: <4CE50849.106@zedat.fu-berlin.de> <4CE52177.3020306@freebsd.org> <20101118201644.00004c3c@unknown> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Bruce Cran , freebsd-performance@freebsd.org Subject: Re: TTY task group scheduling X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Nov 2010 01:33:21 -0000 Lucius Windschuh wrote: > 2010/11/18 Bruce Cran : >> Have you tried increasing kern.sched.preempt_thresh? According to >> http://groups.google.com/group/mailing.freebsd.stable/browse_thread/thread/05a39f816fd8acc6/82affa9f195b747d?lnk=raot&fwc=1&pli=1 >> a good value for desktop use would be 224. > > Hmm, I though I tried this -- but this helps indeed. :-) > The browser, movie player etc. behave much better when a "make -j4 > buildworld" is running on my 2-core machine in the background. Thank > you. > > 2010/11/18 Bruce Cran : >> If you're using UFS, I've found it to be quite a bottleneck when >> doing parallel IO: I even ran a "svn up" in one terminal and tried to >> login on another a couple of days ago only to find the motd took over 5 >> seconds to appear! That may be excessive since I was running a kernel >> with WITNESS and INVARIANTS, but I've found ZFS to be far better if you >> want good interactivity when reading/writing to disks. > > This is indeed another issue, which I also encountered, but explicitly > left out since I don't blame the task scheduler for that. ;) > > Unfortunately, I don't know how much SCHED_ULE's inability to cope > with more runnable threads than cores, as Steve mentioned, accounts to > the problem I observe. Time to switch back to SCHED_4BSD? *sigh* > > Lucius Sometimes, I am thinking that our thread scheduler should be split into two layers, looks like Solaris did, the sched_ule really should only be responsible for CPU dispatching, it only cares where a thread should be dispatched based on CPU-affinity, each CPU's load, ... Another layer is how to calculate thread's priority for time-sharing thread, you can specify which priority algorithm to used, static or dynamic priority scheduling, ULE's algorithm or 4BSD. with cpuset, one even can bind all real-time processes to a specific cpu group, they needn't to be a superuser to run real-time thread. Regards, David Xu