Date: Wed, 11 Aug 2010 10:36:52 +0530 From: "Jayachandran C." <c.jayachandran@gmail.com> To: Alan Cox <alc@cs.rice.edu>, mips@freebsd.org Cc: "Jayachandran C." <jchandra@freebsd.org> Subject: Re: svn commit: r210846 - in head/sys/mips: include mips Message-ID: <AANLkTi=FowMNMy87aA2K=120a4L_Fd5GPDH%2BdEPKOsek@mail.gmail.com> In-Reply-To: <4C5C3A08.500@cs.rice.edu> References: <201008041412.o74ECAix092415@svn.freebsd.org> <4C5A569B.9090401@cs.rice.edu> <AANLkTinP7eMNm4yp6T2TTteSvthdgLJOj-ihHrQJ4T49@mail.gmail.com> <AANLkTi=vkG-cntJYYEdhO4AzOO91LB6n%2B45dUSxCMTp3@mail.gmail.com> <4C5BA088.7060105@cs.rice.edu> <AANLkTinxAkRTK8pLRkQ7JwesNkuwmuiRevOZMDpj_aj7@mail.gmail.com> <4C5C3A08.500@cs.rice.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
--0016e64c1dc2cb8ec2048d853700 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Fri, Aug 6, 2010 at 10:06 PM, Alan Cox <alc@cs.rice.edu> wrote: > The patch looks good. > > While we're talking about software dirty bit emulation, I would encourage > you to look at two things: > > 1. trap.c contains two copies of the same code for emulation. =A0I would > encourage you to eliminate this duplication by creating a > pmap_emulate_modified(). > > 2. Software dirty bit emulation is using pmap_update_page() to invalidate > the TLB entry on which the modified bit is being set. =A0On a multiproces= sor, > this is going to make dirty bit emulation very costly because every > processor will be interrupted. =A0In principle, it should be possible and > faster to only flush the TLB entry from the current processor. =A0The oth= er > processors can handle this lazily. =A0They either do not have that mappin= g in > their TLB, in which case interrupting them was wasted effort, or they do > have it in their TLB and when they fault on it they'll discover the dirty > bit is already set. =A0In fact, the emulation code already handles this c= ase, > on account of the fact that two processors could simultaneously write to = the > same clean page and only one will get the pmap lock first. I've made the changes suggested, the changes are attached. The first set of changes just re-arranges the pmap calls that use smp_rendezvous() on SMP, so that their per-cpu variants are also available to be called. The first patch also has an optimization from Juli's branch, to call pmap_update_page in pmap_kenter only if the pte is valid. The second patch makes the changes suggested above. My testing shows no issues so far, but please let me know if you have any comments. Thanks, JC. --0016e64c1dc2cb8ec2048d853700 Content-Type: text/x-patch; charset=US-ASCII; name="pmap-smp-rendezvous.patch" Content-Disposition: attachment; filename="pmap-smp-rendezvous.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gcppwhpu0 SW5kZXg6IHN5cy9taXBzL21pcHMvcG1hcC5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9taXBzL21pcHMv cG1hcC5jCShyZXZpc2lvbiAyMTEwNjgpCisrKyBzeXMvbWlwcy9taXBzL3BtYXAuYwkod29ya2lu ZyBjb3B5KQpAQCAtNTk1LDU4ICs1OTUsOTcgQEAKIAogI2VuZGlmCiAKK3N0YXRpYyBfX2lubGlu ZSB2b2lkCitwbWFwX2ludmFsaWRhdGVfYWxsX2xvY2FsKHBtYXBfdCBwbWFwKQoreworCWlmIChw bWFwID09IGtlcm5lbF9wbWFwKSB7CisJCXRsYl9pbnZhbGlkYXRlX2FsbCgpOworCQlyZXR1cm47 CisJfQorCisJaWYgKHBtYXAtPnBtX2FjdGl2ZSAmIFBDUFVfR0VUKGNwdW1hc2spKQorCQl0bGJf aW52YWxpZGF0ZV9hbGxfdXNlcihwbWFwKTsKKwllbHNlCisJCXBtYXAtPnBtX2FzaWRbUENQVV9H RVQoY3B1aWQpXS5nZW4gPSAwOworfQorCisjaWZkZWYgU01QCiBzdGF0aWMgdm9pZAogcG1hcF9p bnZhbGlkYXRlX2FsbChwbWFwX3QgcG1hcCkKIHsKLSNpZmRlZiBTTVAKLQlzbXBfcmVuZGV6dm91 cygwLCBwbWFwX2ludmFsaWRhdGVfYWxsX2FjdGlvbiwgMCwgKHZvaWQgKilwbWFwKTsKKwlzbXBf cmVuZ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91cGRhdGVf cGFnZV9sb2NhbChwbWFwLCB2YSwgcHRlKTsKK30KKyNlbmRpZgorCiAvKgogICoJUm91dGluZToJ cG1hcF9leHRyYWN0CiAgKglGdW5jdGlvbjoKQEAgLTc3Nyw3ICs4MTEsOCBAQAogCXB0ZSA9IHBt YXBfcHRlKGtlcm5lbF9wbWFwLCB2YSk7CiAJb3B0ZSA9ICpwdGU7CiAJKnB0ZSA9IG5wdGU7Ci0J cG1hcF91cGRhdGVfcGFnZShrZXJuZWxfcG1hcCwgdmEsIG5wdGUpOworCWlmIChwdGVfdGVzdCgm b3B0ZSwgUFRFX1YpICYmIG9wdGUgIT0gbnB0ZSkKKwkJcG1hcF91cGRhdGVfcGFnZShrZXJuZWxf cG1hcCwgdmEsIG5wdGUpOwogfQogCiAvKgo= --0016e64c1dc2cb8ec2048d853700 Content-Type: text/x-patch; charset=US-ASCII; name="pmap-emulate-modified.patch" Content-Disposition: attachment; filename="pmap-emulate-modified.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gcppx3v81 SW5kZXg6IHN5cy9taXBzL2luY2x1ZGUvcG1hcC5oCj09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9taXBzL2lu Y2x1ZGUvcG1hcC5oCShyZXZpc2lvbiAyMTEwNjYpCisrKyBzeXMvbWlwcy9pbmNsdWRlL3BtYXAu aAkod29ya2luZyBjb3B5KQpAQCAtMTY2LDcgKzE2Niw3IEBACiBpbnQgcG1hcF9jb21wdXRlX3Bh Z2VzX3RvX2R1bXAodm9pZCk7CiB2b2lkIHBtYXBfdXBkYXRlX3BhZ2UocG1hcF90IHBtYXAsIHZt X29mZnNldF90IHZhLCBwdF9lbnRyeV90IHB0ZSk7CiB2b2lkIHBtYXBfZmx1c2hfcHZjYWNoZSh2 bV9wYWdlX3QgbSk7Ci0KK2ludCBwbWFwX2VtdWxhdGVfbW9kaWZpZWQocG1hcF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Sk7Ci0KLQkJCVBN QVBfVU5MT0NLKHBtYXApOwotCQkJaWYgKCF1c2VybW9kZSkgewotCQkJCXJldHVybiAodHJhcGZy YW1lLT5wYyk7Ci0JCQl9Ci0JCQlnb3RvIG91dDsKKwkJcG1hcCA9ICZwLT5wX3Ztc3BhY2UtPnZt X3BtYXA7CisJCWlmIChwbWFwX2VtdWxhdGVfbW9kaWZpZWQocG1hcCwgdHJhcGZyYW1lLT5iYWR2 YWRkcikgIT0gMCkgeworCQkJZnR5cGUgPSBWTV9QUk9UX1dSSVRFOworCQkJZ290byBkb2ZhdWx0 OwogCQl9CisJCWlmICghdXNlcm1vZGUpCisJCQlyZXR1cm4gKHRyYXBmcmFtZS0+cGMpOworCQln b3RvIG91dDsKIAogCWNhc2UgVF9UTEJfTERfTUlTUzoKIAljYXNlIFRfVExCX1NUX01JU1M6Cg== --0016e64c1dc2cb8ec2048d853700--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTi=FowMNMy87aA2K=120a4L_Fd5GPDH%2BdEPKOsek>