From owner-freebsd-current@FreeBSD.ORG Fri Mar 5 09:12:10 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09D03106564A for ; Fri, 5 Mar 2010 09:12:10 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id D64F38FC13 for ; Fri, 5 Mar 2010 09:12:09 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 4668A46B38; Fri, 5 Mar 2010 04:12:09 -0500 (EST) Date: Fri, 5 Mar 2010 09:12:09 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Xin LI In-Reply-To: Message-ID: References: <401095.35021.qm@web59107.mail.re1.yahoo.com> <20100304.102007.1151864885495261672.imp@bsdimp.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-current@freebsd.org, "M. Warner Losh" , ddkprog@yahoo.com Subject: Re: propose: all arch move into a separate dir X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2010 09:12:10 -0000 On Thu, 4 Mar 2010, Xin LI wrote: > One good thing (in my opinion) that NetBSD and Darwin have is that they have > a "common" tree which holds the common files that shared between kernel and > userland libc. Currently we have 2 or more copies of certain files in the > tree but I'm not sure if it's a good idea to migrate them together into a > src/common tree, or just modify the Makefile to reference the one copy? > Eliminating duplicated files makes it easier for changes to propagate into > different areas (like, we have optimization apply against all components, or > have bug fixed in one time). Is this really widely a problem, or just a problem in a few specific cases? libc and other code depends on countless kernel files to get API definitions, system call lists, etc, without duplicating kernel code. Similarly, userland libraries sharing significant kernel code, such as libsbuf, will directly reference the kernel file, and in ipfilter, code is shared between the kernel and userspace directly as part of the test suite. The only real exceptions to this rule are libkern, which contains a very constrained part of libc, and the audit code, where the code structure is very similar but there are lots of small differences due to differing semantics for memory allocation in the kernel (M_WAITOK can't fail), so we maintain that copy/merge with the help of Perforce. Robert N M Watson Computer Laboratory University of Cambridge