Date: Fri, 22 Aug 2008 18:22:59 +0200 From: Luigi Rizzo <rizzo@iet.unipi.it> To: Brooks Davis <brooks@freebsd.org> Cc: Ivan Voras <ivoras@freebsd.org>, Christian Brueffer <brueffer@freebsd.org>, freebsd-arch@freebsd.org Subject: Re: Magic symlinks redux Message-ID: <20080822162259.GA61694@onelab2.iet.unipi.it> In-Reply-To: <20080822155126.GD57443@lor.one-eyed-alien.net> References: <g8kv7v$sp2$1@ger.gmane.org> <20080822090448.GB57441@onelab2.iet.unipi.it> <48AE89DC.9080408@yandex.ru> <g8m458$d3$1@ger.gmane.org> <20080822120525.GA1366@haakonia.hitnet.RWTH-Aachen.DE> <20080822145616.GA61094@onelab2.iet.unipi.it> <20080822150728.GB57443@lor.one-eyed-alien.net> <20080822154631.GA61495@onelab2.iet.unipi.it> <20080822155126.GD57443@lor.one-eyed-alien.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Aug 22, 2008 at 10:51:27AM -0500, Brooks Davis wrote: > On Fri, Aug 22, 2008 at 05:46:31PM +0200, Luigi Rizzo wrote: ... > > Do you know how much of it is used to implement the "varsym" > > subsystem (user- or system-wide variables) and how much is the > > core name translation ? > > Most of it is maintaining the lists of variables, handling the system > calls to read and write them, and doing the lookup with the correct > locking context. The basic match routine is about the same size, though > if you get a hit it's somewhat more expensive since you have to walk up > to three lists (two in what's in p4 at the moment, but I'm currently > splitting the per-proc code into privileged and un-privileged sets to > the administrator can add values to processes that later owners can't > modify) to resolve the variable name. so if i understand it well it could be committed as two separate pieces: one for the lookup and translation itself, and one for the variable management. The split would be very interesting for at least two reasons: 1. ease of porting/backporting/modularization e.g. think of the embedded case where one might want a limited or even no form of symlinks to save memory 2. maybe the code in charge of variable management can be replaced with some simpler instances (again for the embedded case, or e.g. to implement the NetBSD version of variant symlinks), reused for other purposes, or perhaps also integrated with other existing implementations. In fact i wonder about the following: we already have code to deal with kenv and sysctl, this would be a third mechanism that does a very similar thing, isn't there anything we can recycle from the existing ones ? Also, we do have a need to push tables of info in the kernel (e.g. list of PCI/USB ids, quirks tables and the like), maybe we can take this chance to make the varsym subsystem useful also within device drivers ? cheers luigi
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080822162259.GA61694>