From owner-freebsd-mips@FreeBSD.ORG Thu Jun 3 06:28:43 2010 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8BBB1065692 for ; Thu, 3 Jun 2010 06:28:43 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-px0-f182.google.com (mail-px0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id BCD198FC28 for ; Thu, 3 Jun 2010 06:28:43 +0000 (UTC) Received: by pxi7 with SMTP id 7so3636156pxi.13 for ; Wed, 02 Jun 2010 23:28:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=+uxwLRjXuL6kMQYDYtJfllxiSRbYzTx638gc8vPOeNQ=; b=lveEpl+1XDdkap57SDqeecSOei32WVIW0Ic6yRRU4hjANKxEAq2ghh7rfNJDc//CG6 40uC2gc81h/0bD4xBNLeEtLdoQeUdKORxUd/+o/PlvEmYHj3F0fg+0uCLevOdL0qw08N 7cgsuLw/BNCW+RnJ2vyja6qr6kF+ANqqWCD4I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=ubXlPLOE/Wmbglc9ZvUTd/mApOJ/yuCXWYwpMNe29RNrjB5MyL96t8jx057zmZKV23 FMlsoG8Tp+xI+MS8Typ6krRwu9rsZOdMm6yp6iorZYq+y1CidYj6hSBvi5HDQETtzirp O/Sl37PB/yJzIpjY9l3VNd5PlHpm7T0jCwa3U= MIME-Version: 1.0 Received: by 10.141.124.5 with SMTP id b5mr7756228rvn.68.1275546523363; Wed, 02 Jun 2010 23:28:43 -0700 (PDT) Received: by 10.141.4.3 with HTTP; Wed, 2 Jun 2010 23:28:43 -0700 (PDT) In-Reply-To: <4C0736A5.1010101@imimic.com> References: <4C0736A5.1010101@imimic.com> Date: Thu, 3 Jun 2010 11:58:43 +0530 Message-ID: From: "C. Jayachandran" To: Alan Cox Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Alan Cox , mips@freebsd.org Subject: Re: init_pte_prot() patch X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2010 06:28:44 -0000 On Thu, Jun 3, 2010 at 10:29 AM, Alan Cox wrote: > I would appreciate it if someone would test the attached patch. =A0(A > "buildworld" would probably suffice.) =A0Essentially, it does two things: > > 1. The virtual memory system only cares about the contents of a page's di= rty > field if that page is managed (i.e., it is pageable). =A0And, in fact, if= you > survey the calls to vm_page_dirty() in the MIPS or any other pmap, they a= re > generally conditioned on the mapping having been for a managed page. > > The MIPS pmap_enter() is an exception to this rule. =A0It is unconditiona= lly > calling vm_page_dirty() on any page mapped within the kernel address spac= e, > managed or otherwise. =A0In fact, it is highly unusual for pmap_enter() t= o be > calling vm_page_dirty() on the page being mapped, regardless of whether i= t > is managed. =A0This call to vm_page_dirty() shouldn't be needed if change= #2 > below is also made. =A0The attached patch eliminates the call. > > 2. Since the virtual memory system only cares about the contents of a pag= e's > dirty field if that page is managed, then dirty bit emulation need only b= e > performed on managed pages. =A0At present, init_pte_prot() skips emulatio= n if > the address being mapped is in the kernel. =A0However, this is not really= the > right condition to test for. =A0There do exist some managed pages in the > kernel address space, and it is also possible through System V shared mem= ory > to have unmanaged pages in the user address space. =A0The attached patch = bases > the emulation decision on whether the page is managed. I have added this patch to my buildworld test (make -j128 buildworld on a 8-core MIPS SoC) and it seems to be holding up. It will take a few hours to run over NFS - will update if I get anything. JC.