freebsd-skq/sys/vm
Bosko Milekic 244f45548a Rework the way slab header storage space is calculated in UMA.
- zone_large_init() stays pretty much the same.
- zone_small_init() will try to stash the slab header in the slab page
  being allocated if the amount of calculated wasted space is less
  than UMA_MAX_WASTE (for both the UMA_ZONE_REFCNT case and regular
  case).  If the amount of wasted space is >= UMA_MAX_WASTE, then
  UMA_ZONE_OFFPAGE will be set and the slab header will be allocated
  separately for better use of space.
- uma_startup() calculates the maximum ipers required in offpage slabs
  (so that the offpage slab header zone(s) can be sized accordingly).
  The algorithm used to calculate this replaces the old calculation
  (which only happened to work coincidentally).  We now iterate over
  possible object sizes, starting from the smallest one, until we
  determine that wastedspace calculated in zone_small_init() might
  end up being greater than UMA_MAX_WASTE, at which point we use the
  found object size to compute the maximum possible ipers.  The
  reason this works is because:
      - wastedspace versus objectsize is a see-saw function with
        local minima all equal to zero and local maxima growing
        directly proportioned to objectsize.  This implies that
        for objects up to or equal a certain objectsize, the see-saw
        remains entirely below UMA_MAX_WASTE, so for those objectsizes
        it is impossible to ever go OFFPAGE for slab headers.
      - ipers (items-per-slab) versus objectsize is an inversely
        proportional function which falls off very quickly (very large
        for small objectsizes).
      - To determine the maximum ipers we'll ever need from OFFPAGE
        slab headers we first find the largest objectsize for which
        we are guaranteed to not go offpage for and use it to compute
        ipers (as though we were offpage).  Since the only objectsizes
        allowed to go offpage are bigger than the found objectsize,
        and since ipers vs objectsize is inversely proportional (and
        monotonically decreasing), then we are guaranteed that the
        ipers computed is always >= what we will ever need in offpage
        slab headers.
- Define UMA_FRITM_SZ and UMA_FRITMREF_SZ to be the actual (possibly
  padded) size of each freelist index so that offset calculations are
  fixed.

This might fix weird data corruption problems and certainly allows
ARM to now boot to at least single-user (via simulator).

Tested on i386 UP by me.
Tested on sparc64 SMP by fenner.
Tested on ARM simulator to single-user by cognet.
2004-07-29 15:25:40 +00:00
..
default_pager.c Access the swap_pagers' ->putpages() through swappagerops instead 2003-08-06 12:05:48 +00:00
device_pager.c Do the dreaded s/dev_t/struct cdev */ 2004-06-16 09:47:26 +00:00
phys_pager.c Zero the physical page only if it is invalid and not prezeroed. 2004-04-25 07:58:59 +00:00
pmap.h - pmap_kenter_temporary() is unused by machine-independent code. Therefore, 2004-04-10 22:41:46 +00:00
swap_pager.c - Change uma_zone_set_obj() to call kmem_alloc_nofault() instead of 2004-07-22 19:44:49 +00:00
swap_pager.h Remove advertising clause from University of California Regent's license, 2004-04-06 20:15:37 +00:00
uma_core.c Rework the way slab header storage space is calculated in UMA. 2004-07-29 15:25:40 +00:00
uma_dbg.c Bring in mbuma to replace mballoc. 2004-05-31 21:46:06 +00:00
uma_dbg.h - Use my freebsd email alias in the copyright. 2002-09-19 06:05:32 +00:00
uma_int.h Rework the way slab header storage space is calculated in UMA. 2004-07-29 15:25:40 +00:00
uma.h Fix a comment above uma_zsecond_create(), describing its arguments. 2004-06-01 01:36:26 +00:00
vm_contig.c Remove extraneous locks on the VM free page queue mutex; it is not 2004-07-19 23:29:36 +00:00
vm_extern.h For years, kmem_alloc_pageable() has been misused. Now that the last of 2004-07-25 20:08:59 +00:00
vm_fault.c To date, unwiring a fictitious page has produced a panic. The reason 2004-05-22 04:53:51 +00:00
vm_glue.c - Use atomic ops for updating the vmspace's refcnt and exitingcnt. 2004-07-27 03:53:41 +00:00
vm_init.c The demise of vm_pager_map_page() in revision 1.93 of vm/vm_pager.c permits 2004-04-08 19:08:49 +00:00
vm_kern.c For years, kmem_alloc_pageable() has been misused. Now that the last of 2004-07-25 20:08:59 +00:00
vm_kern.h Remove advertising clause from University of California Regent's license, 2004-04-06 20:15:37 +00:00
vm_map.c - Use atomic ops for updating the vmspace's refcnt and exitingcnt. 2004-07-27 03:53:41 +00:00
vm_map.h Simplify vmspace initialization. The bcopy() of fields from the old 2004-07-24 07:40:35 +00:00
vm_meter.c Remove advertising clause from University of California Regent's license, 2004-04-06 20:15:37 +00:00
vm_mmap.c Deorbit COMPAT_SUNOS. 2004-06-11 11:16:26 +00:00
vm_object.c Correct a very old error in both vm_object_madvise() (originating in 2004-07-28 18:23:08 +00:00
vm_object.h Make the code and comments for vm_object_coalesce() consistent. 2004-07-25 07:48:47 +00:00
vm_page.c Fix a race in vm_page_sleep_if_busy(). Due to vm_object locking 2004-07-21 23:56:09 +00:00
vm_page.h Reimplement contigmalloc(9) with an algorithm which stands a greatly- 2004-07-19 06:21:27 +00:00
vm_pageout.c Remove the GIANT_REQUIRED preceding pmap_remove() in 2004-07-18 04:38:11 +00:00
vm_pageout.h Remove advertising clause from University of California Regent's license, 2004-04-06 20:15:37 +00:00
vm_pageq.c Remove references to L1 in the comments, according to Alan they are 2004-06-07 19:33:05 +00:00
vm_pager.c The demise of vm_pager_map_page() in revision 1.93 of vm/vm_pager.c permits 2004-04-08 19:08:49 +00:00
vm_pager.h The demise of vm_pager_map_page() in revision 1.93 of vm/vm_pager.c permits 2004-04-08 19:08:49 +00:00
vm_param.h Second half of the dev_t cleanup. 2004-06-17 17:16:53 +00:00
vm_unix.c Remove advertising clause from University of California Regent's license, 2004-04-06 20:15:37 +00:00
vm_zeroidle.c Implement preemption of kernel threads natively in the scheduler rather 2004-07-02 20:21:44 +00:00
vm.h Remove advertising clause from University of California Regent's license, 2004-04-06 20:15:37 +00:00
vnode_pager.c Make vm_page's PG_ZERO flag immutable between the time of the page's 2004-05-06 05:03:23 +00:00
vnode_pager.h Remove advertising clause from University of California Regent's license, 2004-04-06 20:15:37 +00:00