From owner-svn-src-head@FreeBSD.ORG Sun Aug 31 08:57:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B06779EB; Sun, 31 Aug 2014 08:57:42 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 59A0D1BAE; Sun, 31 Aug 2014 08:57:42 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id AF4E725D3A81; Sun, 31 Aug 2014 08:57:39 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 93BCCC770B1; Sun, 31 Aug 2014 08:57:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id jVcNHggtntel; Sun, 31 Aug 2014 08:57:36 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:f973:5b8d:9a90:cf0f] (unknown [IPv6:fde9:577b:c1a9:4410:f973:5b8d:9a90:cf0f]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 1ABA8C770B0; Sun, 31 Aug 2014 08:57:34 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r270861 - in head/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs From: "Bjoern A. Zeeb" In-Reply-To: <201408302144.s7ULiWsX028875@svn.freebsd.org> Date: Sun, 31 Aug 2014 08:57:17 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201408302144.s7ULiWsX028875@svn.freebsd.org> To: Steven Hartland X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 08:57:42 -0000 On 30 Aug 2014, at 21:44 , Steven Hartland wrote: > Author: smh > Date: Sat Aug 30 21:44:32 2014 > New Revision: 270861 > URL: http://svnweb.freebsd.org/changeset/base/270861 >=20 > Log: > Ensure that ZFS ARC free memory checks include cached pages >=20 > Also restore kmem_used() check for i386 as it has KVA limits that the = raw > page counts above don=92t consider I see this on pc98 and i386 buildworld: =3D=3D=3D> cddl/usr.bin/zinject (all) = /storage/head/obj//pc98.i386/scratch/tmp/bz/head.svn/tmp/usr/lib/libzpool.= so: undefined reference to `kmem_used' cc: error: linker command failed with exit code 1 (use -v to see = invocation) --- zinject --- *** [zinject] Error code 1 >=20 > PR: 187594 > Reviewed by: peter > X-MFC-With: r270759 > Review: D700 > Sponsored by: Multiplay >=20 > Modified: > head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c > head/sys/cddl/compat/opensolaris/sys/kmem.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c >=20 > Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c Sat Aug = 30 20:26:30 2014 (r270860) > +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c Sat Aug = 30 21:44:32 2014 (r270861) > @@ -152,7 +152,7 @@ u_int > kmem_free_count(void) > { >=20 > - return (vm_cnt.v_free_count); > + return (vm_cnt.v_free_count + vm_cnt.v_cache_count); > } >=20 > u_int > @@ -169,6 +169,13 @@ kmem_size(void) > return (kmem_size_val); > } >=20 > +uint64_t > +kmem_used(void) > +{ > + > + return (vmem_size(kmem_arena, VMEM_ALLOC)); > +} > + > static int > kmem_std_constructor(void *mem, int size __unused, void *private, int = flags) > { >=20 > Modified: head/sys/cddl/compat/opensolaris/sys/kmem.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/cddl/compat/opensolaris/sys/kmem.h Sat Aug 30 = 20:26:30 2014 (r270860) > +++ head/sys/cddl/compat/opensolaris/sys/kmem.h Sat Aug 30 = 21:44:32 2014 (r270861) > @@ -66,6 +66,7 @@ typedef struct kmem_cache { > void *zfs_kmem_alloc(size_t size, int kmflags); > void zfs_kmem_free(void *buf, size_t size); > uint64_t kmem_size(void); > +uint64_t kmem_used(void); > u_int kmem_page_count(void); >=20 > /* >=20 > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Aug = 30 20:26:30 2014 (r270860) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Aug = 30 21:44:32 2014 (r270861) > @@ -2563,6 +2563,14 @@ arc_reclaim_needed(void) > #endif /* sun */ >=20 > #else > +#ifdef __i386__ > + /* i386 has KVA limits that the raw page counts above don't = consider */ > + if (kmem_used() > (kmem_size() * 3) / 4) { > + DTRACE_PROBE2(arc__reclaim_used, uint64_t, > + kmem_used(), uint64_t, (kmem_size() * 3) / 4); > + return (1); > + } > +#endif > if (spa_get_random(100) =3D=3D 0) > return (1); > #endif >=20 =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983