From owner-svn-src-head@FreeBSD.ORG Tue Nov 6 21:13:51 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 E159CAD5; Tue, 6 Nov 2012 21:13:51 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id C288D8FC0A; Tue, 6 Nov 2012 21:13:50 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id b5so988586lbd.13 for ; Tue, 06 Nov 2012 13:13:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=oWbmlHSrjzT9A/T6jQMCdHuBrxnj2HIIwNrIdY6pvrE=; b=JRGeD+46+Y0U4efgylFOJ8zcMuBzNDujpMcwVflAwqFWTopTBurwMn3smskUPZXmyT /5XCWJUg6Wuooi41qyA2fdPM9bBSnVTjOqB+9lnLrbuQ8eaq7v4LCQEhiitCAl9Y3mGT trdanQBGcEwfpBIE2apBPcbdkFGHmSIkYIcd11CuNTLDpS7ZEyjMbbu2x4JflFSP4jRH UD1pplurGZiYNwH4PkL7ixqKuHT0jFuu4wc7Aw6L27NBLwwOUhw6Nltl+3N2qnGoy7E8 jFTT32EwNxbS1SMck5TEjvmy0ckFWgljOrd/47jh4gn92q25i2ttB7saM6WpW5qHSHFS Fqbg== MIME-Version: 1.0 Received: by 10.152.104.50 with SMTP id gb18mr2410942lab.9.1352236428741; Tue, 06 Nov 2012 13:13:48 -0800 (PST) Received: by 10.112.144.101 with HTTP; Tue, 6 Nov 2012 13:13:48 -0800 (PST) In-Reply-To: <201211060410.qA64AWC0075490@svn.freebsd.org> References: <201211060410.qA64AWC0075490@svn.freebsd.org> Date: Tue, 6 Nov 2012 13:13:48 -0800 Message-ID: Subject: Re: svn commit: r242655 - head/sys/kern From: Garrett Cooper To: Alfred Perlstein Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Nov 2012 21:13:52 -0000 On Mon, Nov 5, 2012 at 8:10 PM, Alfred Perlstein wrote: > Author: alfred > Date: Tue Nov 6 04:10:32 2012 > New Revision: 242655 > URL: http://svnweb.freebsd.org/changeset/base/242655 > > Log: > export VM_MIN_KERNEL_ADDRESS and VM_MAX_KERNEL_ADDRESS via sysctl. > > On several platforms the are determined by too many nested #defines to be > easily discernible. This will aid in development of auto-tuning. > > Modified: > head/sys/kern/kern_malloc.c > This should be vm_offset > Modified: head/sys/kern/kern_malloc.c > > ============================================================================== > --- head/sys/kern/kern_malloc.c Tue Nov 6 02:43:41 2012 (r242654) > +++ head/sys/kern/kern_malloc.c Tue Nov 6 04:10:32 2012 (r242655) > @@ -186,6 +186,14 @@ struct { > */ > static uma_zone_t mt_zone; > > +static u_long vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS; > +SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD, > + &vm_min_kernel_address, 0, "Min kernel address"); > + > +static u_long vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS; > +SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, > + &vm_max_kernel_address, 0, "Max kernel address"); > + > u_long vm_kmem_size; > SYSCTL_ULONG(_vm, OID_AUTO, kmem_size, CTLFLAG_RDTUN, &vm_kmem_size, 0, > "Size of kernel memory"); > This should probably be vm_offset_t for both values and there's already some goo in the arch specific portion of sparc64 which handles this with different type width (as noted by the tinderbox failures). Typechecking in this case per-platform should be ok with u_long outside of sparc64: /sys/amd64/include/_types.h:typedef __uint64_t __vm_offset_t; /sys/arm/include/_types.h:typedef __uint32_t __vm_offset_t; /sys/i386/include/_types.h:typedef __uint32_t __vm_offset_t; /sys/ia64/include/_types.h:typedef __uint64_t __vm_offset_t; /sys/mips/include/_types.h:typedef __uint64_t __vm_offset_t; /sys/mips/include/_types.h:typedef __uint32_t __vm_offset_t; /sys/powerpc/include/_types.h:typedef __uint64_t __vm_offset_t; /sys/powerpc/include/_types.h:typedef __uint32_t __vm_offset_t; /sys/sparc64/include/_types.h:typedef __uint64_t __vm_offset_t; $ for i in `ls /sys/*/*/*machdep*.c | xargs dirname | xargs dirname | sort -u`; do egrep -qr 'vm_(min|max)_kernel_address' $i && echo "${i##*/} derp" || echo "${i##*/} ok"; done amd64 ok arm ok dev ok i386 ok ia64 ok mips ok pc98 ok powerpc ok sparc64 derp x86 ok So maybe talking to Marius about consolidating that would be a good idea (or just applying a simple sed hack to rename the variable and move on). Thanks, -Garrett