From owner-freebsd-mips@FreeBSD.ORG Thu Aug 5 14:25:21 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 913731065676; Thu, 5 Aug 2010 14:25:21 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5CBDF8FC18; Thu, 5 Aug 2010 14:25:19 +0000 (UTC) Received: by wyj26 with SMTP id 26so8301414wyj.13 for ; Thu, 05 Aug 2010 07:25:15 -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=8+g/A+/kjGN56ZFh1+ep5oj2w2vMOngcsxKn9akP3hk=; b=WxtDNDvNES2XkJ231mMLHuh4D1PYD/+WYss5shD3dAAYGMN8U7Ey8ciuurCGGuiDgF nneaNvVGfpNqmg6Qpdo63uqIWD0ezCHyOUwfxzHdhteYqNjPwKlxMydwC1aMbRffr0Km z4z3gCSn9eS73siIKpOjYVMw5Og47/ufn+OtY= 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=o1tXk3rhPFCa1hCg0/hcf74Nld7WWM5E9sWa6UfbJ4ndZ5Cug5xz8VKQQYhOj3OJq6 p9Q2E/H0jBtO7NYcixJp+9g4VYlgs7AqteI1VBjXtfovrbIq9bjFDslUg6Cw7biOo26U f1HNr9ry7/YWA75z2WnNKMcDKja+SkVmKqt9o= MIME-Version: 1.0 Received: by 10.216.62.206 with SMTP id y56mr9393649wec.59.1281018315269; Thu, 05 Aug 2010 07:25:15 -0700 (PDT) Received: by 10.216.160.10 with HTTP; Thu, 5 Aug 2010 07:25:15 -0700 (PDT) In-Reply-To: References: <201008041412.o74ECAix092415@svn.freebsd.org> <4C5A569B.9090401@cs.rice.edu> Date: Thu, 5 Aug 2010 19:55:15 +0530 Message-ID: From: "Jayachandran C." To: Alan Cox Content-Type: multipart/mixed; boundary=000e0ce004aaa1eb91048d145184 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: Thu, 05 Aug 2010 14:25:21 -0000 --000e0ce004aaa1eb91048d145184 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Thu, Aug 5, 2010 at 4:26 PM, Jayachandran C. wrote: > On Thu, Aug 5, 2010 at 11:43 AM, Alan Cox wrote: >> 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 t= his >> because the software dirty bit emulation in trap.c acquires the pmap loc= k. >> =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? This has the above changes, and I have attempted to fix the other issue you had reported on wired mapping count too. There are a few calls for loadandclear() on pte too, with pmap lock held, can this be avoided too? Thanks, JC. --000e0ce004aaa1eb91048d145184 Content-Type: text/x-patch; charset=US-ASCII; name="pmap.diff" Content-Disposition: attachment; filename="pmap.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gchp6r170 SW5kZXg6IHN5cy9taXBzL2luY2x1ZGUvcG1hcC5oCj09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9taXBzL2lu Y2x1ZGUvcG1hcC5oCShyZXZpc2lvbiAyMTA3OTYpCisrKyBzeXMvbWlwcy9pbmNsdWRlL3BtYXAu aAkod29ya2luZyBjb3B5KQpAQCAtMTI0LDcgKzEyNCw2IEBACiAJVEFJTFFfRU5UUlkocHZfZW50 cnkpIHB2X2xpc3Q7CiAJVEFJTFFfRU5UUlkocHZfZW50cnkpIHB2X3BsaXN0OwogCXZtX3BhZ2Vf dCBwdl9wdGVtOwkvKiBWTSBwYWdlIGZvciBwdGUgKi8KLQlib29sZWFuX3QgcHZfd2lyZWQ7CS8q IHdoZXRoZXIgdGhpcyBlbnRyeSBpcyB3aXJlZCAqLwogfSAgICAgICAqcHZfZW50cnlfdDsKIAog CkluZGV4OiBzeXMvbWlwcy9taXBzL3BtYXAuYwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBzeXMvbWlwcy9taXBz L3BtYXAuYwkocmV2aXNpb24gMjEwODQ2KQorKysgc3lzL21pcHMvbWlwcy9wbWFwLmMJKHdvcmtp bmcgY29weSkKQEAgLTE0NzMsNyArMTQ3Myw2IEBACiAJCXB2LT5wdl92YSA9IHZhOwogCQlwdi0+ cHZfcG1hcCA9IHBtYXA7CiAJCXB2LT5wdl9wdGVtID0gbXB0ZTsKLQkJcHYtPnB2X3dpcmVkID0g RkFMU0U7CiAJCVRBSUxRX0lOU0VSVF9UQUlMKCZwbWFwLT5wbV9wdmxpc3QsIHB2LCBwdl9wbGlz dCk7CiAJCVRBSUxRX0lOU0VSVF9UQUlM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