Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jun 2019 14:32:33 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r348925 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201906111432.x5BEWXIW020982@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Tue Jun 11 14:32:32 2019
New Revision: 348925
URL: https://svnweb.freebsd.org/changeset/base/348925

Log:
  MFC r348790: Fix comparison signedness in arc_is_overflowing().
  
  When ARC size is very small, aggsum_lower_bound(&arc_size) may return
  negative values, that due to unsigned comparison caused delays, waiting
  for arc_adjust() to "fix" it by calling aggsum_value(&arc_size).  Use
  of signed comparison there fixes the problem.

Modified:
  stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==============================================================================
--- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Tue Jun 11 14:32:03 2019	(r348924)
+++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Tue Jun 11 14:32:32 2019	(r348925)
@@ -5140,7 +5140,7 @@ static boolean_t
 arc_is_overflowing(void)
 {
 	/* Always allow at least one block of overflow */
-	uint64_t overflow = MAX(SPA_MAXBLOCKSIZE,
+	int64_t overflow = MAX(SPA_MAXBLOCKSIZE,
 	    arc_c >> zfs_arc_overflow_shift);
 
 	/*
@@ -5152,7 +5152,7 @@ arc_is_overflowing(void)
 	 * in the ARC. In practice, that's in the tens of MB, which is low
 	 * enough to be safe.
 	 */
-	return (aggsum_lower_bound(&arc_size) >= arc_c + overflow);
+	return (aggsum_lower_bound(&arc_size) >= (int64_t)arc_c + overflow);
 }
 
 static abd_t *



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