From owner-cvs-all Mon Jul 15 12:17: 2 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 64F8237B42B; Mon, 15 Jul 2002 12:16:53 -0700 (PDT) Received: from parmenion.hosting.swbell.net (parmenion.hosting.swbell.net [216.100.98.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 27E6843E64; Mon, 15 Jul 2002 12:16:49 -0700 (PDT) (envelope-from alc@imimic.com) Received: from imimic.com (adsl-216-63-78-17.dsl.hstntx.swbell.net [216.63.78.17]) by parmenion.hosting.swbell.net id PAA12616; Mon, 15 Jul 2002 15:16:46 -0400 (EDT) [ConcentricHost SMTP Relay 1.14] Message-ID: <3D331F9E.3D48367B@imimic.com> Date: Mon, 15 Jul 2002 14:16:46 -0500 From: "Alan L. Cox" Organization: iMimic Networking, Inc. X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.4.2 i386) X-Accept-Language: en MIME-Version: 1.0 To: John Baldwin Cc: Alan Cox , cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Subject: Re: cvs commit: src/sys/alpha/alpha pmap.c src/sys/vm vm_page.c References: Content-Type: text/plain; charset=x-user-defined Content-Transfer-Encoding: 7bit Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG John Baldwin wrote: > > On 14-Jul-2002 Alan Cox wrote: > > alc 2002/07/14 16:51:55 PDT > > > > Modified files: > > sys/alpha/alpha pmap.c > > sys/vm vm_page.c > > Log: > > o Lock page queue accesses by vm_page_wire() that aren't > > within a critical section. > > o Assert that the page queues lock is held in vm_page_wire() > > unless an Alpha. > > Even in a critical section you still need the lock to ensure you > don't read stale data and to prevent others from writing to them > out from under you. Yes, I agree. > If the critical section in question is for pmap_growkernel(), then > I think you can actually remove it anyways. It is. The solution that I have in mind is to introduce a new flag, VM_ALLOC_WIRED, to vm_page_alloc() that requests allocation of a wired page. Thus, the page's wired count can be initialized to 1 before the (spin) mutex on the free queues is released. In addition to addressing this particular problem, VM_ALLOC_WIRED will find general use in replacing code that looks like: m = vm_page_alloc(...); ... vm_page_lock_queues(); vm_page_wire(m); vm_page_unlock_queues(); Regards, Alan P.S. The scattered placement of wired pages in the physical memory is the chief reason why large contigmalloc()s fail on long-running systems. This flag could be used to help address that. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message