From owner-freebsd-hackers Thu Oct 26 0:11:19 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from earth.backplane.com (placeholder-dcat-1076843399.broadbandoffice.net [64.47.83.135]) by hub.freebsd.org (Postfix) with ESMTP id E04E537B479; Thu, 26 Oct 2000 00:11:16 -0700 (PDT) Received: (from dillon@localhost) by earth.backplane.com (8.11.0/8.9.3) id e9Q7B6q32884; Thu, 26 Oct 2000 00:11:06 -0700 (PDT) (envelope-from dillon) Date: Thu, 26 Oct 2000 00:11:06 -0700 (PDT) From: Matt Dillon Message-Id: <200010260711.e9Q7B6q32884@earth.backplane.com> To: Anton Berezin Cc: Alfred Perlstein , ps@FreeBSD.ORG, hackers@FreeBSD.ORG Subject: Re: vm_pageout_scan badness References: <20001024112708.E28123@fw.wintelcom.net> <200010242010.e9OKAJK19739@earth.backplane.com> <20001025123154.A56298@heechee.tobez.org> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG :On Tue, Oct 24, 2000 at 01:10:19PM -0700, Matt Dillon wrote: :> Ouch. The original VM code assumed that pages would not often be :> ripped out from under the pageadaemon, so it felt free to restart :> whenever. I think you are absolutely correct in regards to the :> clustering code causing nearby-page ripouts. :> :> I don't have much time available, but let me take a crack at the :> problem tonight. : :While you are at it, would you care and have a look at PR19672. It :seems to be at least remotely relevant. ;-) Hmmm. Blech. contigmalloc is aweful. I'm not even sure if what it is doing is legal! If it can't find contiguous space it tries to flush the entire inactive and active queues. Every single page! not to mention the insane restarting. The algorithm is O(N^2) on an idle machine, and even worse on machines that might be doing something. There is no easy fix. contigmalloc would have to be completely rewritten. We could use the placemarker idea to make the loop 'retry' the page that blocked rather then restart at the beginning, but the fact that contigmalloc tries to flush the entire page queue means that it could very trivially get stuck on dead devices (e.g. like a dead NFS mount). Also, if we don't restart, there is less of a chance that contigmalloc can find sufficient free space. When it frees pages it does so half-hazzardly, and when it flushes pages out it makes no attempt to free them so an active process may reuse the page instantly. Bleh. I'm afraid I don't have the time to rewrite contigmalloc myself, but my brain is available to answer questions if someone else wants to have a go at it. -Matt :Cheers, :%Anton. :-- : and would be a nice addition :to HTML specification. : To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message