From owner-freebsd-mips@FreeBSD.ORG Mon Aug 13 16:37:53 2012 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 E74281065675 for ; Mon, 13 Aug 2012 16:37:53 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 789A38FC15 for ; Mon, 13 Aug 2012 16:37:52 +0000 (UTC) Received: by weyx56 with SMTP id x56so3202865wey.13 for ; Mon, 13 Aug 2012 09:37:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=bJbOYFGyEX2kgjdNz5gIN7rG1deKwGGD4QAE4vWxexc=; b=g1tTu8Y51SmaSq7pc5DSDP2nic4qEXfQMhl42wbmenRDqozuCiZXLfIxFXT8njXzRT 5fqyzgzh4ETOuwfg5J5dpbBjnJQ85vNb69dM0SQxwYEkswppTcBwAWo36ixThyfx48wA Wb/L/l/BonKdliT9A27sOOM8Dugd0PlASh75NsXOJj6QP/1kU/a2YgWWAQvAAUyqis2F bzNpCUsLOMOPVdBGzFX6Cj187abW71avTnvhhkKt86helw82eMfsz9hBZ3H5P23bjxIe Q0XUJs5PYFIJarNdy/xKDFVbgKm+r7qStpDGUYldcSvFsISBqyrn2neQGxR8NDUtOd6a K6SQ== MIME-Version: 1.0 Received: by 10.180.81.133 with SMTP id a5mr19812132wiy.17.1344875872296; Mon, 13 Aug 2012 09:37:52 -0700 (PDT) Received: by 10.216.115.3 with HTTP; Mon, 13 Aug 2012 09:37:52 -0700 (PDT) In-Reply-To: <50269AD4.9050804@rice.edu> References: <50228F5C.1000408@rice.edu> <50269AD4.9050804@rice.edu> Date: Mon, 13 Aug 2012 22:07:52 +0530 Message-ID: From: "Jayachandran C." To: Alan Cox Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: mips@freebsd.org Subject: Re: mips pmap 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: Mon, 13 Aug 2012 16:37:54 -0000 On Sat, Aug 11, 2012 at 11:18 PM, Alan Cox wrote: > > On 08/09/2012 10:36, Jayachandran C. wrote: > > On Wed, Aug 8, 2012 at 9:40 PM, Alan Cox wrote: >> >> Can someone please test this patch? It applies some changes to the mips= pmap that were made a long time ago to the amd64 and i386 pmaps. In parti= cular, it reduces the size of a pv entry. >> >> Briefly, the big picture is that in order to move forward with further l= ocking refinements to the VM system's machine-independent layer, I need to = eliminate all uses of the page queues lock from every pmap. In order to re= move the page queues lock from the mips pmap, I need to port the new pv ent= ry allocator from the amd64 and i386 pmaps. This patch is preparation for = that. > > > Tested the patch on XLP for about an hour ('make -j 64 buildworld' on 32 = cpu mips64) and did not see any issues. > > > Thank you for the quick response. I am attaching the next patch for test= ing. > > This patch does two things: > > 1. It ports the new PV entry allocator from x86. This new allocator has = two virtues. First, it doesn't use the page queues lock. Second, it shrin= ks the size of a PV entry by almost half. > > 2. I observed and fixed a rather serious bug in pmap_remove_write(). Aft= er removing write access from the physical page's first mapping, pmap_remov= e_write() then used the wrong "next" pointer. So, the page's second, third= , etc. mapping would not be write protected. Instead, some arbitrary mappi= ng for a completely different page would be write protected, likely leading= to spurious page faults later to reestablish write access to that mapping. > > This patch needs testing in both 32 bit and 64 bit kernels. Ran the compile test on 32 and 64 bit kernels, and did not see any issue. I could not test for more than an hour on 32-bit due to another problem (freelist 1 containing direct-mapped pages runs out of pages after about an hour of compile test). This issue has been there for a long time, I am planning to look at it when I get a chance. JC.