Date: Thu, 5 Aug 2010 19:55:15 +0530 From: "Jayachandran C." <c.jayachandran@gmail.com> To: Alan Cox <alc@cs.rice.edu> Cc: "Jayachandran C." <jchandra@freebsd.org>, mips@freebsd.org Subject: Re: svn commit: r210846 - in head/sys/mips: include mips Message-ID: <AANLkTi=vkG-cntJYYEdhO4AzOO91LB6n%2B45dUSxCMTp3@mail.gmail.com> In-Reply-To: <AANLkTinP7eMNm4yp6T2TTteSvthdgLJOj-ihHrQJ4T49@mail.gmail.com> References: <201008041412.o74ECAix092415@svn.freebsd.org> <4C5A569B.9090401@cs.rice.edu> <AANLkTinP7eMNm4yp6T2TTteSvthdgLJOj-ihHrQJ4T49@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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. <c.jayachandran@gmail.com> wrote: > On Thu, Aug 5, 2010 at 11:43 AM, Alan Cox <alc@cs.rice.edu> 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 RkFMU0U7CiAJCVRBSUxRX0lOU0VS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oY291bnQpOwogfQo= --000e0ce004aaa1eb91048d145184--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTi=vkG-cntJYYEdhO4AzOO91LB6n%2B45dUSxCMTp3>