From owner-svn-src-head@freebsd.org Mon Aug 3 10:52:29 2015 Return-Path: Delivered-To: svn-src-head@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 154C89B1D41; Mon, 3 Aug 2015 10:52:29 +0000 (UTC) (envelope-from peter@wemm.org) Received: from smtp2.wemm.org (smtp2.wemm.org [192.203.228.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E036FBA0; Mon, 3 Aug 2015 10:52:28 +0000 (UTC) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 61FED14C; Mon, 3 Aug 2015 03:52:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1438599147; bh=FSSJILy5mFdM1+MVxZbemXA7fL23qCI+Wb4d+H+AYI4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jKwUdh02Vo7/aChfB5vwiWW17SgMaYYHCGHlIZuzPB2ROK59CanFZmTTTHDn4yvf/ Jje984T20FqGT7U/hQzpjvoNtKESJnhOKwkYOi713OZHPxEk2CfGkz8SZ+VdzB6uKZ UCEydkevDoX1s4ni417WmBlpwVYwF9iG/ju6ZGJw= From: Peter Wemm To: svn-src-all@freebsd.org Cc: Steven Hartland , Slawa Olhovchenkov , svn-src-head@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r286223 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Date: Mon, 03 Aug 2015 03:52:21 -0700 Message-ID: <2757800.HIDNx1G49O@overcee.wemm.org> User-Agent: KMail/4.14.3 (FreeBSD/11.0-CURRENT; KDE/4.14.3; amd64; ; ) In-Reply-To: <55BF431E.3020601@freebsd.org> References: <201508030934.t739YAkT026668@repo.freebsd.org> <20150803094730.GA24698@zxy.spb.ru> <55BF431E.3020601@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1678551.kvVk1t1hKO"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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: Mon, 03 Aug 2015 10:52:29 -0000 --nextPart1678551.kvVk1t1hKO Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Monday, August 03, 2015 11:31:58 AM Steven Hartland wrote: > On 03/08/2015 10:47, Slawa Olhovchenkov wrote: > > On Mon, Aug 03, 2015 at 09:34:10AM +0000, Steven Hartland wrote: > >> Author: smh > >> Date: Mon Aug 3 09:34:09 2015 > >> New Revision: 286223 > >> URL: https://svnweb.freebsd.org/changeset/base/286223 > >>=20 > >> Log: > >> Fix KSTACK_PAGES check in ZFS module > >> =20 > >> The check introduced by r285946 failed to add the dependency on= > >> opt_kstack_pages.h which meant the default value for the platfo= rm > >> instead > >> of the customised options KSTACK_PAGES=3DX was being tested. > >> =20 > >> Also wrap in #ifdef __FreeBSD__ for portability. > >=20 > > /usr/src/sys/kern/kern_proc.c:int kstack_pages =3D KSTACK_PAGES; > >=20 > > May be check variable kstack_pages is best way? > > Eliminate dependency on foreign opt_XXXX. >=20 > I did think of that but as other modules such as dtrace, which is als= o > cddl code, already have this dependency I went with this. >=20 > I'm easy though, if there's a concusses that kstack_pages or possibly= > curthread->td_kstack_pages, which would take into account the > possibility of varied thread stack sizes, then I can make that change= . >=20 > What do others think? The whole thing has missing the point. Changing the default for the entire kernel just because the zfs compat=20= wrappers can't be bothered requesting a suitable value is.. unfortunate= ..=20 particularly when it is in freebsd-provided code, not upstream zfs code= . Fix the kproc_kthread_add() calls in do_thread_create() and zvol_geom_r= un()=20 instead. Enforce a lower bound there for zfs threads instead of making= the=20 entire rest of the kernel use more memory. eg: I'm thinking along these lines: Index: cddl/compat/opensolaris/sys/proc.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 =2D-- cddl/compat/opensolaris/sys/proc.h=09(revision 286224) +++ cddl/compat/opensolaris/sys/proc.h=09(working copy) @@ -77,6 +77,8 @@ =09ASSERT(state =3D=3D TS_RUN); =09ASSERT(pp =3D=3D &p0); =20 +=09if (stksize < 16384) +=09=09stksize =3D 16384;=09/* Enforce lower bound on ZFS threads */ =09error =3D kproc_kthread_add(proc, arg, &zfsproc, &td, RFSTOPPED, =09 stksize / PAGE_SIZE, "zfskern", "solthread %p", proc); =09if (error =3D=3D 0) { Beware, some platforms have large pages (eg: ia64 in -stable has 8k, 16= k or=20 32k pages, from memory). Specifying an arbitrary number of pages in co= de=20 that's supposed to be portable isn't a good idea. =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart1678551.kvVk1t1hKO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJVv0flAAoJEDXWlwnsgJ4ELMUIAK1tbIolkh8SIGfIo1A5Vw+n AzTThK+ccU3rm+PWWEjbJLd8vBMHmSNnbR/V3CgvKN58z6dpRUYQHl1jY0HFp8AH M71sG7cw6HPQ2mlJYzslYyGSPndtDRAjBVYAlXxWVwNAmXHuuq/pEliGX1nPKSIo A6ZBbb1++UrG3dq0qc1U51XZTqG0al36S3N4XRSWAvL+HZf57xCqPjlvd7sRh/lC tuPxTbAbPNb6z2xDpxf4pFwfj+Yj+yZ5vajRV3vvABIRHbPh+JRzfUtnxt6PaPRy B6Ujzt4EeNIlMbbPaRyf6Z3aoJt74K4VdocIJERDvXhGPvWcuIYNAiBfWRrtNuk= =LYLt -----END PGP SIGNATURE----- --nextPart1678551.kvVk1t1hKO--