Date: Tue, 6 Nov 2012 13:13:48 -0800 From: Garrett Cooper <yanegomi@gmail.com> To: Alfred Perlstein <alfred@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r242655 - head/sys/kern Message-ID: <CAGH67wRg-jd06fFKHPNKG=tQ4RN7VWL3MrefnL%2B4W=f3Ok14dA@mail.gmail.com> In-Reply-To: <201211060410.qA64AWC0075490@svn.freebsd.org> References: <201211060410.qA64AWC0075490@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Nov 5, 2012 at 8:10 PM, Alfred Perlstein <alfred@freebsd.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGH67wRg-jd06fFKHPNKG=tQ4RN7VWL3MrefnL%2B4W=f3Ok14dA>