From owner-freebsd-arch@FreeBSD.ORG Thu Oct 8 20:01:04 2009 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D26C71065679; Thu, 8 Oct 2009 20:01:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 724048FC1C; Thu, 8 Oct 2009 20:01:03 +0000 (UTC) Received: from c122-107-125-150.carlnfd1.nsw.optusnet.com.au (c122-107-125-150.carlnfd1.nsw.optusnet.com.au [122.107.125.150]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n98K118d028518 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 9 Oct 2009 07:01:02 +1100 Date: Fri, 9 Oct 2009 07:00:53 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: John Baldwin In-Reply-To: <200910020930.01228.jhb@freebsd.org> Message-ID: <20091009050808.U1531@delplex.bde.org> References: <200909301732.20589.jhb@freebsd.org> <200910011412.31250.jhb@freebsd.org> <20091002053705.F21979@delplex.bde.org> <200910020930.01228.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: arch@freebsd.org, Andriy Gapon Subject: Re: Interrupt Descriptions X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Oct 2009 20:01:04 -0000 On Fri, 2 Oct 2009, John Baldwin wrote: > On Thursday 01 October 2009 4:41:19 pm Bruce Evans wrote: > ... > However, all of this is still orthogonal to interrupt description strings. > >> Here is the 4.4BSD-Lite2 code for hp300: >> >> % .globl _intrcnt,_eintrcnt,_intrnames,_eintrnames >> % _intrnames: >> % .asciz "spur" >> % .asciz "hil" >> % .asciz "lev2" >> % .asciz "lev3" >> % .asciz "lev4" >> % .asciz "lev5" >> % .asciz "dma" >> % .asciz "clock" >> % .asciz "statclock" >> % .asciz "nmi" >> % _eintrnames: >> % .even >> % _intrcnt: >> % .long 0,0,0,0,0,0,0,0,0,0 >> % _eintrcnt: >> >> This takes 53 bytes (plus 1 or 3 for padding) for the string space. >> Most machines still need about 53 bytes for the string space (don't >> waste slots to count or name stray interrupts separately). These 53 >> bytes can be built and processed by userland on every sysctl much >> faster than the 32K of mostly-unused bytes can even be copied out. > > I think this mostly serves to prove the point that the existing design is > tailored to static configurations, not dynamic ones. No, string spaces are ideal for dynamic management of small collections of strings and for larger collections of strings that are accessed mostly sequentially. They are essentially the same as a text file. There is no better data structure for a text file than to concatenate all the lines together. Sometimes you want non-sequential access for text files, e.g., for tail -n and in editors, but this is rare and then you can build random-access substructures as needed. Collections of interrupt names are both small and accessed mostly sequentially. Bruce