From owner-svn-src-head@FreeBSD.ORG Tue Sep 4 07:48:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D433D106564A; Tue, 4 Sep 2012 07:48:39 +0000 (UTC) (envelope-from ray@freebsd.org) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id 848868FC0A; Tue, 4 Sep 2012 07:48:39 +0000 (UTC) Received: from terran.dlink.ua (unknown [192.168.10.90]) by smtp.dlink.ua (Postfix) with SMTP id 931A3C493D; Tue, 4 Sep 2012 10:48:37 +0300 (EEST) Date: Tue, 4 Sep 2012 10:50:40 +0300 From: Aleksandr Rybalko To: Garrett Cooper Message-Id: <20120904105040.3340c748.ray@freebsd.org> In-Reply-To: References: <201209030852.q838q6lC053405@svn.freebsd.org> <20120903122352.951b4253.ray@freebsd.org> Organization: FreeBSD Project X-Mailer: Sylpheed 2.7.1 (GTK+ 2.20.1; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240067 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 04 Sep 2012 07:48:39 -0000 On Mon, 3 Sep 2012 12:29:05 -0700 Garrett Cooper wrote: >> On Mon, Sep 3, 2012 at 2:23 AM, Aleksandr Rybalko >> wrote: >> > On Mon, 3 Sep 2012 02:05:15 -0700 >> > Garrett Cooper wrote: >> > >> >>> On Sep 3, 2012, at 1:52 AM, Aleksandr Rybalko wrote: >> >>> >> >>> > Author: ray >> >>> > Date: Mon Sep 3 08:52:05 2012 >> >>> > New Revision: 240067 >> >>> > URL: http://svn.freebsd.org/changeset/base/240067 >> >>> > >> >>> > Log: >> >>> > Add kern.hintmode sysctl variable to show current state of >> >>> > hints: 0 - loader hints in environment only; >> >>> > 1 - static hints only >> >>> > 2 - fallback mode (Dynamic KENV with fallback to kernel >> >>> > environment) Add kern.hintmode write handler, accept only >> >>> > value 2. That will switch static KENV to dynamic. So it will >> >>> > be possible to change device hints. >> >>> >> >>> ... >> >>> >> >>> > + /* Migrate from static to dynamic hints */ >> >>> > + switch (hintmode) { >> >>> > + case 0: >> >>> > + if (dynamic_kenv) >> >>> > + /* Already here */ >> >>> > + hintmode = value; /* XXX: Need we switch >> >>> > or not ? */ >> >>> > + return (0); >> >>> >> >>> ^^^^ typo (missing braces)? ^^^^ >> > >> > Ohhh, yeah, testing now. >> > Thank you! >> > >> >>> >> >>> Also, don't you need extra glue for jails? >> > >> > Why, jails uses separate hints/kenv? >> >> I was wondering whether or not the tunables could be changed from the >> jail, thus allowing someone to affect the host system or if this >> memory space was effectively CoWed in some way, shape or form. Think after switch hints will be controlled by the same policy as before. Normal hints 0-16KB, so it will not be big memory waste. Handler allow to do it only one time: user set it to 2, handler copy env. Next time any just check, if 2, do nothing. You think better to add CTLFLAG_PRISON flag, to hide it from jails? >> >> Thanks! >> -Garrett Thank you Garrett! WBW -- Aleksandr Rybalko