From owner-svn-src-stable@freebsd.org Tue Sep 5 13:54:28 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9EFE5E0ADB4; Tue, 5 Sep 2017 13:54:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65D4B6DB8B; Tue, 5 Sep 2017 13:54:28 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v85DsR4b083446; Tue, 5 Sep 2017 13:54:27 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v85DsRiU083445; Tue, 5 Sep 2017 13:54:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201709051354.v85DsRiU083445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 5 Sep 2017 13:54:27 +0000 (UTC) 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 X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/dev/md X-SVN-Commit-Revision: 323181 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Sep 2017 13:54:28 -0000 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; }