From owner-freebsd-arch Tue Feb 19 1:12:54 2002 Delivered-To: freebsd-arch@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id B69A137B400; Tue, 19 Feb 2002 01:12:50 -0800 (PST) Received: (from dillon@localhost) by apollo.backplane.com (8.11.6/8.9.1) id g1J9CnB59744; Tue, 19 Feb 2002 01:12:49 -0800 (PST) (envelope-from dillon) Date: Tue, 19 Feb 2002 01:12:49 -0800 (PST) From: Matthew Dillon Message-Id: <200202190912.g1J9CnB59744@apollo.backplane.com> To: Bruce Evans Cc: Greg Lehey , , Subject: Re: buildworld comparison stable vs current References: <20020219194134.V1374-100000@gamplex.bde.org> Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG :> stable: 2467550 voluntary context switches (buildworld -j 10) :> current: 23879443 voluntary context switches (buildworld -j 10) : :These mostly aren't for interrupts (unless they are for IPIs). I get: : : 393580 voluntary context switches : 355294 involuntary context switches : :for UP on an Athlon1600 (for a makeworld which took 1573 seconds in :-current), i.e., only 1/60 as many voluntary context switches. I think :most of them are for context switches to idle because Giant is held. :The idle process is more of a mistake than I first thought. : :Bruce Ah! Ok, that makes a lot more sense. There is work in progress to patch mutex sleep locks to spin in this situation. My attempt today didn't work out too well but apparently John has some code to do it as well that hasn't been incorporated. I believe it will help the problem but I'm not sure if it will solve it. I think there may be something else going on because the context switch rate goes from 230/sec on an idle box to almost 2000/sec if I am running a single copy of a syscall intensive program, like TG (gettimeofday() loop) or TU (getuid() loop). Not even two processes... just one will do it. A for(;;); loop does not cause any increase. I'm at a loss at the moment. In anycase, it's definitely costly. I don't think the idle process is directly responsible but it could be getting switched to as a side effect of something else. -Matt Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message