Author: markj
Date: Wed Jun 14 03:50:02 2017
New Revision: 319933
URL: https://svnweb.freebsd.org/changeset/base/319933

Log:
  Free the request page if an I/O error occurs while reading from swap.
  
  After such a failure, the page is invalid, so there's point in keeping it
  around. Moreover, such pages were not being inserted into the active queue,
  making them unreclaimable until a subsequent write or delete made them
  valid.
  
  Reported by:  alc
  Reviewed by:  alc (previous revision)
  MFC after:    1 week

Modified:
  head/sys/dev/md/md.c

Modified: head/sys/dev/md/md.c
==============================================================================
--- head/sys/dev/md/md.c        Wed Jun 14 03:45:26 2017        (r319932)
+++ head/sys/dev/md/md.c        Wed Jun 14 03:50:02 2017        (r319933)
@@ -1030,7 +1030,7 @@ mdstart_swap(struct md_s *sc, struct bio *bp)
                                rv = vm_pager_get_pages(sc->object, &m, 1,
                                    NULL, NULL);
                        if (rv == VM_PAGER_ERROR) {
-                               vm_page_xunbusy(m);
+                               md_swap_page_free(m);
                                break;
                        } else if (rv == VM_PAGER_FAIL) {
                                /*
@@ -1060,7 +1060,7 @@ mdstart_swap(struct md_s *sc, struct bio *bp)
                                rv = vm_pager_get_pages(sc->object, &m, 1,
                                    NULL, NULL);
                        if (rv == VM_PAGER_ERROR) {
-                               vm_page_xunbusy(m);
+                               md_swap_page_free(m);
                                break;
                        } else if (rv == VM_PAGER_FAIL)
                                pmap_zero_page(m);
@@ -1085,7 +1085,7 @@ mdstart_swap(struct md_s *sc, struct bio *bp)
                                rv = vm_pager_get_pages(sc->object, &m, 1,
                                    NULL, NULL);
                        if (rv == VM_PAGER_ERROR) {
-                               vm_page_xunbusy(m);
+                               md_swap_page_free(m);
                                break;
                        } else if (rv == VM_PAGER_FAIL) {
                                md_swap_page_free(m);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to