From owner-freebsd-current@FreeBSD.ORG Sat Oct 9 04:54:47 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DAD1816A4CE for ; Sat, 9 Oct 2004 04:54:47 +0000 (GMT) Received: from pimout3-ext.prodigy.net (pimout3-ext.prodigy.net [207.115.63.102]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7832443D45 for ; Sat, 9 Oct 2004 04:54:47 +0000 (GMT) (envelope-from julian@elischer.org) Received: from elischer.org (adsl-67-124-50-20.dsl.snfc21.pacbell.net [67.124.50.20])i994sZSX010536; Sat, 9 Oct 2004 00:54:37 -0400 Message-ID: <41676F0B.40200@elischer.org> Date: Fri, 08 Oct 2004 21:54:35 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4b) Gecko/20030524 X-Accept-Language: en, hu MIME-Version: 1.0 To: Sam Lawrance References: <4164BFA4.80105@unisa.edu.au> <41657D63.1050605@FreeBSD.org> <1097290576.836.20.camel@dirk.no.domain> In-Reply-To: <1097290576.836.20.camel@dirk.no.domain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: Benjamin Close cc: freebsd-current@freebsd.org cc: Scott Long Subject: Re: Noticable Delays Since Beta 3 (possible cause) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Sat, 09 Oct 2004 04:54:48 -0000 Sam Lawrance wrote: > On Thu, 2004-10-07 at 11:31 -0600, Scott Long wrote: > >>Doug White wrote: >> >>>On Thu, 7 Oct 2004, Benjamin Close wrote: >>> >>> >>> >>>> I've been using each Beta Release as they come out and ever since >>>>Beta 3 I've noticed delays where there never used to be any. >>>>I believe this may be somehow related to ULE->BSD scheduler change. A >>>>classic situation of where they now exist is when I switch virtual >>>>desktops back to another xterm. It takes 4-5 seconds before I can type. >>>>The machine is virtually 100% idle. Before beta3 this was not a problem >>>>with almost an instant response. >>> >>> >>>Can you provide a reproduction case? I don't notice any sort of delay when >>>switching between text vtys, or changing keyboard focus in X. I've been >>>using 4BSD the entire time. >>> >>>Are you switching between X and text vty's? There's always been a delay >>>there, worse on my amd64 box than i386, but I don't do that regularly; >>>much easier to just pop another xterm :) >>> > > > I think I've found the cause of the delays. > > The problem was consistently reproducible with getty processes which are > swapped out (ie 'ps' shows RSS=0 and state=IWs+). > > Since the problem was identifiable when starting to type at a vty, I > traced the problem back through: > > ttyinput() : tty.c > ttwakeup() : tty.c > wakeup() : kern_synch.c > sleepq_broadcast() : subr_sleepq.c > sleepq_resume_thread() : subr_sleepq.c > setrunnable() : kern_synch.c > > Notice in setrunnable() how wakeup(&proc0) is wrapped by #ifndef SMP? > This means that scheduler() : vm/vm_glue.c, which tsleeps on proc0, is > not awoken to traverse the process list and swap the process in. > > scheduler() tsleeps for a maximum of maxslp * hz / 2. maxslp on all > archs appears to be 20, so the actual wakeup intended by ttwakeup() may > not occur for up to 10 seconds. there used to be another place that started bringing in the pages.. I think someone removed it.. (I'm just going on memories..) > > > > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"