From owner-freebsd-current@FreeBSD.ORG Thu Nov 3 20:28:57 2011 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 4D0F5106566B for ; Thu, 3 Nov 2011 20:28:57 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1E2308FC20 for ; Thu, 3 Nov 2011 20:28:56 +0000 (UTC) Received: by iabz21 with SMTP id z21so2821157iab.13 for ; Thu, 03 Nov 2011 13:28:56 -0700 (PDT) Received: by 10.42.149.71 with SMTP id u7mr10709407icv.37.1320351700465; Thu, 03 Nov 2011 13:21:40 -0700 (PDT) Received: from [72.253.42.56] ([72.253.42.56]) by mx.google.com with ESMTPS id z10sm12267293ibv.9.2011.11.03.13.21.37 (version=SSLv3 cipher=OTHER); Thu, 03 Nov 2011 13:21:39 -0700 (PDT) Date: Thu, 3 Nov 2011 10:21:48 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Ivan Klymenko In-Reply-To: <4ea29f2c.a823440a.4aa0.3599SMTPIN_ADDED@mx.google.com> Message-ID: References: <4ea29f2c.a823440a.4aa0.3599SMTPIN_ADDED@mx.google.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-current@freebsd.org Subject: Re: Increase the degree of interactivity ULE scheduler 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: Thu, 03 Nov 2011 20:28:57 -0000 On Sat, 22 Oct 2011, Ivan Klymenko wrote: > Hello people! > > I have: > CPU: Intel(R) Core(TM)2 Duo CPU T7250 @ 2.00GHz (1994.48-MHz K8-class CPU) > FreeBSD 10.0-CURRENT r226607 amd64 > > For example during the building of the port lang/gcc46 in four streams (-j 4) with a heavy load on the processor - use the system was nearly impossible - responsiveness was terrible - the mouse cursor sometimes froze on the spot a few seconds... Am I right in understanding that you have only two cores? What else is running that achieves poor interactivity? What is the cpu utilization of your x server at this time? > > I managed to achieve a significant increase in the degree of interactivity ULE scheduler due to the following changes: This patch probably breaks nice, adaptive idling, and slows the interactivity computation. That being said I'm not sure why it helps you. It seems that there are increasing reports of bad interactivity creeping in to ULE over the last year. If people can help provide me with data I can look into this more. Thanks for your report. Jeff > ########################## > --- sched_ule.c.orig 2011-10-22 11:40:30.000000000 +0300 > +++ sched_ule.c 2011-10-22 12:25:05.000000000 +0300 > @@ -2119,6 +2119,14 @@ > > THREAD_LOCK_ASSERT(td, MA_OWNED); > tdq = TDQ_SELF(); > + if (td->td_pri_class & PRI_FIFO_BIT) > + return; > + ts = td->td_sched; > + /* > + * We used up one time slice. > + */ > + if (--ts->ts_slice > 0) > + return; > #ifdef SMP > /* > * We run the long term load balancer infrequently on the first cpu. > @@ -2144,9 +2152,6 @@ > if (TAILQ_EMPTY(&tdq->tdq_timeshare.rq_queues[tdq->tdq_ridx])) > tdq->tdq_ridx = tdq->tdq_idx; > } > - ts = td->td_sched; > - if (td->td_pri_class & PRI_FIFO_BIT) > - return; > if (PRI_BASE(td->td_pri_class) == PRI_TIMESHARE) { > /* > * We used a tick; charge it to the thread so > @@ -2157,11 +2162,6 @@ > sched_priority(td); > } > /* > - * We used up one time slice. > - */ > - if (--ts->ts_slice > 0) > - return; > - /* > * We're out of time, force a requeue at userret(). > */ > ts->ts_slice = sched_slice; > ########################## > > What do you think about this? > > Thanks!