From owner-svn-src-stable@freebsd.org Wed Dec 6 10:01:03 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 EF300E9B106; Wed, 6 Dec 2017 10:01:03 +0000 (UTC) (envelope-from bapt@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 9FAC76B5BB; Wed, 6 Dec 2017 10:01:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vB6A12Qt032202; Wed, 6 Dec 2017 10:01:02 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vB6A12Ot032201; Wed, 6 Dec 2017 10:01:02 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201712061001.vB6A12Ot032201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 6 Dec 2017 10:01:02 +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: r326619 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 326619 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.25 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: Wed, 06 Dec 2017 10:01:04 -0000 Author: bapt Date: Wed Dec 6 10:01:02 2017 New Revision: 326619 URL: https://svnweb.freebsd.org/changeset/base/326619 Log: MFC r325851: remove the poor emulation of the IllumOS needfree global variable to prevent the ARC reclaim thread running longer than needed. Update the arc::needfree dtrace probe triggered in arc_lowmem() to also report the value we may want to free. Submitted by: Nikita Kozlov Reviewed by: avg Approved by: avg Sponsored by: blade Differential Revision: https://reviews.freebsd.org/D12163 Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Dec 6 09:53:10 2017 (r326618) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Dec 6 10:01:02 2017 (r326619) @@ -4199,8 +4199,6 @@ arc_shrink(int64_t to_free) } } -static long needfree = 0; - typedef enum free_memory_reason_t { FMR_UNKNOWN, FMR_NEEDFREE, @@ -4238,14 +4236,6 @@ arc_available_memory(void) free_memory_reason_t r = FMR_UNKNOWN; #ifdef _KERNEL - if (needfree > 0) { - n = PAGESIZE * (-needfree); - if (n < lowest) { - lowest = n; - r = FMR_NEEDFREE; - } - } - /* * Cooperate with pagedaemon when it's time for it to scan * and reclaim some pages. @@ -4510,9 +4500,6 @@ arc_reclaim_thread(void *dummy __unused) int64_t to_free = (arc_c >> arc_shrink_shift) - free_memory; if (to_free > 0) { -#ifdef _KERNEL - to_free = MAX(to_free, ptob(needfree)); -#endif arc_shrink(to_free); } } else if (free_memory < arc_c >> arc_no_grow_shift) { @@ -4533,9 +4520,6 @@ arc_reclaim_thread(void *dummy __unused) * infinite loop. */ if (arc_size <= arc_c || evicted == 0) { -#ifdef _KERNEL - needfree = 0; -#endif /* * We're either no longer overflowing, or we * can't evict anything more, so we should wake @@ -6310,9 +6294,7 @@ arc_lowmem(void *arg __unused, int howto __unused) { mutex_enter(&arc_reclaim_lock); - /* XXX: Memory deficit should be passed as argument. */ - needfree = btoc(arc_c >> arc_shrink_shift); - DTRACE_PROBE(arc__needfree); + DTRACE_PROBE1(arc__needfree, int64_t, ((int64_t)freemem - zfs_arc_free_target) * PAGESIZE); cv_signal(&arc_reclaim_thread_cv); /*