From owner-freebsd-hackers Tue Jul 25 10:56:16 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from hq.fsmlabs.com (hq.fsmlabs.com [209.155.42.197]) by hub.freebsd.org (Postfix) with ESMTP id 8CD3F37B7AA for ; Tue, 25 Jul 2000 10:56:09 -0700 (PDT) (envelope-from cort@medea.fsmlabs.com) Received: from medea.fsmlabs.com (medea.fsmlabs.com [209.155.42.137]) by hq.fsmlabs.com (8.9.3/8.9.3) with ESMTP id LAA02576; Tue, 25 Jul 2000 11:55:37 -0600 Received: (from cort@localhost) by medea.fsmlabs.com (8.9.3/8.9.3) id LAA24619; Tue, 25 Jul 2000 11:48:00 -0600 Date: Tue, 25 Jul 2000 11:48:00 -0600 From: cort@fsmlabs.com To: Lars Eggert Cc: Matt Dillon , Alan Cox , hackers@FreeBSD.ORG Subject: Re: clearing pages in the idle loop Message-ID: <20000725114800.M15614@medea.fsmlabs.com> References: <20000719234124.H14543@cs.rice.edu> <39788E48.60F8A59F@isi.edu> <200007211906.MAA19989@earth.backplane.com> <3978A802.E05CC45@isi.edu> <200007221739.KAA31376@earth.backplane.com> <397C8A42.BF52CC4D@isi.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1us In-Reply-To: <397C8A42.BF52CC4D@isi.edu>; from larse@ISI.EDU on Mon, Jul 24, 2000 at 11:26:10AM -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Right, that was the plan with that code. In fact, I saw some improvement in performance when turning the caches off when in the idle task no matter what we were doing in it. It seems that it kept us out of the cache so we didn't evict the working-set of block processes. } The way Cort implemented it in Linux was so that there's a check for new } processes in the loop that clears a page. This is of course slowing it, but } since it's idle time processing, reduction of latency to start a new } process (and being transparent to foreground processing in general) is much } more important than optimized execution. } } This is also why turning off L1 and L2 caches may be interesting - if one } process blocks, you do some idle time processing and it unblocks, the L1 } and L2 cache may be polluted by the idle time processing, slowing things } down for the foreground process. I play with that idea, having a task with the priority set just higher than the idle loop. It let us keep the idle loop unpolluted and allowed it to actually be nothing more than an idle loop. It was nice to be able to dynamically assign priority to PPC hash table clearing, page clearing and any other wacky idea I came up with depending on the load and need of the running system. } > Another alternative is to have an idle process rather then try to do } > things in the idle loop. This has the advantage of being instantly } > interruptable if a 'real' process becomes runnable, but the disadvantage } > of having to do a context switch (albeit a relatively cheap one). } } That would probably be the cleanest solution. Maybe the idprio mechanism } could be extended to cover this. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message