Author: raj
Date: Mon Aug 19 15:58:39 2013
New Revision: 254535
URL: http://svnweb.freebsd.org/changeset/base/254535

Log:
  Simplify and clean up pmap_clearbit()
  
  There is no need for calling vm_page_dirty() when clearing "modified" flag as
  it is already set for that page in pmap_fault_fixup() or pmap_enter() thanks
  to "modified" bit emulation.
  
  Also, there is no need for checking PTE "referenced" or "writeable" flags.  If
  there is a request to clear a particular flag we should just do it.
  
  Submitted by: Zbigniew Bodek <z...@semihalf.com>
  Reviewed by:  gber
  Sponsored by: The FreeBSD Foundation, Semihalf

Modified:
  head/sys/arm/arm/pmap-v6.c

Modified: head/sys/arm/arm/pmap-v6.c
==============================================================================
--- head/sys/arm/arm/pmap-v6.c  Mon Aug 19 15:51:30 2013        (r254534)
+++ head/sys/arm/arm/pmap-v6.c  Mon Aug 19 15:58:39 2013        (r254535)
@@ -900,9 +900,6 @@ pmap_clearbit(struct vm_page *m, u_int m
 
        rw_wlock(&pvh_global_lock);
 
-       if (maskbits & PVF_WRITE)
-               maskbits |= PVF_MOD;
-
        if (TAILQ_EMPTY(&m->md.pv_list)) {
                rw_wunlock(&pvh_global_lock);
                return (0);
@@ -924,14 +921,12 @@ pmap_clearbit(struct vm_page *m, u_int m
                ptep = &l2b->l2b_kva[l2pte_index(va)];
                npte = opte = *ptep;
 
-               if ((maskbits & (PVF_WRITE|PVF_MOD)) && L2_S_WRITABLE(opte)) {
-                       vm_page_dirty(m);
-
+               if (maskbits & (PVF_WRITE | PVF_MOD)) {
                        /* make the pte read only */
                        npte |= L2_APX;
                }
 
-               if ((maskbits & PVF_REF) && L2_S_REFERENCED(opte)) {
+               if (maskbits & PVF_REF) {
                        /*
                         * Clear referenced flag in PTE so that we
                         * will take a flag fault the next time the mapping
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to