From owner-svn-src-head@freebsd.org Mon Aug 3 11:32:19 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 BFFD79B2BA7; Mon, 3 Aug 2015 11:32:19 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 77DF7899; Mon, 3 Aug 2015 11:32:19 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1ZMDya-00051n-38; Mon, 03 Aug 2015 14:32:16 +0300 Date: Mon, 3 Aug 2015 14:32:16 +0300 From: Slawa Olhovchenkov To: Konstantin Belousov Cc: Peter Wemm , svn-src-all@freebsd.org, Steven Hartland , svn-src-head@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r286223 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20150803113215.GA8792@zxy.spb.ru> References: <201508030934.t739YAkT026668@repo.freebsd.org> <20150803094730.GA24698@zxy.spb.ru> <55BF431E.3020601@freebsd.org> <2757800.HIDNx1G49O@overcee.wemm.org> <20150803111942.GB2072@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150803111942.GB2072@kib.kiev.ua> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false 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 11:32:19 -0000 On Mon, Aug 03, 2015 at 02:19:42PM +0300, Konstantin Belousov wrote: > > The whole thing has missing the point. > > > > Changing the default for the entire kernel just because the zfs compat > > wrappers can't be bothered requesting a suitable value is.. unfortunate.. > > 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_run() > > instead. Enforce a lower bound there for zfs threads instead of making the > > entire rest of the kernel use more memory. > > > > eg: I'm thinking along these lines: > > Index: cddl/compat/opensolaris/sys/proc.h > > ==================================================== > > --- cddl/compat/opensolaris/sys/proc.h (revision 286224) > > +++ cddl/compat/opensolaris/sys/proc.h (working copy) > > @@ -77,6 +77,8 @@ > > ASSERT(state == TS_RUN); > > ASSERT(pp == &p0); > > > > + if (stksize < 16384) > > + stksize = 16384; /* Enforce lower bound on ZFS threads */ > > error = kproc_kthread_add(proc, arg, &zfsproc, &td, RFSTOPPED, > > stksize / PAGE_SIZE, "zfskern", "solthread %p", proc); > > if (error == 0) { > > > > > > Beware, some platforms have large pages (eg: ia64 in -stable has 8k, 16k or > > 32k pages, from memory). Specifying an arbitrary number of pages in code > > that's supposed to be portable isn't a good idea. > > This would not help. Issue is the size of the thread0 stack, which > overflows in this case. > > I looked at the possibility of making default kernel stack size > configurable by a loader tunable, and the issue is that thread0 gets its > stack set up too early (locore for i386, hammer_time() for amd64). I.e., > it is possible to make the setting effective for all threads after thread0, > but not for the one which causes the issue. > > I do not want to modify ABI between loader and kernel to pass the parameter. Parsing kenv by asm too complex?