From owner-freebsd-mips@FreeBSD.ORG Fri Aug 6 10:29:11 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 8F737106564A; Fri, 6 Aug 2010 10:29:11 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id E9B3A8FC19; Fri, 6 Aug 2010 10:29:10 +0000 (UTC) Received: by wwa36 with SMTP id 36so7764582wwa.31 for ; Fri, 06 Aug 2010 03:29:09 -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; bh=fxgcANPul4B8OBGNmU+uvJxRe8qg4WahEutT4MTLm20=; b=HD8k4LgNcDaO6E2/cRlWhYT18i0wXTfi7xoU/jGNF9mo5k2mEG/NDg6mncna0q/I8f suyjTn3LF1RiidpHhHormOjIsTNohhKWB+A2310ft5iTlVL+CyzEBntqYw4Dgan0hd+K 02ZLla7ankQ+x2y08VPxpSsff1QArk+3y5OtE= 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; b=ZTCtDEmJCrQA1EyoP/HO2iWXMvm+dbZQ1DoEzMJHDswXDGf+fPKJl/sYke9y2tk3Ek DTuBPUcy0U403k2fpW5BU7Q5ZMWm8cV4AAmdfOYQITH2/oIuWIOf1d7jrrQ/ZDwhr1Jm egZavw92lL0XlTKo8I9H9hR7U7bD7Q3rHP2vs= MIME-Version: 1.0 Received: by 10.216.155.206 with SMTP id j56mr2866183wek.67.1281090549833; Fri, 06 Aug 2010 03:29:09 -0700 (PDT) Received: by 10.216.160.10 with HTTP; Fri, 6 Aug 2010 03:29:09 -0700 (PDT) In-Reply-To: <4C5BA088.7060105@cs.rice.edu> References: <201008041412.o74ECAix092415@svn.freebsd.org> <4C5A569B.9090401@cs.rice.edu> <4C5BA088.7060105@cs.rice.edu> Date: Fri, 6 Aug 2010 15:59:09 +0530 Message-ID: From: "Jayachandran C." To: Alan Cox Content-Type: multipart/mixed; boundary=0016363ba3e225e292048d2523fa Cc: "Jayachandran C." , mips@freebsd.org Subject: Re: svn commit: r210846 - in head/sys/mips: include mips 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: Fri, 06 Aug 2010 10:29:11 -0000 --0016363ba3e225e292048d2523fa Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Fri, Aug 6, 2010 at 11:11 AM, Alan Cox wrote: > On 08/05/2010 09:25, Jayachandran C. wrote: >> >> On Thu, Aug 5, 2010 at 4:26 PM, Jayachandran C. >> =A0wrote: >> >>> >>> On Thu, Aug 5, 2010 at 11:43 AM, Alan Cox =A0wrote: >>> >>>> >>>> Just an observation ... >>>> >>>> Jayachandran C. wrote: >>>> >>>>> >>>>> Author: jchandra >>>>> Date: Wed Aug =A04 14:12:09 2010 >>>>> New Revision: 210846 >>>>> URL: http://svn.freebsd.org/changeset/base/210846 >>>>> >>>>> Log: >>>>> =A0Add 3 level page tables for MIPS in n64. >>>>> =A0 =A0- 32 bit compilation will still use old 2 level page tables >>>>> =A0- re-arrange pmap code so that adding another level is easier >>>>> =A0- pmap code for 3 level page tables for n64 >>>>> =A0- update TLB handler to traverse 3 levels in n64 >>>>> =A0 =A0Reviewed by: =A0 =A0 =A0 =A0jmallett >>>>> >>>> >>>> MIPS doesn't really need to use atomic_cmpset_int() in situations like >>>> this >>>> because the software dirty bit emulation in trap.c acquires the pmap >>>> lock. >>>> =A0Atomics like this appear to be a carryover from i386 where the >>>> hardware-managed TLB might concurrently set the modified bit. >>>> >>> >>> Then I guess we should be able to use *pte directly, without pbits, >>> obits and the retry loop. >>> Will try this change... >>> >> >> Can you have a look at the attached patch and see if it is okay? =A0This >> has the above changes, and I have attempted to fix the other issue you >> had reported on wired mapping count too. >> > > The patch looks good. > >> There are a few calls for loadandclear() on pte too, with pmap lock >> held, can this be avoided too? >> > > I haven't looked at them, but almost certainly yes. The calls are in pmap_remove_pte(), pmap_remove_all() and get_pv_entry(). the attached patch changes it normal pointer operations. Thought I would post it for review before checking in... Thanks, JC. --0016363ba3e225e292048d2523fa Content-Type: text/x-patch; charset=US-ASCII; name="loadandclear.patch" Content-Disposition: attachment; filename="loadandclear.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gcivyj9w0 SW5kZXg6IHN5cy9taXBzL21pcHMvcG1hcC5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9taXBzL21pcHMv cG1hcC5jCShyZXZpc2lvbiAyMTA5MjIpCisrKyBzeXMvbWlwcy9taXBzL3BtYXAuYwkod29ya2lu ZyBjb3B5KQpAQCAtMTM1Miw5ICsxMzUyLDExIEBACiAJCQlwbWFwLT5wbV9zdGF0cy5yZXNpZGVu dF9jb3VudC0tOwogCQkJcHRlID0gcG1hcF9wdGUocG1hcCwgdmEpOwogCQkJS0FTU0VSVChwdGUg IT0gTlVMTCwgKCJwdGUiKSk7Ci0JCQlvbGRwdGUgPSBsb2FkYW5kY2xlYXIoKHVfaW50ICopcHRl KTsKKwkJCW9sZHB0ZSA9ICpwdGU7CiAJCQlpZiAoaXNfa2VybmVsX3BtYXAocG1hcCkpCiAJCQkJ KnB0ZSA9IFBURV9HOworCQkJZWxzZQorCQkJCSpwdGUgPSAwOwogCQkJS0FTU0VSVCghcHRlX3Rl c3QoJm9sZHB0ZSwgUFRFX1cpLAogCQkJICAgICgid2lyZWQgcHRlIGZvciB1bndpcmVkIHBhZ2Ui K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