Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Mar 2019 19:11:15 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r345551 - head/sys/vm
Message-ID:  <201903261911.x2QJBFXm009757@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Tue Mar 26 19:11:15 2019
New Revision: 345551
URL: https://svnweb.freebsd.org/changeset/base/345551

Log:
  Improve error reporting when the swap pager runs out of memory.
  
  Reviewed by:	kib
  MFC after:	2 weeks
  Sponsored by:	Klara Inc.
  Differential Revision:	https://reviews.freebsd.org/D19699

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==============================================================================
--- head/sys/vm/swap_pager.c	Tue Mar 26 18:03:18 2019	(r345550)
+++ head/sys/vm/swap_pager.c	Tue Mar 26 19:11:15 2019	(r345551)
@@ -1510,9 +1510,10 @@ swp_pager_async_iodone(struct buf *bp)
 	vm_object_t object = NULL;
 
 	/*
-	 * report error
+	 * Report error - unless we ran out of memory, in which case
+	 * we've already logged it in swapgeom_strategy().
 	 */
-	if (bp->b_ioflags & BIO_ERROR) {
+	if (bp->b_ioflags & BIO_ERROR && bp->b_error != ENOMEM) {
 		printf(
 		    "swap_pager: I/O error - %s failed; blkno %ld,"
 			"size %ld, error %d\n",
@@ -2692,6 +2693,7 @@ swapgeom_strategy(struct buf *bp, struct swdevt *sp)
 		mtx_unlock(&sw_dev_mtx);
 		bp->b_error = ENOMEM;
 		bp->b_ioflags |= BIO_ERROR;
+		printf("swap_pager: cannot allocate bio\n");
 		bufdone(bp);
 		return;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201903261911.x2QJBFXm009757>