Date: Tue, 5 Sep 2017 13:54:27 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r323181 - stable/11/sys/dev/md Message-ID: <201709051354.v85DsRiU083445@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Tue Sep 5 13:54:27 2017 New Revision: 323181 URL: https://svnweb.freebsd.org/changeset/base/323181 Log: MFC r319934: Don't call vm_pager_page_unswapped() when writing or deleting a dirty page. Modified: stable/11/sys/dev/md/md.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/md/md.c ============================================================================== --- stable/11/sys/dev/md/md.c Tue Sep 5 13:52:15 2017 (r323180) +++ stable/11/sys/dev/md/md.c Tue Sep 5 13:54:27 2017 (r323181) @@ -1073,8 +1073,10 @@ mdstart_swap(struct md_s *sc, struct bio *bp) } m->valid = VM_PAGE_BITS_ALL; - vm_page_dirty(m); - vm_pager_page_unswapped(m); + if (m->dirty != VM_PAGE_BITS_ALL) { + vm_page_dirty(m); + vm_pager_page_unswapped(m); + } } else if (bp->bio_cmd == BIO_DELETE) { if (len == PAGE_SIZE || m->valid == VM_PAGE_BITS_ALL) rv = VM_PAGER_OK; @@ -1091,10 +1093,12 @@ mdstart_swap(struct md_s *sc, struct bio *bp) /* Page is valid. */ if (len != PAGE_SIZE) { pmap_zero_page_area(m, offs, len); - vm_page_dirty(m); - } - vm_pager_page_unswapped(m); - if (len == PAGE_SIZE) { + if (m->dirty != VM_PAGE_BITS_ALL) { + vm_page_dirty(m); + vm_pager_page_unswapped(m); + } + } else { + vm_pager_page_unswapped(m); md_swap_page_free(m); m = NULL; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709051354.v85DsRiU083445>