Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Mar 2009 14:28:51 -0500
From:      Alan Cox <alc@cs.rice.edu>
To:        John Baldwin <jhb@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r189595 - in head/sys: kern sys ufs/ffs vm
Message-ID:  <49B96273.90008@cs.rice.edu>
In-Reply-To: <200903091555.53181.jhb@freebsd.org>
References:  <200903091935.n29JZL3d035574@svn.freebsd.org> <200903091555.53181.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
John Baldwin wrote:
> On Monday 09 March 2009 3:35:20 pm John Baldwin wrote:
>   
>> Author: jhb
>> Date: Mon Mar  9 19:35:20 2009
>> New Revision: 189595
>> URL: http://svn.freebsd.org/changeset/base/189595
>>
>> Log:
>>   Adjust some variables (mostly related to the buffer cache) that hold
>>   address space sizes to be longs instead of ints.  Specifically, the follow
>>   values are now longs: runningbufspace, bufspace, maxbufspace,
>>   bufmallocspace, maxbufmallocspace, lobufspace, hibufspace, lorunningspace,
>>   hirunningspace, maxswzone, maxbcache, and maxpipekva.  Previously, a
>>   relatively small number (~ 44000) of buffers set in kern.nbuf would result
>>   in integer overflows resulting either in hangs or bogus values of
>>   hidirtybuffers and lodirtybuffers.  Now one has to overflow a long to see
>>   such problems.  There was a check for a nbuf setting that would cause
>>   overflows in the auto-tuning of nbuf.  I've changed it to always check and
>>   cap nbuf but warn if a user-supplied tunable would cause overflow.
>>   
>>   Note that this changes the ABI of several sysctls that are used by things
>>   like top(1), etc., so any MFC would probably require a some gross shims
>>   to allow for that.
>>   
>>   MFC after:	1 month
>>     
>
> I was able to boot with kern.nbuf=132000 with a buffer cache a little over 2GB 
> with this change on amd64 (thanks to Alan's changes to bump the kernel_map to 
> 6GB).  It gave this layout for kernel_map:
>
> (kgdb) kvm
> fffffffe40000000 - fffffffe40012000 kmem_alloc() / contigmalloc()
> fffffffe40012000 - fffffffe4003c000 AP stacks
> fffffffe4003c000 - fffffffe400f5000 kmem_alloc_nofault() (kstack/mapdev)
> fffffffe400f5000 - fffffffe40200000 kmem_alloc() / contigmalloc()
> fffffffe40200000 - fffffffee5565000 kmem_map
> fffffffee5565000 - fffffffee56e20a0 callouts
> fffffffee56e20a0 - fffffffee57078a0 swbuf
> fffffffee57078a0 - fffffffeea290000 buf
> fffffffeea290000 - ffffffff6d110000 buffer_map + pager_map
> ffffffff6d110000 - ffffffff6d540000 exec_map
> ffffffff6d540000 - ffffffff7596b000 pipe_map
> ffffffff7596b000 - ffffffff7777d000 kmem_alloc_nofault() (kstack/mapdev)
> ffffffff7777d000 - ffffffff7aab7000 kmem_alloc() / contigmalloc()
> ffffffff7aab7000 - ffffffff7aada000 kmem_alloc_nofault() (kstack/mapdev)
> ffffffff7aada000 - ffffffff7b6da000 kmem_alloc() / contigmalloc()
> ffffffff7b6da000 - ffffffff7b6fd000 kmem_alloc_nofault() (kstack/mapdev)
> ffffffff7b6fd000 - ffffffff7b883000 kmem_alloc() / contigmalloc()
> ffffffff7b883000 - ffffffff7b888000 kmem_alloc_nofault() (kstack/mapdev)
> ffffffff7b888000 - ffffffff7ba0e000 kmem_alloc() / contigmalloc()
> ffffffff7ba0e000 - ffffffff7ba13000 kmem_alloc_nofault() (kstack/mapdev)
> ffffffff7ba13000 - ffffffff7bb99000 kmem_alloc() / contigmalloc()
> ffffffff7bb99000 - ffffffff7bb9e000 kmem_alloc_nofault() (kstack/mapdev)
> ffffffff7bb9e000 - ffffffff7bd24000 kmem_alloc() / contigmalloc()
> ffffffff7bd24000 - ffffffff7bd29000 kmem_alloc_nofault() (kstack/mapdev)
> ffffffff7bd29000 - ffffffff7bf13000 kmem_alloc() / contigmalloc()
> ffffffff7bf13000 - ffffffff7bf22000 kmem_alloc_nofault() (kstack/mapdev)
> ffffffff7bf22000 - ffffffff7bf2c000 kmem_alloc() / contigmalloc()
> ffffffff7bf2c000 - ffffffff7bf9d000 kmem_alloc_nofault() (kstack/mapdev)
> ffffffff7bf9d000 - ffffffff7bfc5000 kmem_alloc() / contigmalloc()
> ffffffff7bfc5000 - ffffffff7c146000 kmem_alloc_nofault() (kstack/mapdev)
> ffffffff7c146000 - ffffffff80000000 ----
> ffffffff80000000 - ffffffff80dd2c88 text/data/bss
> ffffffff80dd2c88 - ffffffff8639a000 bootstrap data
> ffffffff8639a000 - ffffffff86400000 ----
>
> As far as an ABI fixup, I imagine that will involve having a hack where there 
> is a new flag that sysctl_handle_long() checks and will truncate a value if 
> the flag is set (CTLFLAG_INTABI or some such) and req->oldlen is sizeof(int) 
> < sizeof(long) rather than failing.
>
>   

We should try to segregate the kmem_alloc() allocations from the 
others.  Mingling them with the others, makes it less likely that 
superpages are used.

Alan




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?49B96273.90008>