From owner-freebsd-hackers@FreeBSD.ORG Tue Mar 9 08:42:43 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2492A16A4CE; Tue, 9 Mar 2004 08:42:43 -0800 (PST) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id C577D43D3F; Tue, 9 Mar 2004 08:42:42 -0800 (PST) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.10/8.12.10) with ESMTP id i29GfDxC047179; Tue, 9 Mar 2004 11:41:13 -0500 (EST) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i29GfCu3047176; Tue, 9 Mar 2004 11:41:13 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Tue, 9 Mar 2004 11:41:12 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: Bin Ren In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org cc: freebsd-current@freebsd.org Subject: Re: a serious error in sched_ule.c? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Mar 2004 16:42:43 -0000 On 9 Mar 2004, Bin Ren wrote: > Hi, all: > > I've been reading sched_ule.c and seem to find a serious error: > > in 'sched_slice()': > > * Rationale: > * KSEs in interactive ksegs get the minimum slice so that we > * quickly notice if it abuses its advantage. > > Then, there is: > > if (!SCHED_INTERACTIVE(kg)) { > ..... > ..... > } else > ke->ke_slice = SCHED_SLICE_INTERACTIVE; > > Then, at the beginning of the file, there is: > > #define SCHED_SLICE_INTERACTIVE (slice_max) > > > (slice_max) for interactive KSEs???? Either this is a serious mistake or > I'm seriously missing sth here. I believe this is a synchronization error in the comment and the code. The code was changed to provide a maximum slice to interactive applications because non-CPU intensive X11 applications will be marked as interactive, but redraws get interrupted in a short slice. When the change went in to increase the time slice I saw an observable improvement in the redraws of X11 apps under load. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Senior Research Scientist, McAfee Research