The NetBSD Project

CVS log for src/sys/kern/subr_pool.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / kern

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.290 / (download) - annotate - [select for diffs], Sun Apr 9 12:21:59 2023 UTC (11 months, 1 week ago) by riastradh
Branch: MAIN
CVS Tags: triaxx-drm, thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, HEAD
Changes since 1.289: +13 -6 lines
Diff to previous 1.289 (colored) to selected 1.81 (colored)

pool(9): Tweak branch prediction in pool_cache_get_paddr assertion.

No functional change intended.

Revision 1.289 / (download) - annotate - [select for diffs], Sun Apr 9 12:16:34 2023 UTC (11 months, 1 week ago) by riastradh
Branch: MAIN
Changes since 1.288: +4 -4 lines
Diff to previous 1.288 (colored) to selected 1.81 (colored)

pool(9): Simplify assertion in pool_update_curpage.

Add message while here.

Revision 1.288 / (download) - annotate - [select for diffs], Sun Apr 9 09:18:09 2023 UTC (11 months, 1 week ago) by riastradh
Branch: MAIN
Changes since 1.287: +6 -4 lines
Diff to previous 1.287 (colored) to selected 1.81 (colored)

kern: KASSERT(A && B) -> KASSERT(A); KASSERT(B)

Revision 1.287 / (download) - annotate - [select for diffs], Fri Feb 24 11:02:27 2023 UTC (12 months, 3 weeks ago) by riastradh
Branch: MAIN
Changes since 1.286: +2 -8 lines
Diff to previous 1.286 (colored) to selected 1.81 (colored)

kern: Eliminate most __HAVE_ATOMIC_AS_MEMBAR conditionals.

I'm leaving in the conditional around the legacy membar_enters
(store-before-load, store-before-store) in kern_mutex.c and in
kern_lock.c because they may still matter: store-before-load barriers
tend to be the most expensive kind, so eliding them is probably
worthwhile on x86.  (It also may not matter; I just don't care to do
measurements right now, and it's a single valid and potentially
justifiable use case in the whole tree.)

However, membar_release/acquire can be mere instruction barriers on
all TSO platforms including x86, so there's no need to go out of our
way with a bad API to conditionalize them.  If the procedure call
overhead is measurable we just could change them to be macros on x86
that expand into __insn_barrier.

Discussed on tech-kern:
https://mail-index.netbsd.org/tech-kern/2023/02/23/msg028729.html

Revision 1.286 / (download) - annotate - [select for diffs], Fri Feb 17 06:34:46 2023 UTC (13 months ago) by skrll
Branch: MAIN
Changes since 1.285: +3 -3 lines
Diff to previous 1.285 (colored) to selected 1.81 (colored)

Avoid undefined behaviour.

Revision 1.252.2.4 / (download) - annotate - [select for diffs], Sun Jul 17 10:34:10 2022 UTC (20 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE
Changes since 1.252.2.3: +5 -4 lines
Diff to previous 1.252.2.3 (colored) to branchpoint 1.252 (colored) next main 1.253 (colored) to selected 1.81 (colored)

Pull up following revision(s) (requested by simonb in ticket #1479):

	sys/kern/subr_pool.c: revision 1.285

Use 64-bit math to calculate pool sizes.  Fixes overflow errors for
pools larger than 4GB and gives the correct output for kernel pool pages
in "vmstat -s" output.

Revision 1.285 / (download) - annotate - [select for diffs], Sat Jul 16 10:20:21 2022 UTC (20 months ago) by simonb
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm
Changes since 1.284: +5 -4 lines
Diff to previous 1.284 (colored) to selected 1.81 (colored)

Use 64-bit math to calculate pool sizes.  Fixes overflow errors for
pools larger than 4GB and gives the correct output for kernel pool pages
in "vmstat -s" output.

Revision 1.284 / (download) - annotate - [select for diffs], Sun May 29 10:47:40 2022 UTC (21 months, 2 weeks ago) by andvar
Branch: MAIN
Changes since 1.283: +3 -3 lines
Diff to previous 1.283 (colored) to selected 1.81 (colored)

fix various typos in comments and log messages.

Revision 1.283 / (download) - annotate - [select for diffs], Tue May 24 06:28:01 2022 UTC (21 months, 3 weeks ago) by andvar
Branch: MAIN
Changes since 1.282: +3 -3 lines
Diff to previous 1.282 (colored) to selected 1.81 (colored)

fix various typos in comments, docs and log messages.

Revision 1.282 / (download) - annotate - [select for diffs], Sat Apr 9 23:51:48 2022 UTC (23 months, 1 week ago) by riastradh
Branch: MAIN
Changes since 1.281: +3 -3 lines
Diff to previous 1.281 (colored) to selected 1.81 (colored)

pool(9): Convert membar_exit to membar_release.

Revision 1.281 / (download) - annotate - [select for diffs], Sun Feb 27 14:16:43 2022 UTC (2 years ago) by riastradh
Branch: MAIN
Changes since 1.280: +21 -13 lines
Diff to previous 1.280 (colored) to selected 1.81 (colored)

pool(9): Membar audit.

- Use atomic_store_release and atomic_load_consume for associating a
  freshly constructed pool_cache with its underlying pool.  The pool
  gets published in various ways before the pool cache is fully
  constructed.

  => Nix membar_sync -- no store-before-load is needed here.

- Take pool_head_lock around sysctl kern.pool TAILQ_FOREACH.  Then take
  a reference count, and drop the lock, around copyout.

  => Otherwise, pools could be partially initialized or freed while
     we're still trying to read from them -- and in the worst case,
     we might see a corrupted view of the tailq.

  => If we kept the lock around copyout, this could deadlock in memory
     allocation.

  => If we didn't take a reference count while releasing the lock, the
     pool could be destroyed while we're trying to traverse the list,
     sending us into oblivion instead of the next element.

Revision 1.280 / (download) - annotate - [select for diffs], Fri Dec 24 00:13:53 2021 UTC (2 years, 2 months ago) by riastradh
Branch: MAIN
Changes since 1.279: +4 -3 lines
Diff to previous 1.279 (colored) to selected 1.81 (colored)

pool(9): Fix default PR_NOALIGN for large pool caches.

Was broken in recent change to separate some pool cache flags from
pool flags.

Fixes crash in zfs.

Revision 1.279 / (download) - annotate - [select for diffs], Wed Dec 22 16:57:28 2021 UTC (2 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.278: +47 -26 lines
Diff to previous 1.278 (colored) to selected 1.81 (colored)

Do the last change differently:

Instead of having a pre-destruct hook, put knowledge of passive
serialization into the pool allocator directly, enabled by PR_PSERIALIZE
when the pool / pool_cache is initialized.  This will guarantee that
a passive serialization barrier will be performed before the object's
destructor is called, or before the page containing the object is freed
back to the system (in the case of no destructor).  Note that the internal
allocator overhead is different when PR_PSERIALIZE is used (it implies
PR_NOTOUCH, because the objects must remain in a valid state).

In the DRM Linux API shim, this allows us to remove the custom page
allocator for SLAB_TYPESAFE_BY_RCU.

Revision 1.278 / (download) - annotate - [select for diffs], Tue Dec 21 18:59:22 2021 UTC (2 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.277: +37 -2 lines
Diff to previous 1.277 (colored) to selected 1.81 (colored)

Add pool_cache_setpredestruct(), which allows a pool cache to specify
a function to be called before the destructor for a batch of one or more
objects is called.  This can be used as a synchronization point by
subsystems that rely on the type-stable nature of pool cache objects or
subsystems that use other forms of passive serialization.

Revision 1.276.4.1 / (download) - annotate - [select for diffs], Sun Aug 1 22:42:38 2021 UTC (2 years, 7 months ago) by thorpej
Branch: thorpej-i2c-spi-conf
Changes since 1.276: +30 -2 lines
Diff to previous 1.276 (colored) next main 1.277 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.277 / (download) - annotate - [select for diffs], Sun Jul 25 06:00:31 2021 UTC (2 years, 7 months ago) by simonb
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base, thorpej-cfargs2
Changes since 1.276: +30 -2 lines
Diff to previous 1.276 (colored) to selected 1.81 (colored)

Add accessor functions to get the number of gets and puts on pools and
pool caches.

Revision 1.274.2.2 / (download) - annotate - [select for diffs], Sat Apr 3 22:29:00 2021 UTC (2 years, 11 months ago) by thorpej
Branch: thorpej-futex
Changes since 1.274.2.1: +8 -3 lines
Diff to previous 1.274.2.1 (colored) next main 1.275 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.276 / (download) - annotate - [select for diffs], Wed Feb 24 05:36:02 2021 UTC (3 years ago) by mrg
Branch: MAIN
CVS Tags: thorpej-futex-base, thorpej-cfargs-base, thorpej-cfargs, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Branch point for: thorpej-i2c-spi-conf
Changes since 1.275: +8 -3 lines
Diff to previous 1.275 (colored) to selected 1.81 (colored)

skip redzone on pools with the allocation (including all overhead)
on anything greater than half the pool pagesize.

this stops 4KiB being used per allocation from the kmem-02048 pool,
and 64KiB per allocation from the buf32k pool.

we're still wasting 1/4 of space for overhead on eg, the buf1k or
kmem-01024 pools.  however, including overhead costs, the amount of
useless space (not used by consumer or overhead) reduces from 47%
to 18%, so this is far less bad overall.


there are a couple of ideas on solving this less ugly:

- pool redzones are enabled with DIAGNOSTIC kernels, which is
  defined as being "fast, cheap".  this is not cheap (though it
  is relatively fast if you don't run out of memory) so it does
  not really belong here as is, but DEBUG or a special option
  would work for it.

- if we increase the "pool page" size for these pools, such that
  the overhead over pool page is reduced to 5% or less, we can
  have redzones for more allocations without using more space.


also, see this thread:

https://mail-index.netbsd.org/tech-kern/2021/02/23/msg027130.html

Revision 1.274.2.1 / (download) - annotate - [select for diffs], Sun Jan 3 16:35:04 2021 UTC (3 years, 2 months ago) by thorpej
Branch: thorpej-futex
Changes since 1.274: +29 -10 lines
Diff to previous 1.274 (colored) to selected 1.81 (colored)

Sync w/ HEAD.

Revision 1.275 / (download) - annotate - [select for diffs], Sat Dec 19 23:38:21 2020 UTC (3 years, 2 months ago) by mrg
Branch: MAIN
Changes since 1.274: +29 -10 lines
Diff to previous 1.274 (colored) to selected 1.81 (colored)

ddb: add two new modifiers to "show pool" and "show all pools"

- /s shows a short single-line per pool list (the normal output
  is about 10 lines per.)
- /S skips pools with zero allocations.

Revision 1.274 / (download) - annotate - [select for diffs], Sat Sep 5 17:33:11 2020 UTC (3 years, 6 months ago) by riastradh
Branch: MAIN
Branch point for: thorpej-futex
Changes since 1.273: +3 -3 lines
Diff to previous 1.273 (colored) to selected 1.81 (colored)

Suppress pool redzone message unless booted with debug.

Revision 1.273 / (download) - annotate - [select for diffs], Fri Jun 19 13:49:38 2020 UTC (3 years, 8 months ago) by jdolecek
Branch: MAIN
Changes since 1.272: +22 -2 lines
Diff to previous 1.272 (colored) to selected 1.81 (colored)

bump the limit on max item size for pool_init()/pool_cache_init() up
to 1 << 24, so that the pools can be used for ZFS block allocations, which
are up to SPA_MAXBLOCKSHIFT (1 << 24)

part of PR kern/55397 by Frank Kardel

Revision 1.272 / (download) - annotate - [select for diffs], Sun Jun 14 23:17:01 2020 UTC (3 years, 9 months ago) by ad
Branch: MAIN
Changes since 1.271: +3 -3 lines
Diff to previous 1.271 (colored) to selected 1.81 (colored)

Arithmetic error in previous.

Revision 1.271 / (download) - annotate - [select for diffs], Sun Jun 14 21:34:25 2020 UTC (3 years, 9 months ago) by ad
Branch: MAIN
Changes since 1.270: +204 -192 lines
Diff to previous 1.270 (colored) to selected 1.81 (colored)

pool_cache:

- make all counters per-CPU and make cache layer do its work with atomic ops.
- conserve memory by caching empty groups globally.

Revision 1.270 / (download) - annotate - [select for diffs], Sun Jun 7 09:45:19 2020 UTC (3 years, 9 months ago) by maxv
Branch: MAIN
Changes since 1.269: +13 -2 lines
Diff to previous 1.269 (colored) to selected 1.81 (colored)

Add fault(4).

Revision 1.269 / (download) - annotate - [select for diffs], Sat Jun 6 06:42:54 2020 UTC (3 years, 9 months ago) by maxv
Branch: MAIN
Changes since 1.268: +8 -3 lines
Diff to previous 1.268 (colored) to selected 1.81 (colored)

kMSan: re-set the orig after pool_cache_get_slow(), using the address of
the caller of pool_cache_get_paddr().

Otherwise the orig is just pool_cache_get_paddr(), and that's not really
useful for debugging.

Revision 1.221.4.3 / (download) - annotate - [select for diffs], Tue Apr 21 18:42:42 2020 UTC (3 years, 10 months ago) by martin
Branch: phil-wifi
Changes since 1.221.4.2: +36 -47 lines
Diff to previous 1.221.4.2 (colored) to branchpoint 1.221 (colored) next main 1.222 (colored) to selected 1.81 (colored)

Sync with HEAD

Revision 1.266.4.1 / (download) - annotate - [select for diffs], Mon Apr 20 11:29:10 2020 UTC (3 years, 10 months ago) by bouyer
Branch: bouyer-xenpvh
Changes since 1.266: +38 -49 lines
Diff to previous 1.266 (colored) next main 1.267 (colored) to selected 1.81 (colored)

Sync with HEAD

Revision 1.268 / (download) - annotate - [select for diffs], Wed Apr 15 17:16:22 2020 UTC (3 years, 11 months ago) by maxv
Branch: MAIN
CVS Tags: phil-wifi-20200421, bouyer-xenpvh-base2, bouyer-xenpvh-base1
Changes since 1.267: +16 -6 lines
Diff to previous 1.267 (colored) to selected 1.81 (colored)

Introduce POOL_NOCACHE, simple option to cancel pool_caches and go directly
to the pool layer. It is taken out of POOL_QUARANTINE.

Advertise POOL_NOCACHE for kMSan rather than POOL_QUARANTINE. With kMSan
we are only interested in the no-caching effect, not the quarantine. This
reduces memory pressure on kMSan kernels.

Revision 1.221.4.2 / (download) - annotate - [select for diffs], Mon Apr 13 08:05:04 2020 UTC (3 years, 11 months ago) by martin
Branch: phil-wifi
Changes since 1.221.4.1: +202 -151 lines
Diff to previous 1.221.4.1 (colored) to branchpoint 1.221 (colored) to selected 1.81 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.267 / (download) - annotate - [select for diffs], Mon Apr 13 00:27:17 2020 UTC (3 years, 11 months ago) by chs
Branch: MAIN
Changes since 1.266: +24 -45 lines
Diff to previous 1.266 (colored) to selected 1.81 (colored)

slightly change and fix the semantics of pool_set*wat(), pool_sethardlimit()
and pool_prime() (and their pool_cache_* counterparts):

 - the pool_set*wat() APIs are supposed to specify thresholds for the count of
   free items in the pool before pool pages are automatically allocated or freed
   during pool_get() / pool_put(), whereas pool_sethardlimit() and pool_prime()
   are supposed to specify minimum and maximum numbers of total items
   in the pool (both free and allocated).  these were somewhat conflated
   in the existing code, so separate them as they were intended.

 - change pool_prime() to take an absolute number of items to preallocate
   rather than an increment over whatever was done before, and wait for
   any memory allocations to succeed.  since pool_prime() can no longer fail
   after this, change its return value to void and adjust all callers.

 - pool_setlowat() is documented as not immediately attempting to allocate
   any memory, but it was changed some time ago to immediately try to allocate
   up to the lowat level, so just fix the manpage to describe the current
   behaviour.

 - add a pool_cache_prime() to complete the API set.

Revision 1.252.2.3 / (download) - annotate - [select for diffs], Sun Mar 8 11:04:43 2020 UTC (4 years ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-2-RELEASE, netbsd-9-1-RELEASE
Changes since 1.252.2.2: +4 -4 lines
Diff to previous 1.252.2.2 (colored) to branchpoint 1.252 (colored) to selected 1.81 (colored)

Pull up following revision(s) (requested by chs in ticket #766):

	sys/kern/subr_pool.c: revision 1.265

fix assertions about when it is ok for pool_get() to return NULL.

Revision 1.264.2.2 / (download) - annotate - [select for diffs], Sat Feb 29 20:21:03 2020 UTC (4 years ago) by ad
Branch: ad-namecache
Changes since 1.264.2.1: +2 -35 lines
Diff to previous 1.264.2.1 (colored) to branchpoint 1.264 (colored) next main 1.265 (colored) to selected 1.81 (colored)

Sync with head.

Revision 1.266 / (download) - annotate - [select for diffs], Sat Feb 8 07:07:07 2020 UTC (4 years, 1 month ago) by maxv
Branch: MAIN
CVS Tags: phil-wifi-20200411, phil-wifi-20200406, is-mlppp-base, is-mlppp, bouyer-xenpvh-base, ad-namecache-base3
Branch point for: bouyer-xenpvh
Changes since 1.265: +2 -35 lines
Diff to previous 1.265 (colored) to selected 1.81 (colored)

Retire KLEAK.

KLEAK was a nice feature and served its purpose; it allowed us to detect
dozens of info leaks on the kernel->userland boundary, and thanks to it we
tackled a good part of the infoleak problem 1.5 years ago.

Nowadays however, we have kMSan, which can detect uninitialized memory in
the kernel. kMSan supersedes KLEAK: it can detect what KLEAK was able to
detect, but in addition, (1) it operates in all of the kernel and not just
the kernel->userland boundary, (2) it requires no user interaction, and (3)
it is deterministic and not statistical.

That makes kMSan the feature of choice to detect info leaks nowadays;
people interested in detecting info leaks should boot a kMSan kernel and
just wait for the magic to happen.

KLEAK was a good ride, and a fun project, but now is time for it to go.

Discussed with several people, including Thomas Barabosch.

Revision 1.264.2.1 / (download) - annotate - [select for diffs], Sat Jan 25 22:38:51 2020 UTC (4 years, 1 month ago) by ad
Branch: ad-namecache
Changes since 1.264: +4 -4 lines
Diff to previous 1.264 (colored) to selected 1.81 (colored)

Sync with head.

Revision 1.265 / (download) - annotate - [select for diffs], Sun Jan 19 23:49:32 2020 UTC (4 years, 1 month ago) by chs
Branch: MAIN
CVS Tags: ad-namecache-base2
Changes since 1.264: +4 -4 lines
Diff to previous 1.264 (colored) to selected 1.81 (colored)

fix assertions about when it is ok for pool_get() to return NULL.

Revision 1.264 / (download) - annotate - [select for diffs], Fri Dec 27 15:49:20 2019 UTC (4 years, 2 months ago) by maxv
Branch: MAIN
CVS Tags: ad-namecache-base1, ad-namecache-base
Branch point for: ad-namecache
Changes since 1.263: +7 -7 lines
Diff to previous 1.263 (colored) to selected 1.81 (colored)

Switch to panic, and make the message more useful.

Revision 1.263 / (download) - annotate - [select for diffs], Tue Dec 3 15:20:59 2019 UTC (4 years, 3 months ago) by riastradh
Branch: MAIN
Changes since 1.262: +7 -2 lines
Diff to previous 1.262 (colored) to selected 1.81 (colored)

Use __insn_barrier to enforce ordering in l_ncsw loops.

(Only need ordering observable by interruption, not by other CPUs.)

Revision 1.262 / (download) - annotate - [select for diffs], Thu Nov 14 16:23:53 2019 UTC (4 years, 4 months ago) by maxv
Branch: MAIN
CVS Tags: phil-wifi-20191119
Changes since 1.261: +50 -5 lines
Diff to previous 1.261 (colored) to selected 1.81 (colored)

Add support for Kernel Memory Sanitizer (kMSan). It detects uninitialized
memory used by the kernel at run time, and just like kASan and kCSan, it
is an excellent feature. It has already detected 38 uninitialized variables
in the kernel during my testing, which I have since discreetly fixed.

We use two shadows:
 - "shad", to track uninitialized memory with a bit granularity (1:1).
   Each bit set to 1 in the shad corresponds to one uninitialized bit of
   real kernel memory.
 - "orig", to track the origin of the memory with a 4-byte granularity
   (1:1). Each uint32_t cell in the orig indicates the origin of the
   associated uint32_t of real kernel memory.

The memory consumption of these shadows is consequent, so at least 4GB of
RAM is recommended to run kMSan.

The compiler inserts calls to specific __msan_* functions on each memory
access, to manage both the shad and the orig and detect uninitialized
memory accesses that change the execution flow (like an "if" on an
uninitialized variable).

We mark as uninit several types of memory buffers (stack, pools, kmem,
malloc, uvm_km), and check each buffer passed to copyout, copyoutstr,
bwrite, if_transmit_lock and DMA operations, to detect uninitialized memory
that leaves the system. This allows us to detect kernel info leaks in a way
that is more efficient and also more user-friendly than KLEAK.

Contrary to kASan, kMSan requires comprehensive coverage, ie we cannot
tolerate having one non-instrumented function, because this could cause
false positives. kMSan cannot instrument ASM functions, so I converted
most of them to __asm__ inlines, which kMSan is able to instrument. Those
that remain receive special treatment.

Contrary to kASan again, kMSan uses a TLS, so we must context-switch this
TLS during interrupts. We use different contexts depending on the interrupt
level.

The orig tracks precisely the origin of a buffer. We use a special encoding
for the orig values, and pack together in each uint32_t cell of the orig:
 - a code designating the type of memory (Stack, Pool, etc), and
 - a compressed pointer, which points either (1) to a string containing
   the name of the variable associated with the cell, or (2) to an area
   in the kernel .text section which we resolve to a symbol name + offset.

This encoding allows us not to consume extra memory for associating
information with each cell, and produces a precise output, that can tell
for example the name of an uninitialized variable on the stack, the
function in which it was pushed on the stack, and the function where we
accessed this uninitialized variable.

kMSan is available with LLVM, but not with GCC.

The code is organized in a way that is similar to kASan and kCSan, so it
means that other architectures than amd64 can be supported.

Revision 1.261 / (download) - annotate - [select for diffs], Wed Oct 16 18:29:49 2019 UTC (4 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.260: +13 -10 lines
Diff to previous 1.260 (colored) to selected 1.81 (colored)

Add and use __FPTRCAST, requested by uwe@

Revision 1.260 / (download) - annotate - [select for diffs], Wed Oct 16 15:27:38 2019 UTC (4 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.259: +5 -5 lines
Diff to previous 1.259 (colored) to selected 1.81 (colored)

Add void * function pointer casts. There are different ways to "fix" those
warnings:
    1. this one: add a void * cast (which I think is the least intrusive)
    2. add pragmas to elide the warning
    3. add intermediate inline conversion functions
    4. change the called function prototypes, adding unused arguments and
       converting some of the pointer arguments to void *.
    5. make the functions varyadic (which defeats the purpose of checking)
    6. pass command line flags to elide the warning
I did try 3 and 4 and I was not pleased with the result (sys_ptrace_common.c)
(3) added too much code and defines, and (4) made the regular use clumsy.

Revision 1.259 / (download) - annotate - [select for diffs], Mon Sep 23 05:39:59 2019 UTC (4 years, 5 months ago) by skrll
Branch: MAIN
Changes since 1.258: +3 -3 lines
Diff to previous 1.258 (colored) to selected 1.81 (colored)

Enable POOL_REDZONE with DIAGNOSTIC.

The bug in the arm pmap was fixed long ago.

Revision 1.258 / (download) - annotate - [select for diffs], Fri Sep 6 09:19:06 2019 UTC (4 years, 6 months ago) by maxv
Branch: MAIN
Changes since 1.257: +73 -75 lines
Diff to previous 1.257 (colored) to selected 1.81 (colored)

Reorder for clarity, and localify pool_allocator_big[], should not be used
outside.

Revision 1.252.2.2 / (download) - annotate - [select for diffs], Sun Sep 1 10:56:00 2019 UTC (4 years, 6 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1
Changes since 1.252.2.1: +25 -20 lines
Diff to previous 1.252.2.1 (colored) to branchpoint 1.252 (colored) to selected 1.81 (colored)

Pull up following revision(s) (requested by maxv in ticket #129):

	sys/kern/subr_pool.c: revision 1.256
	sys/kern/subr_pool.c: revision 1.257

Kernel Heap Hardening: use bitmaps on all off-page pools. This migrates 29
MI pools on amd64 from linked lists to bitmaps, which have higher security
properties.

Then, change the computation of the size of the PH pools: take into account
the bitmap area available by default in the ph_u2 union, and don't go with
&phpool[>0] if &phpool[0] already has enough space to embed a bitmap.

The pools that are migrated in this change all use bitmaps small enough to
fit in &phpool[0], therefore there is no increase in memory consumption.

 -

Revert r1.254, put back || for KASAN, some destructors like lwp_dtor()
caused false positives. Needs more work.

Revision 1.257 / (download) - annotate - [select for diffs], Mon Aug 26 10:35:35 2019 UTC (4 years, 6 months ago) by maxv
Branch: MAIN
Changes since 1.256: +4 -4 lines
Diff to previous 1.256 (colored) to selected 1.81 (colored)

Revert r1.254, put back || for KASAN, some destructors like lwp_dtor()
caused false positives. Needs more work.

Revision 1.252.2.1 / (download) - annotate - [select for diffs], Sun Aug 18 09:52:12 2019 UTC (4 years, 7 months ago) by martin
Branch: netbsd-9
Changes since 1.252: +49 -23 lines
Diff to previous 1.252 (colored) to selected 1.81 (colored)

Pull up following revision(s) (requested by maxv in ticket #81):

	sys/kern/subr_pool.c: revision 1.253
	sys/kern/subr_pool.c: revision 1.254
	sys/kern/subr_pool.c: revision 1.255

Kernel Heap Hardening: perform certain sanity checks on the pool caches
directly, to immediately detect certain bugs that would otherwise have
been detected only later on the pool layer, if the buffer ever reached
the pool layer.

 -

Replace || by && in KASAN, to increase the pool coverage.
Strictly speaking, what we want to avoid is poisoning buffers that were
referenced in a global list as part of the ctor. But, if a buffer indeed
got referenced as part of the ctor, it necessarily has to be unreferenced
in the dtor; which implies it has to have a dtor. So we want both a ctor
and a dtor, and not just one of them.

Note that POOL_QUARANTINE already implicitly provides this increased
coverage.

 -

Initialize pp->pr_redzone to false. For some reason with KUBSAN GCC does
not eliminate the unused branch in pr_item_linkedlist_put(), and this
leads to a unused uninitialized access which triggers KUBSAN messages.

Revision 1.256 / (download) - annotate - [select for diffs], Sat Aug 17 12:37:49 2019 UTC (4 years, 7 months ago) by maxv
Branch: MAIN
Changes since 1.255: +23 -18 lines
Diff to previous 1.255 (colored) to selected 1.81 (colored)

Kernel Heap Hardening: use bitmaps on all off-page pools. This migrates 29
MI pools on amd64 from linked lists to bitmaps, which have higher security
properties.

Then, change the computation of the size of the PH pools: take into account
the bitmap area available by default in the ph_u2 union, and don't go with
&phpool[>0] if &phpool[0] already has enough space to embed a bitmap.

The pools that are migrated in this change all use bitmaps small enough to
fit in &phpool[0], therefore there is no increase in memory consumption.

Revision 1.255 / (download) - annotate - [select for diffs], Fri Aug 16 10:41:35 2019 UTC (4 years, 7 months ago) by maxv
Branch: MAIN
Changes since 1.254: +3 -2 lines
Diff to previous 1.254 (colored) to selected 1.81 (colored)

Initialize pp->pr_redzone to false. For some reason with KUBSAN GCC does
not eliminate the unused branch in pr_item_linkedlist_put(), and this
leads to a unused uninitialized access which triggers KUBSAN messages.

Revision 1.254 / (download) - annotate - [select for diffs], Sat Aug 3 09:31:07 2019 UTC (4 years, 7 months ago) by maxv
Branch: MAIN
Changes since 1.253: +4 -4 lines
Diff to previous 1.253 (colored) to selected 1.81 (colored)

Replace || by && in KASAN, to increase the pool coverage.

Strictly speaking, what we want to avoid is poisoning buffers that were
referenced in a global list as part of the ctor. But, if a buffer indeed
got referenced as part of the ctor, it necessarily has to be unreferenced
in the dtor; which implies it has to have a dtor. So we want both a ctor
and a dtor, and not just one of them.

Note that POOL_QUARANTINE already implicitly provides this increased
coverage.

Revision 1.253 / (download) - annotate - [select for diffs], Fri Aug 2 05:22:14 2019 UTC (4 years, 7 months ago) by maxv
Branch: MAIN
Changes since 1.252: +46 -21 lines
Diff to previous 1.252 (colored) to selected 1.81 (colored)

Kernel Heap Hardening: perform certain sanity checks on the pool caches
directly, to immediately detect certain bugs that would otherwise have
been detected only later on the pool layer, if the buffer ever reached
the pool layer.

Revision 1.252 / (download) - annotate - [select for diffs], Sat Jun 29 11:13:23 2019 UTC (4 years, 8 months ago) by maxv
Branch: MAIN
CVS Tags: netbsd-9-base
Branch point for: netbsd-9
Changes since 1.251: +3 -2 lines
Diff to previous 1.251 (colored) to selected 1.81 (colored)

The big pool allocators use pool_page_alloc(), which allocates page-aligned
storage. So if we switch to a big pool, set PR_NOALIGN, because the address
of the storage is not aligned to the item size.

Should fix PR/54319.

Revision 1.251 / (download) - annotate - [select for diffs], Thu Jun 13 01:13:12 2019 UTC (4 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.250: +7 -6 lines
Diff to previous 1.250 (colored) to selected 1.81 (colored)

make pool assertion messages consistent.

Revision 1.221.4.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:09:03 2019 UTC (4 years, 9 months ago) by christos
Branch: phil-wifi
Changes since 1.221: +473 -241 lines
Diff to previous 1.221 (colored) to selected 1.81 (colored)

Sync with HEAD

Revision 1.250 / (download) - annotate - [select for diffs], Thu May 9 08:16:14 2019 UTC (4 years, 10 months ago) by skrll
Branch: MAIN
CVS Tags: phil-wifi-20190609
Changes since 1.249: +13 -4 lines
Diff to previous 1.249 (colored) to selected 1.81 (colored)

Avoid KASSERT(!cpu_intr_p()) when breaking into ddb and issuing

	show uvmexp

Revision 1.249 / (download) - annotate - [select for diffs], Sat Apr 13 08:41:36 2019 UTC (4 years, 11 months ago) by maxv
Branch: MAIN
CVS Tags: isaki-audio2-base, isaki-audio2
Changes since 1.248: +84 -3 lines
Diff to previous 1.248 (colored) to selected 1.81 (colored)

Introduce POOL_QUARANTINE, a feature that creates a window during which a
freed buffer cannot be reallocated. This greatly helps detecting
use-after-frees, because they are not short-lived anymore.

We maintain a per-pool fifo of 128 buffers. On each pool_put, we do a real
free of the oldest buffer, and insert the new buffer. Before insertion, we
mark the buffer as invalid with KASAN. On each pool_cache_put, we destruct
the object, so it lands in pool_put, and the quarantine is handled there.

POOL_QUARANTINE can be used in conjunction with KASAN to detect more
use-after-free bugs.

Revision 1.248 / (download) - annotate - [select for diffs], Sun Apr 7 09:20:04 2019 UTC (4 years, 11 months ago) by maxv
Branch: MAIN
Changes since 1.247: +7 -6 lines
Diff to previous 1.247 (colored) to selected 1.81 (colored)

Provide a code argument in kasan_mark(), and give a code to each caller.
Five codes used: GenericRedZone, MallocRedZone, KmemRedZone, PoolRedZone,
and PoolUseAfterFree.

This can greatly help debugging complex memory corruptions.

Revision 1.247 / (download) - annotate - [select for diffs], Sun Apr 7 08:37:38 2019 UTC (4 years, 11 months ago) by maxv
Branch: MAIN
Changes since 1.246: +2 -13 lines
Diff to previous 1.246 (colored) to selected 1.81 (colored)

Fix tiny race in pool+KASAN, that resulted in occasional false positives.

We were uselessly marking already valid areas as valid. When doing that,
our KASAN code emits two calls to kasan_markmem, and there is a very small
window where the area becomes invalid. So, if the area happens to be
already globally referenced, and if another thread happens to read the
buffer via this reference, we get a false positive.

This happens only with pool_caches that have a pc_ctor that creates a
global reference to the buffer, and there is one single pool_cache that
does that: 'file_cache'.

So now, two changes:

 - In pool_cache_get_slow(), the pool_get() has already redzoned the
   object, so no need to call pool_redzone_fill().

 - In pool_cache_destruct_object1(), don't re-mark the object. If there is
   no ctor pool_put is fine with already-invalid objects, if there is a
   ctor the object was not marked as invalid in the first place; so in
   either case, the re-marking is not needed.

Fixes PR/53674. Although very rare and difficult to reproduce, a local
quarantine patch of mine made the false positives recurrent.

Revision 1.246 / (download) - annotate - [select for diffs], Thu Mar 28 18:12:24 2019 UTC (4 years, 11 months ago) by maxv
Branch: MAIN
Changes since 1.245: +2 -4 lines
Diff to previous 1.245 (colored) to selected 1.81 (colored)

Move pnbuf_cache into vfs_init.c, where it belongs.

Revision 1.245 / (download) - annotate - [select for diffs], Wed Mar 27 18:27:46 2019 UTC (4 years, 11 months ago) by maxv
Branch: MAIN
Changes since 1.244: +37 -9 lines
Diff to previous 1.244 (colored) to selected 1.81 (colored)

Kernel Heap Hardening: detect frees-in-wrong-pool on on-page pools. The
detection is already implicitly done for off-page pools.

We recycle pr_slack (unused) in struct pool, and make ph_node a union in
order to recycle an unsigned int in struct pool_item_header. Each time a
pool is created we atomically increase a global counter, and register the
current value in pp. We then propagate this value in each ph, and ensure
they match in pool_put.

This can catch several classes of kernel bugs and basically makes them
unexploitable. It comes with no increase in memory usage and no measurable
increase in CPU cost (inexistent cost actually, just one check predicted
false).

Revision 1.244 / (download) - annotate - [select for diffs], Tue Mar 26 18:31:30 2019 UTC (4 years, 11 months ago) by maxv
Branch: MAIN
Changes since 1.243: +3 -69 lines
Diff to previous 1.243 (colored) to selected 1.81 (colored)

Remove POOL_SUBPAGE, it is unused, undocumented, and adds confusion.

Revision 1.243 / (download) - annotate - [select for diffs], Mon Mar 18 20:34:48 2019 UTC (5 years ago) by maxv
Branch: MAIN
Changes since 1.242: +21 -5 lines
Diff to previous 1.242 (colored) to selected 1.81 (colored)

Kernel Heap Hardening: manage freed items with bitmaps rather than linked
lists when we're on-page and the page header is naturally big enough to
contain a bitmap.

This comes with no increase in memory consumption, and similar CPU cost
(maybe it's a little faster actually).

We want to favor bitmaps over linked lists, because linked lists install
kernel pointers inside the items, and this can be too easily exploitable
in use-after-free or double-free conditions, or in item buffer overflows
occurring within a pool page.

Revision 1.242 / (download) - annotate - [select for diffs], Sun Mar 17 19:57:54 2019 UTC (5 years ago) by maxv
Branch: MAIN
Changes since 1.241: +41 -19 lines
Diff to previous 1.241 (colored) to selected 1.81 (colored)

Introduce a new flag, PR_USEBMAP, that indicates whether the pool uses a
bitmap to manage freed items. It dissociates PR_NOTOUCH from bitmaps, but
for now is set only when PR_NOTOUCH is set, which reproduces the current
behavior. Therefore, no functional change. Also clarify the code.

Revision 1.241 / (download) - annotate - [select for diffs], Sun Mar 17 15:33:50 2019 UTC (5 years ago) by maxv
Branch: MAIN
Changes since 1.240: +14 -11 lines
Diff to previous 1.240 (colored) to selected 1.81 (colored)

Kernel Heap Hardening: put the pool header at the beginning of the backing
page, not at the end of it.

This makes it harder to exploit buffer overflows, because it eliminates the
certainty that sensitive kernel data is located after the item space and is
therefore overwritable.

The pr_itemoffset field is recycled, and holds the (aligned) offset of the
item space. The pr_phoffset field becomes unused. We align 'itemspace' for
clarity, but it's not strictly necessary.

This comes with no performance cost or increase in memory usage, in
particular the potential padding consumed by roundup(PHSIZE, align) was
already implicitly consumed before, because of the (necessary) truncations
in the divisions. Now it's just more explicit, but not bigger.

Revision 1.240 / (download) - annotate - [select for diffs], Sun Mar 17 14:52:25 2019 UTC (5 years ago) by maxv
Branch: MAIN
Changes since 1.239: +43 -19 lines
Diff to previous 1.239 (colored) to selected 1.81 (colored)

Move some code into a separate function, and explain a bit. Also define
PHSIZE. No functional change.

Revision 1.239 / (download) - annotate - [select for diffs], Sun Mar 17 07:22:18 2019 UTC (5 years ago) by maxv
Branch: MAIN
Changes since 1.238: +4 -4 lines
Diff to previous 1.238 (colored) to selected 1.81 (colored)

cosmetic

Revision 1.238 / (download) - annotate - [select for diffs], Sun Mar 17 06:55:06 2019 UTC (5 years ago) by maxv
Branch: MAIN
Changes since 1.237: +13 -27 lines
Diff to previous 1.237 (colored) to selected 1.81 (colored)

Prepare the removal of the 'ioff' argument: add a KASSERT to ensure it is
zero, and remove the internal logic. The pool code is simpler now.

Revision 1.237 / (download) - annotate - [select for diffs], Sat Mar 16 13:33:10 2019 UTC (5 years ago) by maxv
Branch: MAIN
Changes since 1.236: +32 -17 lines
Diff to previous 1.236 (colored) to selected 1.81 (colored)

Misc changes:

 - Turn two KASSERTs to real panics, they are useful and not expensive.
 - Rename a few variables for clarity.
 - Add a new panic, to make sure a freed item is in the item space.

Revision 1.236 / (download) - annotate - [select for diffs], Wed Mar 13 20:56:33 2019 UTC (5 years ago) by maxv
Branch: MAIN
Changes since 1.235: +36 -35 lines
Diff to previous 1.235 (colored) to selected 1.81 (colored)

style

Revision 1.235 / (download) - annotate - [select for diffs], Mon Mar 11 20:38:27 2019 UTC (5 years ago) by maxv
Branch: MAIN
Changes since 1.234: +6 -1 lines
Diff to previous 1.234 (colored) to selected 1.81 (colored)

Add sanity check: make sure we retrieve a valid item header, by checking
its page address against the one we computed. If there's a mismatch it
means the buffer does not belong to the pool, and we panic.

Revision 1.234 / (download) - annotate - [select for diffs], Mon Mar 11 20:21:32 2019 UTC (5 years ago) by maxv
Branch: MAIN
Changes since 1.233: +69 -45 lines
Diff to previous 1.233 (colored) to selected 1.81 (colored)

Rename pr_item_notouch_* to pr_item_bitmap_*, and move some code into new
pr_item_linkedlist_* functions. This makes it easier to see that we have
two ways of handling freed items.

No functional change.

Revision 1.233 / (download) - annotate - [select for diffs], Mon Feb 11 11:12:58 2019 UTC (5 years, 1 month ago) by maxv
Branch: MAIN
Changes since 1.232: +4 -7 lines
Diff to previous 1.232 (colored) to selected 1.81 (colored)

Fix previous, pr_size includes the KASAN redzone. Repurpose pr_reqsize and
use it for PR_ZERO, it holds the size requested by the user with no padding
or redzone added, and only these bytes should be zeroed.

Revision 1.232 / (download) - annotate - [select for diffs], Sun Feb 10 17:13:33 2019 UTC (5 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.231: +7 -4 lines
Diff to previous 1.231 (colored) to selected 1.81 (colored)

Introduce PR_ZERO to avoid open-coding memset()s everywhere. OK riastradh@.

Revision 1.221.2.4 / (download) - annotate - [select for diffs], Wed Dec 26 14:02:04 2018 UTC (5 years, 2 months ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.221.2.3: +93 -27 lines
Diff to previous 1.221.2.3 (colored) to branchpoint 1.221 (colored) next main 1.222 (colored) to selected 1.81 (colored)

Sync with HEAD, resolve a few conflicts

Revision 1.231 / (download) - annotate - [select for diffs], Sun Dec 23 12:15:01 2018 UTC (5 years, 2 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226
Changes since 1.230: +7 -7 lines
Diff to previous 1.230 (colored) to selected 1.81 (colored)

Simplify the KASAN API, use only kasan_mark() and explain briefly. The
alloc/free naming was too confusing.

Revision 1.230 / (download) - annotate - [select for diffs], Sun Dec 23 11:42:13 2018 UTC (5 years, 2 months ago) by maxv
Branch: MAIN
Changes since 1.229: +2 -10 lines
Diff to previous 1.229 (colored) to selected 1.81 (colored)

Remove useless debugging code, the area is completely filled but it's not
checked afterwards, only pi_magic is.

Revision 1.229 / (download) - annotate - [select for diffs], Sun Dec 16 21:03:35 2018 UTC (5 years, 3 months ago) by maxv
Branch: MAIN
Changes since 1.228: +63 -21 lines
Diff to previous 1.228 (colored) to selected 1.81 (colored)

Add support for detecting use-after-frees in KASAN. We poison each freed
buffer, any subsequent read or write will be detected as illegal.

 * Add POOL_CHECK_MAGIC, which is disabled under KASAN, because the same
   detection is done in a better way.

 * Register the size+redzone in the pool structure, to reduce the overhead.

 * Fix the CTOR/DTOR check in KLEAK, the fields are never NULL.

Revision 1.228 / (download) - annotate - [select for diffs], Sun Dec 2 21:00:13 2018 UTC (5 years, 3 months ago) by maxv
Branch: MAIN
Changes since 1.227: +34 -2 lines
Diff to previous 1.227 (colored) to selected 1.81 (colored)

Introduce KLEAK, a new feature that can detect kernel information leaks.

It works by tainting memory sources with marker values, letting the data
travel through the kernel, and scanning the kernel<->user frontier for
these marker values. Combined with compiler instrumentation and rotation
of the markers, it is able to yield relevant results with little effort.

We taint the pools and the stack, and scan copyout/copyoutstr. KLEAK is
supported on amd64 only for now, but it is not complicated to add more
architectures (just a matter of having the address of .text, and a stack
unwinder).

A userland tool is provided, that allows to execute a command in rounds
and monitor the leaks generated all the while.

KLEAK already detected directly 12 kernel info leaks, and prompted changes
that in total fixed 25+ leaks.

Based on an idea developed jointly with Thomas Barabosch (of Fraunhofer
FKIE).

Revision 1.221.2.3 / (download) - annotate - [select for diffs], Sun Sep 30 01:45:55 2018 UTC (5 years, 5 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.221.2.2: +19 -6 lines
Diff to previous 1.221.2.2 (colored) to branchpoint 1.221 (colored) to selected 1.81 (colored)

Ssync with HEAD

Revision 1.227 / (download) - annotate - [select for diffs], Mon Sep 10 13:11:05 2018 UTC (5 years, 6 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930
Changes since 1.226: +19 -6 lines
Diff to previous 1.226 (colored) to selected 1.81 (colored)

Correctly align the size+redzone for KASAN, on amd64 it happens to be
always 8byte-aligned but on other architectures it may not be.

Revision 1.221.2.2 / (download) - annotate - [select for diffs], Thu Sep 6 06:56:42 2018 UTC (5 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.221.2.1: +30 -13 lines
Diff to previous 1.221.2.1 (colored) to branchpoint 1.221 (colored) to selected 1.81 (colored)

Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)

Revision 1.226 / (download) - annotate - [select for diffs], Sat Aug 25 05:56:24 2018 UTC (5 years, 6 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-0906
Changes since 1.225: +3 -3 lines
Diff to previous 1.225 (colored) to selected 1.81 (colored)

Disable POOL_REDZONE until we figure out what's wrong. There must be a dumb
problem, that is not triggerable on amd64.

Revision 1.225 / (download) - annotate - [select for diffs], Fri Aug 24 14:04:27 2018 UTC (5 years, 6 months ago) by maxv
Branch: MAIN
Changes since 1.224: +6 -6 lines
Diff to previous 1.224 (colored) to selected 1.81 (colored)

Use __predict_false to optimize, and also replace panic->printf.

Revision 1.224 / (download) - annotate - [select for diffs], Thu Aug 23 12:18:02 2018 UTC (5 years, 6 months ago) by maxv
Branch: MAIN
Changes since 1.223: +26 -9 lines
Diff to previous 1.223 (colored) to selected 1.81 (colored)

Add kASan redzones on pools and pool_caches. Also enable POOL_REDZONE
on DIAGNOSTIC.

Revision 1.221.2.1 / (download) - annotate - [select for diffs], Sat Jul 28 04:38:08 2018 UTC (5 years, 7 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.221: +4 -4 lines
Diff to previous 1.221 (colored) to selected 1.81 (colored)

Sync with HEAD

Revision 1.223 / (download) - annotate - [select for diffs], Wed Jul 4 02:19:02 2018 UTC (5 years, 8 months ago) by kamil
Branch: MAIN
CVS Tags: pgoyette-compat-0728
Changes since 1.222: +3 -3 lines
Diff to previous 1.222 (colored) to selected 1.81 (colored)

Avoid undefined behavior in pr_item_notouch_put()

Do not left shift a signed integer changing its signedness bit.

sys/kern/subr_pool.c:251:30, left shift of 1 by 31 places cannot be represented in type 'int'

Detected with Kernel Undefined Behavior Sanitizer.

Reported by <Harry Pantazis>

Revision 1.222 / (download) - annotate - [select for diffs], Wed Jul 4 01:42:37 2018 UTC (5 years, 8 months ago) by kamil
Branch: MAIN
Changes since 1.221: +3 -3 lines
Diff to previous 1.221 (colored) to selected 1.81 (colored)

Avoid Undefined Behavior in pr_item_notouch_get()

Change the type of left shifted integer from signed to unsigned.

sys/kern/subr_pool.c:274:13, left shift of 1 by 31 places cannot be represented in type 'int'

Detected with Kernel Undefined Behavior Sanitizer.

Reported by <Harry Pantazis>

Revision 1.207.6.1 / (download) - annotate - [select for diffs], Tue Feb 27 09:07:32 2018 UTC (6 years ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1
Changes since 1.207: +112 -47 lines
Diff to previous 1.207 (colored) next main 1.208 (colored) to selected 1.81 (colored)

Pull up following revision(s) (requested by mrg in ticket #593):
	sys/dev/marvell/mvxpsec.c: revision 1.2
	sys/arch/m68k/m68k/pmap_motorola.c: revision 1.70
	sys/opencrypto/crypto.c: revision 1.102
	sys/arch/sparc64/sparc64/pmap.c: revision 1.308
	sys/ufs/chfs/chfs_malloc.c: revision 1.5
	sys/arch/powerpc/oea/pmap.c: revision 1.95
	sys/sys/pool.h: revision 1.80,1.82
	sys/kern/subr_pool.c: revision 1.209-1.216,1.219-1.220
	sys/arch/alpha/alpha/pmap.c: revision 1.262
	sys/kern/uipc_mbuf.c: revision 1.173
	sys/uvm/uvm_fault.c: revision 1.202
	sys/sys/mbuf.h: revision 1.172
	sys/kern/subr_extent.c: revision 1.86
	sys/arch/x86/x86/pmap.c: revision 1.266 (via patch)
	sys/dev/dtv/dtv_scatter.c: revision 1.4

Allow only one pending call to a pool's backing allocator at a time.
Candidate fix for problems with hanging after kva fragmentation related
to PR kern/45718.

Proposed on tech-kern:
https://mail-index.NetBSD.org/tech-kern/2017/10/23/msg022472.html
Tested by bouyer@ on i386.

This makes one small change to the semantics of pool_prime and
pool_setlowat: they may fail with EWOULDBLOCK instead of ENOMEM, if
there is a pending call to the backing allocator in another thread but
we are not actually out of memory.  That is unlikely because nearly
always these are used during initialization, when the pool is not in
use.

Define the new flag too for previous commit.

pool_grow can now fail even when sleeping is ok. Catch this case in pool_get
and retry.

Assert that pool_get failure happens only with PR_NOWAIT.
This would have caught the mistake I made last week leading to null
pointer dereferences all over the place, a mistake which I evidently
poorly scheduled alongside maxv's change to the panic message on x86
for null pointer dereferences.

Since pr_lock is now used to wait for two things now (PR_GROWING and
PR_WANTED) we need to loop for the condition we wanted.
make the KASSERTMSG/panic strings consistent as '%s: [%s], __func__, wchan'
Handle the ERESTART case from pool_grow()

don't pass 0 to the pool flags
Guess pool_cache_get(pc, 0) means PR_WAITOK here.
Earlier on in the same context we use kmem_alloc(sz, KM_SLEEP).

use PR_WAITOK everywhere.
use PR_NOWAIT.

Don't use 0 for PR_NOWAIT

use PR_NOWAIT instead of 0

panic ex nihilo -- PR_NOWAITing for zerot

Add assertions that either PR_WAITOK or PR_NOWAIT are set.
- fix an assert; we can reach there if we are nowait or limitfail.
- when priming the pool and failing with ERESTART, don't decrement the number
  of pages; this avoids the issue of returning an ERESTART when we get to 0,
  and is more correct.
- simplify the pool_grow code, and don't wakeup things if we ENOMEM.

In pmap_enter_ma(), only try to allocate pves if we might need them,
and even if that fails, only fail the operation if we later discover
that we really do need them.  This implements the requirement that
pmap_enter(PMAP_CANFAIL) must not fail when replacing an existing
mapping with the first mapping of a new page, which is an unintended
consequence of the changes from the rmind-uvmplock branch in 2011.

The problem arises when pmap_enter(PMAP_CANFAIL) is used to replace an existing
pmap mapping with a mapping of a different page (eg. to resolve a copy-on-write).
If that fails and leaves the old pmap entry in place, then UVM won't hold
the right locks when it eventually retries.  This entanglement of the UVM and
pmap locking was done in rmind-uvmplock in order to improve performance,
but it also means that the UVM state and pmap state need to be kept in sync
more than they did before.  It would be possible to handle this in the UVM code
instead of in the pmap code, but these pmap changes improve the handling of
low memory situations in general, and handling this in UVM would be clunky,
so this seemed like the better way to go.

This somewhat indirectly fixes PR 52706, as well as the failing assertion
about "uvm_page_locked_p(old_pg)".  (but only on x86, various other platforms
will need their own changes to handle this issue.)
In uvm_fault_upper_enter(), if pmap_enter(PMAP_CANFAIL) fails, assert that
the pmap did not leave around a now-stale pmap mapping for an old page.
If such a pmap mapping still existed after we unlocked the vm_map,
the UVM code would not know later that it would need to lock the
lower layer object while calling the pmap to remove or replace that
stale pmap mapping.  See PR 52706 for further details.
hopefully workaround the irregularly "fork fails in init" problem.
if a pool is growing, and the grower is PR_NOWAIT, mark this.
if another caller wants to grow the pool and is also PR_NOWAIT,
busy-wait for the original caller, which should either succeed
or hard-fail fairly quickly.

implement the busy-wait by unlocking and relocking this pools
mutex and returning ERESTART.  other methods (such as having
the caller do this) were significantly more code and this hack
is fairly localised.
ok chs@ riastradh@

Don't release the lock in the PR_NOWAIT allocation. Move flags setting
after the acquiring the mutex. (from Tobias Nygren)
apply the change from arch/x86/x86/pmap.c rev. 1.266 commitid vZRjvmxG7YTHLOfA:

In pmap_enter_ma(), only try to allocate pves if we might need them,
and even if that fails, only fail the operation if we later discover
that we really do need them.  If we are replacing an existing mapping,
reuse the pv structure where possible.

This implements the requirement that pmap_enter(PMAP_CANFAIL) must not fail
when replacing an existing mapping with the first mapping of a new page,
which is an unintended consequence of the changes from the rmind-uvmplock
branch in 2011.

The problem arises when pmap_enter(PMAP_CANFAIL) is used to replace an existing
pmap mapping with a mapping of a different page (eg. to resolve a copy-on-write).
If that fails and leaves the old pmap entry in place, then UVM won't hold
the right locks when it eventually retries.  This entanglement of the UVM and
pmap locking was done in rmind-uvmplock in order to improve performance,
but it also means that the UVM state and pmap state need to be kept in sync
more than they did before.  It would be possible to handle this in the UVM code
instead of in the pmap code, but these pmap changes improve the handling of
low memory situations in general, and handling this in UVM would be clunky,
so this seemed like the better way to go.

This somewhat indirectly fixes PR 52706 on the remaining platforms where
this problem existed.

Revision 1.221 / (download) - annotate - [select for diffs], Fri Jan 12 18:54:37 2018 UTC (6 years, 2 months ago) by para
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-base, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: phil-wifi, pgoyette-compat
Changes since 1.220: +3 -3 lines
Diff to previous 1.220 (colored) to selected 1.81 (colored)

fix comment

pool stats are listed 'vmstat -m' not 'vmstat -i'

Revision 1.220 / (download) - annotate - [select for diffs], Fri Dec 29 16:13:26 2017 UTC (6 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.219: +9 -6 lines
Diff to previous 1.219 (colored) to selected 1.81 (colored)

Don't release the lock in the PR_NOWAIT allocation. Move flags setting
after the acquiring the mutex. (from Tobias Nygren)

Revision 1.219 / (download) - annotate - [select for diffs], Sat Dec 16 03:13:29 2017 UTC (6 years, 3 months ago) by mrg
Branch: MAIN
Changes since 1.218: +17 -4 lines
Diff to previous 1.218 (colored) to selected 1.81 (colored)

hopefully workaround the irregularly "fork fails in init" problem.

if a pool is growing, and the grower is PR_NOWAIT, mark this.
if another caller wants to grow the pool and is also PR_NOWAIT,
busy-wait for the original caller, which should either succeed
or hard-fail fairly quickly.

implement the busy-wait by unlocking and relocking this pools
mutex and returning ERESTART.  other methods (such as having
the caller do this) were significantly more code and this hack
is fairly localised.

ok chs@ riastradh@

Revision 1.218 / (download) - annotate - [select for diffs], Mon Dec 4 03:05:24 2017 UTC (6 years, 3 months ago) by mrg
Branch: MAIN
Changes since 1.217: +11 -10 lines
Diff to previous 1.217 (colored) to selected 1.81 (colored)

properly account PR_RECURSIVE pools like vmstat does.

Revision 1.198.2.4 / (download) - annotate - [select for diffs], Sun Dec 3 11:38:45 2017 UTC (6 years, 3 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.198.2.3: +348 -129 lines
Diff to previous 1.198.2.3 (colored) to branchpoint 1.198 (colored) next main 1.199 (colored) to selected 1.81 (colored)

update from HEAD

Revision 1.217 / (download) - annotate - [select for diffs], Sat Dec 2 08:15:42 2017 UTC (6 years, 3 months ago) by mrg
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202
Changes since 1.216: +23 -2 lines
Diff to previous 1.216 (colored) to selected 1.81 (colored)

add two new members to uvmexp_sysctl{}:  bootpages and poolpages.
bootpages is set to the pages allocated via uvm_pageboot_alloc().
poolpages is calculated from the list of pools nr_pages members.

this brings us closer to having a valid total of pages known by
the system, vs actual pages originally managed.

XXX: poolpages needs some handling for PR_RECURSIVE pools still.

Revision 1.216 / (download) - annotate - [select for diffs], Tue Nov 14 15:02:06 2017 UTC (6 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.215: +19 -24 lines
Diff to previous 1.215 (colored) to selected 1.81 (colored)

- fix an assert; we can reach there if we are nowait or limitfail.
- when priming the pool and failing with ERESTART, don't decrement the number
  of pages; this avoids the issue of returning an ERESTART when we get to 0,
  and is more correct.
- simplify the pool_grow code, and don't wakeup things if we ENOMEM.

Revision 1.215 / (download) - annotate - [select for diffs], Thu Nov 9 22:52:26 2017 UTC (6 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.214: +4 -2 lines
Diff to previous 1.214 (colored) to selected 1.81 (colored)

Add assertions that either PR_WAITOK or PR_NOWAIT are set.

Revision 1.214 / (download) - annotate - [select for diffs], Thu Nov 9 19:34:17 2017 UTC (6 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.213: +6 -2 lines
Diff to previous 1.213 (colored) to selected 1.81 (colored)

Handle the ERESTART case from pool_grow()

Revision 1.213 / (download) - annotate - [select for diffs], Thu Nov 9 15:53:40 2017 UTC (6 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.212: +30 -30 lines
Diff to previous 1.212 (colored) to selected 1.81 (colored)

make the KASSERTMSG/panic strings consistent as '%s: [%s], __func__, wchan'

Revision 1.212 / (download) - annotate - [select for diffs], Thu Nov 9 15:40:23 2017 UTC (6 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.211: +5 -3 lines
Diff to previous 1.211 (colored) to selected 1.81 (colored)

Since pr_lock is now used to wait for two things now (PR_GROWING and
PR_WANTED) we need to loop for the condition we wanted.

Revision 1.211 / (download) - annotate - [select for diffs], Mon Nov 6 18:41:22 2017 UTC (6 years, 4 months ago) by riastradh
Branch: MAIN
Changes since 1.210: +12 -3 lines
Diff to previous 1.210 (colored) to selected 1.81 (colored)

Assert that pool_get failure happens only with PR_NOWAIT.

This would have caught the mistake I made last week leading to null
pointer dereferences all over the place, a mistake which I evidently
poorly scheduled alongside maxv's change to the panic message on x86
for null pointer dereferences.

Revision 1.210 / (download) - annotate - [select for diffs], Sun Nov 5 07:49:45 2017 UTC (6 years, 4 months ago) by mlelstv
Branch: MAIN
Changes since 1.209: +10 -2 lines
Diff to previous 1.209 (colored) to selected 1.81 (colored)

pool_grow can now fail even when sleeping is ok. Catch this case in pool_get
and retry.

Revision 1.209 / (download) - annotate - [select for diffs], Sat Oct 28 17:06:43 2017 UTC (6 years, 4 months ago) by riastradh
Branch: MAIN
Changes since 1.208: +33 -4 lines
Diff to previous 1.208 (colored) to selected 1.81 (colored)

Allow only one pending call to a pool's backing allocator at a time.

Candidate fix for problems with hanging after kva fragmentation related
to PR kern/45718.

Proposed on tech-kern:

https://mail-index.NetBSD.org/tech-kern/2017/10/23/msg022472.html

Tested by bouyer@ on i386.

This makes one small change to the semantics of pool_prime and
pool_setlowat: they may fail with EWOULDBLOCK instead of ENOMEM, if
there is a pending call to the backing allocator in another thread but
we are not actually out of memory.  That is unlikely because nearly
always these are used during initialization, when the pool is not in
use.

XXX pullup-8
XXX pullup-7
XXX pullup-6 (requires tweaking the patch)
XXX pullup-5...

Revision 1.203.4.3 / (download) - annotate - [select for diffs], Mon Aug 28 17:53:07 2017 UTC (6 years, 6 months ago) by skrll
Branch: nick-nhusb
Changes since 1.203.4.2: +113 -99 lines
Diff to previous 1.203.4.2 (colored) to branchpoint 1.203 (colored) next main 1.204 (colored) to selected 1.81 (colored)

Sync with HEAD

Revision 1.208 / (download) - annotate - [select for diffs], Thu Jun 8 04:00:01 2017 UTC (6 years, 9 months ago) by chs
Branch: MAIN
CVS Tags: perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825
Changes since 1.207: +69 -4 lines
Diff to previous 1.207 (colored) to selected 1.81 (colored)

add some pool_allocators for pool item sizes larger than PAGE_SIZE.
needed by dtrace.

Revision 1.206.4.1 / (download) - annotate - [select for diffs], Fri Apr 21 16:54:02 2017 UTC (6 years, 10 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.206: +46 -97 lines
Diff to previous 1.206 (colored) next main 1.207 (colored) to selected 1.81 (colored)

Sync with HEAD

Revision 1.206.2.1 / (download) - annotate - [select for diffs], Mon Mar 20 06:57:47 2017 UTC (7 years ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.206: +46 -97 lines
Diff to previous 1.206 (colored) next main 1.207 (colored) to selected 1.81 (colored)

Sync with HEAD

Revision 1.207 / (download) - annotate - [select for diffs], Tue Mar 14 03:13:50 2017 UTC (7 years ago) by riastradh
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, pgoyette-localcount-20170320, netbsd-8-base, matt-nb8-mediatek-base, matt-nb8-mediatek, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1
Branch point for: netbsd-8
Changes since 1.206: +46 -97 lines
Diff to previous 1.206 (colored) to selected 1.81 (colored)

#if DIAGNOSTIC panic ---> KASSERT

- Omit mutex_exit before panic.  No need.
- Sprinkle some more information into a few messages.
- Prefer __diagused over #if DIAGNOSTIC for declarations,
  to reduce conditionals.

ok mrg@

Revision 1.203.4.2 / (download) - annotate - [select for diffs], Sat Mar 19 11:30:31 2016 UTC (8 years ago) by skrll
Branch: nick-nhusb
Changes since 1.203.4.1: +4 -4 lines
Diff to previous 1.203.4.1 (colored) to branchpoint 1.203 (colored) to selected 1.81 (colored)

Sync with HEAD

Revision 1.203.2.1 / (download) - annotate - [select for diffs], Sun Mar 6 17:32:02 2016 UTC (8 years ago) by martin
Branch: netbsd-7
CVS Tags: netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1
Changes since 1.203: +4 -4 lines
Diff to previous 1.203 (colored) next main 1.204 (colored) to selected 1.81 (colored)

Pull up following revision(s) (requested by knakahara in ticket #1103):
	sys/kern/subr_pool.c: revision 1.206
fix: "vmstat -C" CpuLayer showed only the last cpu values.

Revision 1.206 / (download) - annotate - [select for diffs], Fri Feb 5 03:04:52 2016 UTC (8 years, 1 month ago) by knakahara
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20170204, nick-nhusb-base-20161204, nick-nhusb-base-20161004, nick-nhusb-base-20160907, nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, localcount-20160914, bouyer-socketcan-base
Branch point for: pgoyette-localcount, bouyer-socketcan
Changes since 1.205: +4 -4 lines
Diff to previous 1.205 (colored) to selected 1.81 (colored)

fix: "vmstat -C" CpuLayer showed only the last cpu values.

Revision 1.203.4.1 / (download) - annotate - [select for diffs], Tue Sep 22 12:06:07 2015 UTC (8 years, 5 months ago) by skrll
Branch: nick-nhusb
Changes since 1.203: +146 -11 lines
Diff to previous 1.203 (colored) to selected 1.81 (colored)

Sync with HEAD

Revision 1.205 / (download) - annotate - [select for diffs], Mon Aug 24 22:50:32 2015 UTC (8 years, 6 months ago) by pooka
Branch: MAIN
CVS Tags: nick-nhusb-base-20151226, nick-nhusb-base-20150921
Changes since 1.204: +4 -2 lines
Diff to previous 1.204 (colored) to selected 1.81 (colored)

to garnish, dust with _KERNEL_OPT

Revision 1.204 / (download) - annotate - [select for diffs], Tue Jul 28 12:32:44 2015 UTC (8 years, 7 months ago) by maxv
Branch: MAIN
Changes since 1.203: +144 -11 lines
Diff to previous 1.203 (colored) to selected 1.81 (colored)

Introduce POOL_REDZONE.

Revision 1.198.2.3 / (download) - annotate - [select for diffs], Wed Aug 20 00:04:29 2014 UTC (9 years, 7 months ago) by tls
Branch: tls-maxphys
Changes since 1.198.2.2: +104 -5 lines
Diff to previous 1.198.2.2 (colored) to branchpoint 1.198 (colored) to selected 1.81 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.201.2.1 / (download) - annotate - [select for diffs], Sun Aug 10 06:55:58 2014 UTC (9 years, 7 months ago) by tls
Branch: tls-earlyentropy
Changes since 1.201: +103 -5 lines
Diff to previous 1.201 (colored) next main 1.202 (colored) to selected 1.81 (colored)

Rebase.

Revision 1.203 / (download) - annotate - [select for diffs], Fri Jun 13 19:09:07 2014 UTC (9 years, 9 months ago) by joerg
Branch: MAIN
CVS Tags: tls-maxphys-base, tls-earlyentropy-base, nick-nhusb-base-20150606, nick-nhusb-base-20150406, nick-nhusb-base, netbsd-7-base, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0
Branch point for: nick-nhusb, netbsd-7
Changes since 1.202: +101 -3 lines
Diff to previous 1.202 (colored) to selected 1.81 (colored)

Add kern.pool for memory pool stats.

Revision 1.190.2.4 / (download) - annotate - [select for diffs], Thu May 22 11:41:03 2014 UTC (9 years, 9 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.190.2.3: +22 -10 lines
Diff to previous 1.190.2.3 (colored) to branchpoint 1.190 (colored) next main 1.191 (colored) to selected 1.81 (colored)

sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.194.2.2 / (download) - annotate - [select for diffs], Wed May 21 20:34:38 2014 UTC (9 years, 10 months ago) by bouyer
Branch: netbsd-6
Changes since 1.194.2.1: +4 -4 lines
Diff to previous 1.194.2.1 (colored) to branchpoint 1.194 (colored) next main 1.195 (colored) to selected 1.81 (colored)

Pull up following revision(s) (requested by abs in ticket #1054):
	sys/kern/subr_pool.c: revision 1.202
Ensure pool_head is non static - for "vmstat -i"

Revision 1.200.6.1 / (download) - annotate - [select for diffs], Sun May 18 17:46:07 2014 UTC (9 years, 10 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.200: +7 -6 lines
Diff to previous 1.200 (colored) next main 1.201 (colored) to selected 1.81 (colored)

sync with head

Revision 1.202 / (download) - annotate - [select for diffs], Sat Apr 26 16:30:05 2014 UTC (9 years, 10 months ago) by abs
Branch: MAIN
CVS Tags: yamt-pagecache-base9, rmind-smpnet-nbase, rmind-smpnet-base
Changes since 1.201: +4 -4 lines
Diff to previous 1.201 (colored) to selected 1.81 (colored)

Ensure pool_head is non static - for "vmstat -i"

Revision 1.201 / (download) - annotate - [select for diffs], Mon Feb 17 20:40:06 2014 UTC (10 years, 1 month ago) by para
Branch: MAIN
CVS Tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3
Branch point for: tls-earlyentropy
Changes since 1.200: +5 -4 lines
Diff to previous 1.200 (colored) to selected 1.81 (colored)

replace vmem(9) custom boundary tag allocation with a pool(9)

Revision 1.198.2.2 / (download) - annotate - [select for diffs], Sun Jun 23 06:18:58 2013 UTC (10 years, 8 months ago) by tls
Branch: tls-maxphys
Changes since 1.198.2.1: +15 -4 lines
Diff to previous 1.198.2.1 (colored) to branchpoint 1.198 (colored) to selected 1.81 (colored)

resync from head

Revision 1.200 / (download) - annotate - [select for diffs], Mon Mar 11 21:37:54 2013 UTC (11 years ago) by pooka
Branch: MAIN
CVS Tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, khorben-n900, agc-symver-base, agc-symver
Branch point for: rmind-smpnet
Changes since 1.199: +15 -4 lines
Diff to previous 1.199 (colored) to selected 1.81 (colored)

In pool_cache_put_slow(), pool_get() can block (it does mutex_enter()),
so we need to retry if curlwp took a context switch during the call.
Otherwise, CPU-local invariants can get screwed up:

    panic: kernel diagnostic assertion "cur->pcg_avail == cur->pcg_size" failed

This is (was) very easy to reproduce by just running:

  while : ; do RUMP_NCPU=32 ./a.out ; done

where a.out only calls rump_init().  But, any situation there's contention
and a pool doesn't have emptygroups would do.

Revision 1.198.2.1 / (download) - annotate - [select for diffs], Mon Feb 25 00:29:53 2013 UTC (11 years ago) by tls
Branch: tls-maxphys
Changes since 1.198: +4 -4 lines
Diff to previous 1.198 (colored) to selected 1.81 (colored)

resync with head

Revision 1.199 / (download) - annotate - [select for diffs], Sat Feb 9 00:31:21 2013 UTC (11 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.198: +4 -4 lines
Diff to previous 1.198 (colored) to selected 1.81 (colored)

printflike maintenance.

Revision 1.190.2.3 / (download) - annotate - [select for diffs], Tue Oct 30 17:22:34 2012 UTC (11 years, 4 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.190.2.2: +35 -47 lines
Diff to previous 1.190.2.2 (colored) to branchpoint 1.190 (colored) to selected 1.81 (colored)

sync with head

Revision 1.198 / (download) - annotate - [select for diffs], Tue Aug 28 15:52:19 2012 UTC (11 years, 6 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6
Branch point for: tls-maxphys
Changes since 1.197: +6 -2 lines
Diff to previous 1.197 (colored) to selected 1.81 (colored)

proper locking for DEBUG

Revision 1.194.2.1 / (download) - annotate - [select for diffs], Mon Jul 2 19:04:42 2012 UTC (11 years, 8 months ago) by jdc
Branch: netbsd-6
CVS Tags: netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus
Changes since 1.194: +10 -21 lines
Diff to previous 1.194 (colored) to selected 1.81 (colored)

Pull up revisions:
  src/sys/kern/subr_pool.c revision 1.196
  src/share/man/man9/pool_cache.9 patch
(requested by jym in ticket #366).

As pool reclaiming is unlikely to happen at interrupt or softint
context, re-enable the portion of code that allows invalidation of
CPU-bound pool caches.

Two reasons:
- CPU cached objects being invalidated, the probability of fetching an
obsolete object from the pool_cache(9) is greatly reduced. This speeds
up pool_cache_get() quite a bit as it does not have to keep destroying
objects until it finds an updated one when an invalidation is in progress.

- for situations where we have to ensure that no obsolete object remains
after a state transition (canonical example: pmap mappings between Xen
VM restoration), invalidating all pool_cache(9) is the safest way to go.

As it uses xcall(9) to broadcast the execution of pool_cache_transfer(),
pool_cache_invalidate() cannot be called from interrupt or softint
context (scheduling a xcall(9) can put a LWP to sleep).

pool_cache_xcall() => pool_cache_transfer() to reflect its use.

Invalidation being a costly process (1000s objects may be destroyed),
all places where pool_cache_invalidate() may be called from
interrupt/softint context will now get caught by the proper KASSERT(),
and fixed. Ping me when you see one.

Tested under i386 and amd64 by running ATF suite within 64MiB HVM
domains (tried triggering pgdaemon a few times).

No objection on tech-kern@.

XXX a similar fix has to be pulled up to NetBSD-6, but with a more
conservative approach.

See http://mail-index.netbsd.org/tech-kern/2012/05/29/msg013245.html

Revision 1.197 / (download) - annotate - [select for diffs], Tue Jun 5 22:51:47 2012 UTC (11 years, 9 months ago) by jym
Branch: MAIN
Changes since 1.196: +11 -35 lines
Diff to previous 1.196 (colored) to selected 1.81 (colored)

Now that pool_cache_invalidate() is synchronous and can handle per-CPU
caches, merge together pool_drain_start() and pool_drain_end() into

bool pool_drain(struct pool **ppp);

"bool" value indicates whether reclaiming was fully done (true) or not (false)
"ppp" will contain a pointer to the pool that was drained (optional).

See http://mail-index.netbsd.org/tech-kern/2012/06/04/msg013287.html

Revision 1.196 / (download) - annotate - [select for diffs], Tue Jun 5 22:28:11 2012 UTC (11 years, 9 months ago) by jym
Branch: MAIN
Changes since 1.195: +23 -15 lines
Diff to previous 1.195 (colored) to selected 1.81 (colored)

As pool reclaiming is unlikely to happen at interrupt or softint
context, re-enable the portion of code that allows invalidation of CPU-bound
pool caches.

Two reasons:
- CPU cached objects being invalidated, the probability of fetching an
obsolete object from the pool_cache(9) is greatly reduced. This speeds up
pool_cache_get() quite a bit as it does not have to keep destroying objects
until it finds an updated one when an invalidation is in progress.

- for situations where we have to ensure that no obsolete object remains
after a state transition (canonical example: pmap mappings between Xen VM
restoration), invalidating all pool_cache(9) is the safest way to go.

As it uses xcall(9) to broadcast the execution of pool_cache_transfer(),
pool_cache_invalidate() cannot be called from interrupt or softint context
(scheduling a xcall(9) can put a LWP to sleep).

pool_cache_xcall() => pool_cache_transfer() to reflect its use.

Invalidation being a costly process (1000s objects may be destroyed),
all places where pool_cache_invalidate() may be called from
interrupt/softint context will now get caught by the proper KASSERT(), and
fixed. Ping me when you see one.

Tested under i386 and amd64 by running ATF suite within 64MiB HVM
domains (tried triggering pgdaemon a few times).

No objection on tech-kern@.

XXX a similar fix has to be pulled up to NetBSD-6, but with a more
conservative approach.

See http://mail-index.netbsd.org/tech-kern/2012/05/29/msg013245.html

Revision 1.190.6.2 / (download) - annotate - [select for diffs], Sat Jun 2 11:09:33 2012 UTC (11 years, 9 months ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.190.6.1: +3 -237 lines
Diff to previous 1.190.6.1 (colored) to branchpoint 1.190 (colored) next main 1.191 (colored) to selected 1.81 (colored)

sync to latest -current.

Revision 1.190.2.2 / (download) - annotate - [select for diffs], Wed May 23 10:08:11 2012 UTC (11 years, 9 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.190.2.1: +3 -237 lines
Diff to previous 1.190.2.1 (colored) to branchpoint 1.190 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.195 / (download) - annotate - [select for diffs], Sat May 5 19:15:10 2012 UTC (11 years, 10 months ago) by rmind
Branch: MAIN
CVS Tags: yamt-pagecache-base5, jmcneill-usbmp-base10
Changes since 1.194: +3 -237 lines
Diff to previous 1.194 (colored) to selected 1.81 (colored)

G/C POOL_DIAGNOSTIC option.  No objection on tech-kern@.

Revision 1.190.2.1 / (download) - annotate - [select for diffs], Tue Apr 17 00:08:28 2012 UTC (11 years, 11 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.190: +91 -197 lines
Diff to previous 1.190 (colored) to selected 1.81 (colored)

sync with head

Revision 1.190.6.1 / (download) - annotate - [select for diffs], Sat Feb 18 07:35:32 2012 UTC (12 years, 1 month ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.190: +91 -197 lines
Diff to previous 1.190 (colored) to selected 1.81 (colored)

merge to -current.

Revision 1.194 / (download) - annotate - [select for diffs], Sat Feb 4 22:11:42 2012 UTC (12 years, 1 month ago) by para
Branch: MAIN
CVS Tags: yamt-pagecache-base4, netbsd-6-base, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2
Branch point for: netbsd-6
Changes since 1.193: +4 -24 lines
Diff to previous 1.193 (colored) to selected 1.81 (colored)

make acorn26 compile by fixing up subpage pool allocations

ok: riz@

Revision 1.193 / (download) - annotate - [select for diffs], Sun Jan 29 20:20:18 2012 UTC (12 years, 1 month ago) by he
Branch: MAIN
Changes since 1.192: +5 -3 lines
Diff to previous 1.192 (colored) to selected 1.81 (colored)

Use the same style for initialization of pool_allocator_kmem under
POOL_SUBPAGE as all the other poll_allocator structs.  Fixes build
problem for acorn26.

Revision 1.192 / (download) - annotate - [select for diffs], Sat Jan 28 00:00:06 2012 UTC (12 years, 1 month ago) by rmind
Branch: MAIN
Changes since 1.191: +24 -26 lines
Diff to previous 1.191 (colored) to selected 1.81 (colored)

pool_page_alloc, pool_page_alloc_meta: avoid extra compare, use const.
ffs_mountfs,sys_swapctl: replace memset with kmem_zalloc.
sys_swapctl: move kmem_free outside the lock path.
uvm_init: fix comment, remove pointless numeration of steps.
uvm_map_enter: remove meflagval variable.
Fix some indentation.

Revision 1.191 / (download) - annotate - [select for diffs], Fri Jan 27 19:48:40 2012 UTC (12 years, 1 month ago) by para
Branch: MAIN
Changes since 1.190: +86 -172 lines
Diff to previous 1.190 (colored) to selected 1.81 (colored)

extending vmem(9) to be able to allocated resources for it's own needs.
simplifying uvm_map handling (no special kernel entries anymore no relocking)
make malloc(9) a thin wrapper around kmem(9)
(with private interface for interrupt safety reasons)

releng@ acknowledged

Revision 1.190 / (download) - annotate - [select for diffs], Tue Sep 27 01:02:39 2011 UTC (12 years, 5 months ago) by jym
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache, jmcneill-usbmp
Changes since 1.189: +4 -4 lines
Diff to previous 1.189 (colored) to selected 1.81 (colored)

Modify *ASSERTMSG() so they are now used as variadic macros. The main goal
is to provide routines that do as KASSERT(9) says: append a message
to the panic format string when the assertion triggers, with optional
arguments.

Fix call sites to reflect the new definition.

Discussed on tech-kern@. See
http://mail-index.netbsd.org/tech-kern/2011/09/07/msg011427.html

Revision 1.186.2.1 / (download) - annotate - [select for diffs], Mon Jun 6 09:09:35 2011 UTC (12 years, 9 months ago) by jruoho
Branch: jruoho-x86intr
Changes since 1.186: +8 -3 lines
Diff to previous 1.186 (colored) next main 1.187 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.182.4.4 / (download) - annotate - [select for diffs], Thu Apr 21 01:42:09 2011 UTC (12 years, 11 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.182.4.3: +2 -0 lines
Diff to previous 1.182.4.3 (colored) to branchpoint 1.182 (colored) next main 1.183 (colored) to selected 1.81 (colored)

sync with head

Revision 1.189 / (download) - annotate - [select for diffs], Tue Mar 22 15:16:23 2011 UTC (13 years ago) by pooka
Branch: MAIN
CVS Tags: rmind-uvmplock-nbase, rmind-uvmplock-base, cherry-xenmp-base, cherry-xenmp
Changes since 1.188: +4 -2 lines
Diff to previous 1.188 (colored) to selected 1.81 (colored)

pnbuf_cache is used all over the place outside of vfs, so put it
in one place to avoid many definitions.

Revision 1.182.4.3 / (download) - annotate - [select for diffs], Sat Mar 5 20:55:19 2011 UTC (13 years ago) by rmind
Branch: rmind-uvmplock
Changes since 1.182.4.2: +6 -3 lines
Diff to previous 1.182.4.2 (colored) to branchpoint 1.182 (colored) to selected 1.81 (colored)

sync with head

Revision 1.188 / (download) - annotate - [select for diffs], Mon Jan 17 07:36:58 2011 UTC (13 years, 2 months ago) by uebayasi
Branch: MAIN
CVS Tags: bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Changes since 1.187: +3 -0 lines
Diff to previous 1.187 (colored) to selected 1.81 (colored)

Fix a conditional include.

Revision 1.187 / (download) - annotate - [select for diffs], Mon Jan 17 07:13:32 2011 UTC (13 years, 2 months ago) by uebayasi
Branch: MAIN
Changes since 1.186: +3 -3 lines
Diff to previous 1.186 (colored) to selected 1.81 (colored)

Include internal definitions (uvm/uvm.h) only where necessary.

Revision 1.182.2.2 / (download) - annotate - [select for diffs], Tue Aug 17 06:47:30 2010 UTC (13 years, 7 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.182.2.1: +30 -15 lines
Diff to previous 1.182.2.1 (colored) to branchpoint 1.182 (colored) next main 1.183 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.158.2.5 / (download) - annotate - [select for diffs], Wed Aug 11 22:54:42 2010 UTC (13 years, 7 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.158.2.4: +38 -22 lines
Diff to previous 1.158.2.4 (colored) to branchpoint 1.158 (colored) next main 1.159 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.182.4.2 / (download) - annotate - [select for diffs], Sat Jul 3 01:19:54 2010 UTC (13 years, 8 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.182.4.1: +8 -5 lines
Diff to previous 1.182.4.1 (colored) to branchpoint 1.182 (colored) to selected 1.81 (colored)

sync with head

Revision 1.186 / (download) - annotate - [select for diffs], Thu Jun 3 10:40:17 2010 UTC (13 years, 9 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, matt-mips64-premerge-20101231, jruoho-x86intr-base
Branch point for: jruoho-x86intr
Changes since 1.185: +8 -5 lines
Diff to previous 1.185 (colored) to selected 1.81 (colored)

Report result of pool_reclaim() from pool_drain_end().

Revision 1.182.4.1 / (download) - annotate - [select for diffs], Sun May 30 05:17:58 2010 UTC (13 years, 9 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.182: +32 -19 lines
Diff to previous 1.182 (colored) to selected 1.81 (colored)

sync with head

Revision 1.185 / (download) - annotate - [select for diffs], Wed May 12 08:11:16 2010 UTC (13 years, 10 months ago) by rmind
Branch: MAIN
Changes since 1.184: +5 -4 lines
Diff to previous 1.184 (colored) to selected 1.81 (colored)

pool_{cache_}get: improve previous diagnostic by checking for panicstr,
so it wont trigger the assert while trying to dump core on crash.

Revision 1.184 / (download) - annotate - [select for diffs], Wed May 12 03:43:46 2010 UTC (13 years, 10 months ago) by rmind
Branch: MAIN
Changes since 1.183: +25 -14 lines
Diff to previous 1.183 (colored) to selected 1.81 (colored)

- Sprinkle asserts to catch calls from interrupt context on IPL_NONE pools.
- Add diagnostic drain attempt.

Revision 1.182.2.1 / (download) - annotate - [select for diffs], Fri Apr 30 14:44:12 2010 UTC (13 years, 10 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.182: +8 -7 lines
Diff to previous 1.182 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.183 / (download) - annotate - [select for diffs], Sun Apr 25 11:49:04 2010 UTC (13 years, 10 months ago) by ad
Branch: MAIN
CVS Tags: uebayasi-xip-base1
Changes since 1.182: +8 -7 lines
Diff to previous 1.182 (colored) to selected 1.81 (colored)

MAXCPUS -> __arraycount

Revision 1.158.2.4 / (download) - annotate - [select for diffs], Thu Mar 11 15:04:18 2010 UTC (14 years ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.158.2.3: +99 -38 lines
Diff to previous 1.158.2.3 (colored) to branchpoint 1.158 (colored) to selected 1.81 (colored)

sync with head

Revision 1.182 / (download) - annotate - [select for diffs], Wed Jan 20 23:40:42 2010 UTC (14 years, 2 months ago) by rmind
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, uebayasi-xip-base
Branch point for: uebayasi-xip, rmind-uvmplock
Changes since 1.181: +4 -3 lines
Diff to previous 1.181 (colored) to selected 1.81 (colored)

pool_cache_invalidate: comment out invalidation of per-CPU caches (nobody depends
on it, at the moment) until we decide how to fix it (xcall(9) cannot be used from
interrupt context).  XXX: Perhaps implement XC_HIGHPRI.

Revision 1.181 / (download) - annotate - [select for diffs], Sun Jan 3 09:42:22 2010 UTC (14 years, 2 months ago) by mlelstv
Branch: MAIN
Changes since 1.180: +6 -6 lines
Diff to previous 1.180 (colored) to selected 1.81 (colored)

drop __predict micro optimization in pool_init for cleaner code.

Revision 1.180 / (download) - annotate - [select for diffs], Sun Jan 3 01:07:19 2010 UTC (14 years, 2 months ago) by mlelstv
Branch: MAIN
Changes since 1.179: +6 -4 lines
Diff to previous 1.179 (colored) to selected 1.81 (colored)

Pools are created way before the pool subsystem mutexes are
initialized.

Ignore also pool_allocator_lock while the system is in cold state.

When the system has left cold state, uvm_init() should have
also initialized the pool subsystem and the mutexes are
ready to use.

Revision 1.179 / (download) - annotate - [select for diffs], Sat Jan 2 15:20:39 2010 UTC (14 years, 2 months ago) by mlelstv
Branch: MAIN
Changes since 1.178: +21 -17 lines
Diff to previous 1.178 (colored) to selected 1.81 (colored)

Move initialization of pool_allocator_lock before its first use.
This failed on archs where a mutex isn't initialized to a zero
value.

Defer allocation of pool log to the logging action, if allocation
fails, it will be retried the next time something is logged.

Clear pool log on allocation so that ddb doesn't crash when showing
so far unused log entries.

Revision 1.178 / (download) - annotate - [select for diffs], Wed Dec 30 18:57:17 2009 UTC (14 years, 2 months ago) by elad
Branch: MAIN
Changes since 1.177: +15 -4 lines
Diff to previous 1.177 (colored) to selected 1.81 (colored)

Turn PA_INITIALIZED to a reference count for the pool allocator, and once
it drops to zero destroy the mutex we initialize. This fixes the problem
mentioned in

	http://mail-index.netbsd.org/tech-kern/2009/12/28/msg006727.html

Also remove pa_flags now that it's no longer needed.

Idea from matt@, okay matt@.

Revision 1.177 / (download) - annotate - [select for diffs], Tue Oct 20 17:24:22 2009 UTC (14 years, 5 months ago) by jym
Branch: MAIN
CVS Tags: matt-premerge-20091211, jym-xensuspend-nbase
Changes since 1.176: +3 -3 lines
Diff to previous 1.176 (colored) to selected 1.81 (colored)

Fix a bug where on MP systems, pool_cache_invalidate(9) could be called
early during boot, just after CPUs are attached but before they are marked
as running.

This will result in a list of CPUs without the SPCF_RUNNING flag set, and
will trigger the 'KASSERT(xc_tailp < xc_headp)' in xc_lowpri() as no cross
call is issued.

Bug reported and patch tested by tron@.

See also http://mail-index.netbsd.org/tech-kern/2009/10/19/msg006293.html

Revision 1.176 / (download) - annotate - [select for diffs], Thu Oct 15 20:50:12 2009 UTC (14 years, 5 months ago) by thorpej
Branch: MAIN
Changes since 1.175: +24 -16 lines
Diff to previous 1.175 (colored) to selected 1.81 (colored)

- pool_cache_invalidate(): broadcast a cross-call to drain the per-CPU
  caches before draining the global cache.
- pool_cache_invalidate_local(): remove.

Revision 1.175 / (download) - annotate - [select for diffs], Thu Oct 8 21:54:45 2009 UTC (14 years, 5 months ago) by jym
Branch: MAIN
Changes since 1.174: +54 -19 lines
Diff to previous 1.174 (colored) to selected 1.81 (colored)

Add pool_cache_invalidate_local() to the pool_cache(9) API, to permit
per-CPU objects invalidation when cached in the pool cache.

See http://mail-index.netbsd.org/tech-kern/2009/10/05/msg006206.html .

Reviewed by bouyer@. Thanks!

Revision 1.158.2.3 / (download) - annotate - [select for diffs], Wed Sep 16 13:38:01 2009 UTC (14 years, 6 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.158.2.2: +3 -10 lines
Diff to previous 1.158.2.2 (colored) to branchpoint 1.158 (colored) to selected 1.81 (colored)

sync with head

Revision 1.174 / (download) - annotate - [select for diffs], Sun Sep 13 18:45:11 2009 UTC (14 years, 6 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8
Changes since 1.173: +2 -9 lines
Diff to previous 1.173 (colored) to selected 1.81 (colored)

Wipe out the last vestiges of POOL_INIT with one swift stroke.  In
most cases, use a proper constructor.  For proplib, give a local
equivalent of POOL_INIT for the kernel object implementation.  This
way the code structure can be preserved, and a local link set is
not hazardous anyway (unless proplib is split to several modules,
but that'll be the day).

tested by booting a kernel in qemu and compile-testing i386/ALL

Revision 1.173 / (download) - annotate - [select for diffs], Sat Aug 29 00:09:02 2009 UTC (14 years, 6 months ago) by rmind
Branch: MAIN
Changes since 1.172: +3 -3 lines
Diff to previous 1.172 (colored) to selected 1.81 (colored)

Make pool_head static.

Revision 1.171.4.1 / (download) - annotate - [select for diffs], Wed May 13 17:21:57 2009 UTC (14 years, 10 months ago) by jym
Branch: jym-xensuspend
Changes since 1.171: +3 -2 lines
Diff to previous 1.171 (colored) next main 1.172 (colored) to selected 1.81 (colored)

Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.

Revision 1.158.2.2 / (download) - annotate - [select for diffs], Mon May 4 08:13:48 2009 UTC (14 years, 10 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.158.2.1: +123 -162 lines
Diff to previous 1.158.2.1 (colored) to branchpoint 1.158 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.170.2.2 / (download) - annotate - [select for diffs], Tue Apr 28 07:37:00 2009 UTC (14 years, 10 months ago) by skrll
Branch: nick-hppapmap
Changes since 1.170.2.1: +3 -2 lines
Diff to previous 1.170.2.1 (colored) to branchpoint 1.170 (colored) next main 1.171 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.172 / (download) - annotate - [select for diffs], Wed Apr 15 11:45:18 2009 UTC (14 years, 11 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, yamt-nfs-mp-base4, yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base, jymxensuspend-base, jym-xensuspend-base
Changes since 1.171: +3 -2 lines
Diff to previous 1.171 (colored) to selected 1.81 (colored)

pool_cache_put_paddr: add an assertion.

Revision 1.170.2.1 / (download) - annotate - [select for diffs], Mon Jan 19 13:19:39 2009 UTC (15 years, 2 months ago) by skrll
Branch: nick-hppapmap
Changes since 1.170: +22 -11 lines
Diff to previous 1.170 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.151.6.4 / (download) - annotate - [select for diffs], Sat Jan 17 13:29:19 2009 UTC (15 years, 2 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.151.6.3: +21 -10 lines
Diff to previous 1.151.6.3 (colored) to branchpoint 1.151 (colored) next main 1.152 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.165.2.3 / (download) - annotate - [select for diffs], Sat Dec 13 01:15:08 2008 UTC (15 years, 3 months ago) by haad
Branch: haad-dm
Changes since 1.165.2.2: +22 -11 lines
Diff to previous 1.165.2.2 (colored) next main 1.166 (colored) to selected 1.81 (colored)

Update haad-dm branch to haad-dm-base2.

Revision 1.170.4.1 / (download) - annotate - [select for diffs], Mon Nov 17 18:46:11 2008 UTC (15 years, 4 months ago) by snj
Branch: netbsd-5
CVS Tags: netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b
Changes since 1.170: +22 -11 lines
Diff to previous 1.170 (colored) next main 1.171 (colored) to selected 1.81 (colored)

Pull up following revision(s) (requested by ad in ticket #72):
	sys/kern/subr_pool.c: revision 1.171
Avoid recursive mutex_enter() when the system is low on KVA.
Should fix crash reported by riz on current-users.

Revision 1.171 / (download) - annotate - [select for diffs], Tue Nov 11 16:13:03 2008 UTC (15 years, 4 months ago) by ad
Branch: MAIN
CVS Tags: nick-hppapmap-base2, mjf-devfs2-base, haad-nbase2, haad-dm-base2, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Branch point for: jym-xensuspend
Changes since 1.170: +22 -11 lines
Diff to previous 1.170 (colored) to selected 1.81 (colored)

Avoid recursive mutex_enter() when the system is low on KVA.
Should fix crash reported by riz on current-users.

Revision 1.165.2.2 / (download) - annotate - [select for diffs], Sun Oct 19 22:17:28 2008 UTC (15 years, 5 months ago) by haad
Branch: haad-dm
Changes since 1.165.2.1: +3006 -0 lines
Diff to previous 1.165.2.1 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.170 / (download) - annotate - [select for diffs], Wed Oct 15 08:13:17 2008 UTC (15 years, 5 months ago) by ad
Branch: MAIN
CVS Tags: netbsd-5-base, matt-mips64-base2, haad-dm-base1
Branch point for: nick-hppapmap, netbsd-5
Changes since 1.169: +3 -3 lines
Diff to previous 1.169 (colored) to selected 1.81 (colored)

- Rename cpu_lookup_byindex() to cpu_lookup(). The hardware ID isn't of
  interest to MI code. No functional change.
- Change /dev/cpu to operate on cpu index, not hardware ID. Now cpuctl
  shouldn't print confused output.

Revision 1.151.6.3 / (download) - annotate - [select for diffs], Sun Sep 28 10:40:53 2008 UTC (15 years, 5 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.151.6.2: +109 -154 lines
Diff to previous 1.151.6.2 (colored) to branchpoint 1.151 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.160.2.2 / (download) - annotate - [select for diffs], Thu Sep 18 04:31:43 2008 UTC (15 years, 6 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.160.2.1: +111 -156 lines
Diff to previous 1.160.2.1 (colored) to branchpoint 1.160 (colored) next main 1.161 (colored) to selected 1.81 (colored)

Sync with wrstuden-revivesa-base-2.

Revision 1.169 / (download) - annotate - [select for diffs], Mon Aug 11 02:48:42 2008 UTC (15 years, 7 months ago) by yamt
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2
Changes since 1.168: +7 -7 lines
Diff to previous 1.168 (colored) to selected 1.81 (colored)

make pcg_dummy const to catch bugs earlier.

Revision 1.168 / (download) - annotate - [select for diffs], Mon Aug 11 02:46:40 2008 UTC (15 years, 7 months ago) by yamt
Branch: MAIN
Changes since 1.167: +10 -2 lines
Diff to previous 1.167 (colored) to selected 1.81 (colored)

add some KASSERTs.

Revision 1.167 / (download) - annotate - [select for diffs], Fri Aug 8 16:58:01 2008 UTC (15 years, 7 months ago) by skrll
Branch: MAIN
Changes since 1.166: +3 -3 lines
Diff to previous 1.166 (colored) to selected 1.81 (colored)

Comment whitespace.

Revision 1.161.2.1 / (download) - annotate - [select for diffs], Fri Jul 18 16:37:49 2008 UTC (15 years, 8 months ago) by simonb
Branch: simonb-wapbl
Changes since 1.161: +102 -155 lines
Diff to previous 1.161 (colored) next main 1.162 (colored) to selected 1.81 (colored)

Sync with head.

Revision 1.166 / (download) - annotate - [select for diffs], Wed Jul 9 02:43:53 2008 UTC (15 years, 8 months ago) by yamt
Branch: MAIN
CVS Tags: simonb-wapbl-nbase, simonb-wapbl-base
Changes since 1.165: +2 -5 lines
Diff to previous 1.165 (colored) to selected 1.81 (colored)

pool_do_put: fix a pool corruption bug discovered by
the recent exec_pool changes.

Revision 1.165.2.1, Mon Jul 7 12:27:19 2008 UTC (15 years, 8 months ago) by haad
Branch: haad-dm
Changes since 1.165: +0 -3001 lines
FILE REMOVED

file subr_pool.c was added on branch haad-dm on 2008-10-19 22:17:28 +0000

Revision 1.165 / (download) - annotate - [select for diffs], Mon Jul 7 12:27:19 2008 UTC (15 years, 8 months ago) by yamt
Branch: MAIN
Branch point for: haad-dm
Changes since 1.164: +10 -6 lines
Diff to previous 1.164 (colored) to selected 1.81 (colored)

fix pool corruption bugs in subr_pool.c 1.162.

Revision 1.164 / (download) - annotate - [select for diffs], Fri Jul 4 16:41:00 2008 UTC (15 years, 8 months ago) by ad
Branch: MAIN
Changes since 1.163: +3 -3 lines
Diff to previous 1.163 (colored) to selected 1.81 (colored)

Move an assignment later.

Revision 1.163 / (download) - annotate - [select for diffs], Fri Jul 4 16:38:59 2008 UTC (15 years, 8 months ago) by ad
Branch: MAIN
Changes since 1.162: +30 -44 lines
Diff to previous 1.162 (colored) to selected 1.81 (colored)

- Keep cache locked while allocating a cache group - later we might want
  to automatically tune the group sizes at run time.
- Fix broken assertion.
- Avoid another test+branch.

Revision 1.162 / (download) - annotate - [select for diffs], Fri Jul 4 13:28:08 2008 UTC (15 years, 8 months ago) by ad
Branch: MAIN
Changes since 1.161: +110 -150 lines
Diff to previous 1.161 (colored) to selected 1.81 (colored)

Remove a bunch of conditional branches from the pool_cache fast path.

Revision 1.160.2.1 / (download) - annotate - [select for diffs], Mon Jun 23 04:31:51 2008 UTC (15 years, 8 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.160: +5 -11 lines
Diff to previous 1.160 (colored) to selected 1.81 (colored)

Sync w/ -current. 34 merge conflicts to follow.

Revision 1.156.2.2 / (download) - annotate - [select for diffs], Wed Jun 4 02:05:39 2008 UTC (15 years, 9 months ago) by yamt
Branch: yamt-pf42
Changes since 1.156.2.1: +5 -11 lines
Diff to previous 1.156.2.1 (colored) to branchpoint 1.156 (colored) next main 1.157 (colored) to selected 1.81 (colored)

sync with head

Revision 1.151.6.2 / (download) - annotate - [select for diffs], Mon Jun 2 13:24:11 2008 UTC (15 years, 9 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.151.6.1: +9 -38 lines
Diff to previous 1.151.6.1 (colored) to branchpoint 1.151 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.161 / (download) - annotate - [select for diffs], Sat May 31 13:31:25 2008 UTC (15 years, 9 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-base4, yamt-pf42-base3, wrstuden-revivesa-base-1, wrstuden-revivesa-base
Branch point for: simonb-wapbl
Changes since 1.160: +5 -11 lines
Diff to previous 1.160 (colored) to selected 1.81 (colored)

Use __noinline.

Revision 1.156.2.1 / (download) - annotate - [select for diffs], Sun May 18 12:35:09 2008 UTC (15 years, 10 months ago) by yamt
Branch: yamt-pf42
Changes since 1.156: +8 -31 lines
Diff to previous 1.156 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.158.2.1 / (download) - annotate - [select for diffs], Fri May 16 02:25:26 2008 UTC (15 years, 10 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.158: +4 -11 lines
Diff to previous 1.158 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.160 / (download) - annotate - [select for diffs], Mon Apr 28 20:24:04 2008 UTC (15 years, 10 months ago) by martin
Branch: MAIN
CVS Tags: yamt-pf42-base2, yamt-nfs-mp-base2, hpcarm-cleanup-nbase
Branch point for: wrstuden-revivesa
Changes since 1.159: +2 -9 lines
Diff to previous 1.159 (colored) to selected 1.81 (colored)

Remove clause 3 and 4 from TNF licenses

Revision 1.159 / (download) - annotate - [select for diffs], Mon Apr 28 15:36:01 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.158: +4 -4 lines
Diff to previous 1.158 (colored) to selected 1.81 (colored)

Add MI code to support in-kernel preemption. Preemption is deferred by
one of the following:

- Holding kernel_lock (indicating that the code is not MT safe).
- Bracketing critical sections with kpreempt_disable/kpreempt_enable.
- Holding the interrupt priority level above IPL_NONE.

Statistics on kernel preemption are reported via event counters, and
where preemption is deferred for some reason, it's also reported via
lockstat. The LWP priority at which preemption is triggered is tuneable
via sysctl.

Revision 1.158 / (download) - annotate - [select for diffs], Sun Apr 27 11:37:48 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
CVS Tags: yamt-nfs-mp-base
Branch point for: yamt-nfs-mp
Changes since 1.157: +4 -4 lines
Diff to previous 1.157 (colored) to selected 1.81 (colored)

- Rename crit_enter/crit_exit to kpreempt_disable/kpreempt_enable.
  DragonflyBSD uses the crit names for something quite different.
- Add a kpreempt_disabled function for diagnostic assertions.
- Add inline versions of kpreempt_enable/kpreempt_disable for primitives.
- Make some more changes for preemption safety to the x86 pmap.

Revision 1.157 / (download) - annotate - [select for diffs], Thu Apr 24 11:38:36 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.156: +6 -22 lines
Diff to previous 1.156 (colored) to selected 1.81 (colored)

Merge the socket locking patch:

- Socket layer becomes MP safe.
- Unix protocols become MP safe.
- Allows protocol processing interrupts to safely block on locks.
- Fixes a number of race conditions.

With much feedback from matt@ and plunky@.

Revision 1.151.6.1 / (download) - annotate - [select for diffs], Thu Apr 3 12:43:03 2008 UTC (15 years, 11 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.151: +14 -15 lines
Diff to previous 1.151 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.156 / (download) - annotate - [select for diffs], Thu Mar 27 18:30:15 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base
Branch point for: yamt-pf42
Changes since 1.155: +6 -8 lines
Diff to previous 1.155 (colored) to selected 1.81 (colored)

Replace use of CACHE_LINE_SIZE in some obvious places.

Revision 1.101.2.13 / (download) - annotate - [select for diffs], Mon Mar 24 09:39:02 2008 UTC (15 years, 11 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.101.2.12: +6 -4 lines
Diff to previous 1.101.2.12 (colored) next main 1.102 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.151.2.1 / (download) - annotate - [select for diffs], Mon Mar 24 07:16:14 2008 UTC (15 years, 11 months ago) by keiichi
Branch: keiichi-mipv6
Changes since 1.151: +10 -9 lines
Diff to previous 1.151 (colored) next main 1.152 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.131.2.4 / (download) - annotate - [select for diffs], Sun Mar 23 02:05:00 2008 UTC (16 years ago) by matt
Branch: matt-armv6
Changes since 1.131.2.3: +23 -20 lines
Diff to previous 1.131.2.3 (colored) to branchpoint 1.131 (colored) next main 1.132 (colored) to selected 1.81 (colored)

sync with HEAD

Revision 1.155 / (download) - annotate - [select for diffs], Mon Mar 17 17:05:54 2008 UTC (16 years ago) by ad
Branch: MAIN
CVS Tags: yamt-lazymbuf-base15, yamt-lazymbuf-base14, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, ad-socklock-base1
Changes since 1.154: +6 -4 lines
Diff to previous 1.154 (colored) to selected 1.81 (colored)

Make them compile again.

Revision 1.101.2.12 / (download) - annotate - [select for diffs], Mon Mar 17 09:15:34 2008 UTC (16 years ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.101.2.11: +6 -7 lines
Diff to previous 1.101.2.11 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.154 / (download) - annotate - [select for diffs], Mon Mar 17 08:27:50 2008 UTC (16 years ago) by yamt
Branch: MAIN
Changes since 1.153: +4 -4 lines
Diff to previous 1.153 (colored) to selected 1.81 (colored)

- simplify ASSERT_SLEEPABLE.
- move it from proc.h to systm.h.
- add some more checks.
- make it a little more lkm friendly.

Revision 1.153 / (download) - annotate - [select for diffs], Mon Mar 10 22:20:14 2008 UTC (16 years ago) by martin
Branch: MAIN
Changes since 1.152: +3 -3 lines
Diff to previous 1.152 (colored) to selected 1.81 (colored)

Use cpu index instead of the machine dependend, not very expressive
cpuid when naming user-visible kernel entities.

Revision 1.152 / (download) - annotate - [select for diffs], Sun Mar 2 12:19:58 2008 UTC (16 years ago) by yamt
Branch: MAIN
Changes since 1.151: +3 -4 lines
Diff to previous 1.151 (colored) to selected 1.81 (colored)

pool_do_put: remove pa_starved_p check for now as it seems to cause
more problems than it solves.  PR/37993 from Greg A. Woods.

Revision 1.101.2.11 / (download) - annotate - [select for diffs], Wed Feb 27 08:36:56 2008 UTC (16 years ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.101.2.10: +13 -13 lines
Diff to previous 1.101.2.10 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.133.4.4 / (download) - annotate - [select for diffs], Mon Feb 18 21:06:47 2008 UTC (16 years, 1 month ago) by mjf
Branch: mjf-devfs
Changes since 1.133.4.3: +78 -57 lines
Diff to previous 1.133.4.3 (colored) to branchpoint 1.133 (colored) next main 1.134 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.151 / (download) - annotate - [select for diffs], Thu Feb 14 11:45:24 2008 UTC (16 years, 1 month ago) by yamt
Branch: MAIN
CVS Tags: nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, hpcarm-cleanup-base
Branch point for: mjf-devfs2, keiichi-mipv6
Changes since 1.150: +13 -13 lines
Diff to previous 1.150 (colored) to selected 1.81 (colored)

use time_uptime instead of getmicrotime() for ph_time.

Revision 1.101.2.10 / (download) - annotate - [select for diffs], Mon Feb 11 14:59:58 2008 UTC (16 years, 1 month ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.101.2.9: +3 -3 lines
Diff to previous 1.101.2.9 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.150 / (download) - annotate - [select for diffs], Tue Feb 5 10:11:19 2008 UTC (16 years, 1 month ago) by skrll
Branch: MAIN
Changes since 1.149: +3 -3 lines
Diff to previous 1.149 (colored) to selected 1.81 (colored)

Revert previous as requested by yamt.

Revision 1.101.2.9 / (download) - annotate - [select for diffs], Mon Feb 4 09:24:16 2008 UTC (16 years, 1 month ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.101.2.8: +5 -3 lines
Diff to previous 1.101.2.8 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.149 / (download) - annotate - [select for diffs], Sat Feb 2 20:21:55 2008 UTC (16 years, 1 month ago) by skrll
Branch: MAIN
Changes since 1.148: +3 -3 lines
Diff to previous 1.148 (colored) to selected 1.81 (colored)

Check alignment against pp->pr_align not pp->pr_alloc->pa_pagesz.

DIAGNOSTIC kernels on hppa boot again.

OK'd by ad.

Revision 1.148 / (download) - annotate - [select for diffs], Mon Jan 28 10:26:12 2008 UTC (16 years, 1 month ago) by yamt
Branch: MAIN
Changes since 1.147: +4 -2 lines
Diff to previous 1.147 (colored) to selected 1.81 (colored)

pool_cache_get_paddr: don't bother to clear pcgo_va unless DIAGNOSTIC.

Revision 1.101.2.8 / (download) - annotate - [select for diffs], Mon Jan 21 09:46:20 2008 UTC (16 years, 2 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.101.2.7: +266 -75 lines
Diff to previous 1.101.2.7 (colored) to selected 1.81 (colored)

sync with head

Revision 1.131.2.3 / (download) - annotate - [select for diffs], Wed Jan 9 01:56:18 2008 UTC (16 years, 2 months ago) by matt
Branch: matt-armv6
Changes since 1.131.2.2: +363 -146 lines
Diff to previous 1.131.2.2 (colored) to branchpoint 1.131 (colored) to selected 1.81 (colored)

sync with HEAD

Revision 1.138.4.3 / (download) - annotate - [select for diffs], Tue Jan 8 22:11:40 2008 UTC (16 years, 2 months ago) by bouyer
Branch: bouyer-xeni386
CVS Tags: bouyer-xeni386-merge1
Changes since 1.138.4.2: +0 -1 lines
Diff to previous 1.138.4.2 (colored) to branchpoint 1.138 (colored) next main 1.139 (colored) to selected 1.81 (colored)

Sync with HEAD

Revision 1.147 / (download) - annotate - [select for diffs], Fri Jan 4 21:18:13 2008 UTC (16 years, 2 months ago) by ad
Branch: MAIN
CVS Tags: matt-armv6-base, bouyer-xeni386-nbase, bouyer-xeni386-base
Changes since 1.146: +2 -3 lines
Diff to previous 1.146 (colored) to selected 1.81 (colored)

Start detangling lock.h from intr.h. This is likely to cause short term
breakage, but the mess of dependencies has been regularly breaking the
build recently anyhow.

Revision 1.138.4.2 / (download) - annotate - [select for diffs], Wed Jan 2 21:56:09 2008 UTC (16 years, 2 months ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.138.4.1: +196 -61 lines
Diff to previous 1.138.4.1 (colored) to branchpoint 1.138 (colored) to selected 1.81 (colored)

Sync with HEAD

Revision 1.146 / (download) - annotate - [select for diffs], Wed Jan 2 11:48:53 2008 UTC (16 years, 2 months ago) by ad
Branch: MAIN
Changes since 1.145: +17 -11 lines
Diff to previous 1.145 (colored) to selected 1.81 (colored)

Merge vmlocking2 to head.

Revision 1.137.2.7 / (download) - annotate - [select for diffs], Mon Dec 31 16:25:02 2007 UTC (16 years, 2 months ago) by ad
Branch: vmlocking2
Changes since 1.137.2.6: +5 -3 lines
Diff to previous 1.137.2.6 (colored) to branchpoint 1.137 (colored) next main 1.138 (colored) to selected 1.81 (colored)

Make pool_cache_disable work again.

Revision 1.137.2.6 / (download) - annotate - [select for diffs], Fri Dec 28 15:06:20 2007 UTC (16 years, 2 months ago) by ad
Branch: vmlocking2
Changes since 1.137.2.5: +14 -10 lines
Diff to previous 1.137.2.5 (colored) to branchpoint 1.137 (colored) to selected 1.81 (colored)

pool_cache_put_slow: fill cc_previous if empty. Pointed out by yamt@.

Revision 1.133.4.3 / (download) - annotate - [select for diffs], Thu Dec 27 00:46:08 2007 UTC (16 years, 2 months ago) by mjf
Branch: mjf-devfs
Changes since 1.133.4.2: +206 -34 lines
Diff to previous 1.133.4.2 (colored) to branchpoint 1.133 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.137.2.5 / (download) - annotate - [select for diffs], Wed Dec 26 21:39:42 2007 UTC (16 years, 2 months ago) by ad
Branch: vmlocking2
Changes since 1.137.2.4: +204 -36 lines
Diff to previous 1.137.2.4 (colored) to branchpoint 1.137 (colored) to selected 1.81 (colored)

Sync with head.

Revision 1.137.2.4 / (download) - annotate - [select for diffs], Wed Dec 26 17:55:57 2007 UTC (16 years, 2 months ago) by ad
Branch: vmlocking2
Changes since 1.137.2.3: +3 -2 lines
Diff to previous 1.137.2.3 (colored) to branchpoint 1.137 (colored) to selected 1.81 (colored)

Need sys/atomic.h here.

Revision 1.145 / (download) - annotate - [select for diffs], Wed Dec 26 16:01:36 2007 UTC (16 years, 2 months ago) by ad
Branch: MAIN
CVS Tags: vmlocking2-base3
Changes since 1.144: +50 -36 lines
Diff to previous 1.144 (colored) to selected 1.81 (colored)

Merge more changes from vmlocking2, mainly:

- Locking improvements.
- Use pool_cache for more items.

Revision 1.144 / (download) - annotate - [select for diffs], Sat Dec 22 04:31:34 2007 UTC (16 years, 3 months ago) by yamt
Branch: MAIN
Changes since 1.143: +1 -1 lines
Diff to previous 1.143 (colored) to selected 1.81 (colored)

pool_in_cg: don't bother to check slots past pcg_avail.

Revision 1.143 / (download) - annotate - [select for diffs], Sat Dec 22 03:28:48 2007 UTC (16 years, 3 months ago) by yamt
Branch: MAIN
Changes since 1.142: +98 -4 lines
Diff to previous 1.142 (colored) to selected 1.81 (colored)

pool_whatis: print cached items as well.

Revision 1.142 / (download) - annotate - [select for diffs], Thu Dec 20 23:49:10 2007 UTC (16 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.141: +41 -20 lines
Diff to previous 1.141 (colored) to selected 1.81 (colored)

- Support two different sizes of pool_cache group. The default has 14 or 15
  items, and the new large groups (for busy caches) have 62 or 63 items.
- Add PR_LARGECACHE flag as a hint that a pool_cache should use large groups.
  This should be eventually be tuned at runtime.
- Report group size for vmstat -C.

Revision 1.137.2.3 / (download) - annotate - [select for diffs], Sat Dec 15 02:22:22 2007 UTC (16 years, 3 months ago) by ad
Branch: vmlocking2
Changes since 1.137.2.2: +43 -33 lines
Diff to previous 1.137.2.2 (colored) to branchpoint 1.137 (colored) to selected 1.81 (colored)

Sort list of pools/caches to make easier them easier to find.

Revision 1.138.4.1 / (download) - annotate - [select for diffs], Thu Dec 13 21:56:54 2007 UTC (16 years, 3 months ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.138: +73 -16 lines
Diff to previous 1.138 (colored) to selected 1.81 (colored)

Sync with HEAD

Revision 1.138.2.3 / (download) - annotate - [select for diffs], Thu Dec 13 05:06:01 2007 UTC (16 years, 3 months ago) by yamt
Branch: yamt-kmem
Changes since 1.138.2.2: +73 -16 lines
Diff to previous 1.138.2.2 (colored) to branchpoint 1.138 (colored) next main 1.139 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.141 / (download) - annotate - [select for diffs], Thu Dec 13 02:45:10 2007 UTC (16 years, 3 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-kmem-base3
Changes since 1.140: +74 -19 lines
Diff to previous 1.140 (colored) to selected 1.81 (colored)

add ddb "whatis" command.  inspired from solaris ::whatis dcmd.

Revision 1.140 / (download) - annotate - [select for diffs], Thu Dec 13 01:22:50 2007 UTC (16 years, 3 months ago) by yamt
Branch: MAIN
Changes since 1.139: +6 -4 lines
Diff to previous 1.139 (colored) to selected 1.81 (colored)

don't forget to initialize ph_off for PR_NOTOUCH.

Revision 1.137.2.2 / (download) - annotate - [select for diffs], Wed Dec 12 22:03:31 2007 UTC (16 years, 3 months ago) by ad
Branch: vmlocking2
Changes since 1.137.2.1: +14 -7 lines
Diff to previous 1.137.2.1 (colored) to branchpoint 1.137 (colored) to selected 1.81 (colored)

Add a global 'pool_cache_disable', to be set from the debugger. Helpful
when tracking down leaks.

Revision 1.139 / (download) - annotate - [select for diffs], Tue Dec 11 19:07:27 2007 UTC (16 years, 3 months ago) by ad
Branch: MAIN
CVS Tags: cube-autoconf-base, cube-autoconf
Changes since 1.138: +3 -3 lines
Diff to previous 1.138 (colored) to selected 1.81 (colored)

Change the ncpu test to work when a pool_cache or softint is initialized
between mi_cpu_attach() and attachment of the boot CPU. Suggested by mrg@.

Revision 1.138.2.2 / (download) - annotate - [select for diffs], Mon Dec 10 12:56:10 2007 UTC (16 years, 3 months ago) by yamt
Branch: yamt-kmem
Changes since 1.138.2.1: +10 -10 lines
Diff to previous 1.138.2.1 (colored) to branchpoint 1.138 (colored) to selected 1.81 (colored)

- separate kernel va allocation (kernel_va_arena) from
  in-kernel fault handling (kernel_map).
- add vmem bootstrap code.  vmem doesn't rely on malloc anymore.
- make kmem_alloc interrupt-safe.
- kill kmem_map.  make malloc a wrapper of kmem_alloc.

Revision 1.138.2.1 / (download) - annotate - [select for diffs], Mon Dec 10 08:56:56 2007 UTC (16 years, 3 months ago) by yamt
Branch: yamt-kmem
Changes since 1.138: +16 -3 lines
Diff to previous 1.138 (colored) to selected 1.81 (colored)

add pool_cache_bootstrap_destroy.  will be used by vmem.

Revision 1.129.12.6 / (download) - annotate - [select for diffs], Sun Dec 9 19:38:24 2007 UTC (16 years, 3 months ago) by jmcneill
Branch: jmcneill-pm
Changes since 1.129.12.5: +18 -4 lines
Diff to previous 1.129.12.5 (colored) to branchpoint 1.129 (colored) next main 1.130 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.133.4.2 / (download) - annotate - [select for diffs], Sat Dec 8 18:20:37 2007 UTC (16 years, 3 months ago) by mjf
Branch: mjf-devfs
Changes since 1.133.4.1: +18 -4 lines
Diff to previous 1.133.4.1 (colored) to branchpoint 1.133 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.137.2.1 / (download) - annotate - [select for diffs], Sat Dec 8 17:57:46 2007 UTC (16 years, 3 months ago) by ad
Branch: vmlocking2
Changes since 1.137: +18 -4 lines
Diff to previous 1.137 (colored) to selected 1.81 (colored)

Sync with head.

Revision 1.101.2.7 / (download) - annotate - [select for diffs], Fri Dec 7 17:33:07 2007 UTC (16 years, 3 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.101.2.6: +38 -30 lines
Diff to previous 1.101.2.6 (colored) to selected 1.81 (colored)

sync with head

Revision 1.138 / (download) - annotate - [select for diffs], Wed Dec 5 06:52:01 2007 UTC (16 years, 3 months ago) by ad
Branch: MAIN
CVS Tags: yamt-kmem-base2, yamt-kmem-base, vmlocking2-base2, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, jmcneill-pm-base
Branch point for: yamt-kmem, bouyer-xeni386
Changes since 1.137: +18 -4 lines
Diff to previous 1.137 (colored) to selected 1.81 (colored)

pool_init, pool_cache_init: hack around IP input processing which can
not yet safely block without severely confusing soo_write() and friends.
If the pool's IPL is IPL_SOFTNET, initialize the mutex at IPL_VM so that
it's a spinlock. To be dealt with correctly in the near future.

Revision 1.129.12.5 / (download) - annotate - [select for diffs], Wed Nov 21 21:56:03 2007 UTC (16 years, 4 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.129.12.4: +22 -28 lines
Diff to previous 1.129.12.4 (colored) to branchpoint 1.129 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.133.4.1 / (download) - annotate - [select for diffs], Mon Nov 19 00:48:50 2007 UTC (16 years, 4 months ago) by mjf
Branch: mjf-devfs
Changes since 1.133: +901 -486 lines
Diff to previous 1.133 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.133.2.2 / (download) - annotate - [select for diffs], Sun Nov 18 19:35:50 2007 UTC (16 years, 4 months ago) by bouyer
Branch: bouyer-xenamd64
Changes since 1.133.2.1: +33 -29 lines
Diff to previous 1.133.2.1 (colored) to branchpoint 1.133 (colored) next main 1.134 (colored) to selected 1.81 (colored)

Sync with HEAD

Revision 1.137 / (download) - annotate - [select for diffs], Sun Nov 18 16:27:43 2007 UTC (16 years, 4 months ago) by ad
Branch: MAIN
CVS Tags: vmlocking2-base1, vmlocking-nbase, bouyer-xenamd64-base2, bouyer-xenamd64-base
Branch point for: vmlocking2
Changes since 1.136: +22 -28 lines
Diff to previous 1.136 (colored) to selected 1.81 (colored)

Work around issues with pool_cache on sparc.

Revision 1.101.2.6 / (download) - annotate - [select for diffs], Thu Nov 15 11:44:49 2007 UTC (16 years, 4 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.101.2.5: +907 -486 lines
Diff to previous 1.101.2.5 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.129.12.4 / (download) - annotate - [select for diffs], Wed Nov 14 19:04:44 2007 UTC (16 years, 4 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.129.12.3: +15 -5 lines
Diff to previous 1.129.12.3 (colored) to branchpoint 1.129 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.136 / (download) - annotate - [select for diffs], Wed Nov 14 11:14:13 2007 UTC (16 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.135: +13 -3 lines
Diff to previous 1.135 (colored) to selected 1.81 (colored)

fix freecheck.

Revision 1.133.2.1 / (download) - annotate - [select for diffs], Tue Nov 13 16:02:21 2007 UTC (16 years, 4 months ago) by bouyer
Branch: bouyer-xenamd64
Changes since 1.133: +897 -486 lines
Diff to previous 1.133 (colored) to selected 1.81 (colored)

Sync with HEAD

Revision 1.129.12.3 / (download) - annotate - [select for diffs], Sun Nov 11 16:48:08 2007 UTC (16 years, 4 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.129.12.2: +897 -486 lines
Diff to previous 1.129.12.2 (colored) to branchpoint 1.129 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.135 / (download) - annotate - [select for diffs], Sat Nov 10 07:29:28 2007 UTC (16 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.134: +53 -45 lines
Diff to previous 1.134 (colored) to selected 1.81 (colored)

for PR_NOTOUCH pool_item_header, use a bitmap rather than a freelist.
it saves some space and allows more items per a page.

Revision 1.131.2.2 / (download) - annotate - [select for diffs], Thu Nov 8 11:00:05 2007 UTC (16 years, 4 months ago) by matt
Branch: matt-armv6
CVS Tags: matt-armv6-prevmlocking
Changes since 1.131.2.1: +844 -441 lines
Diff to previous 1.131.2.1 (colored) to branchpoint 1.131 (colored) to selected 1.81 (colored)

sync with -HEAD

Revision 1.134 / (download) - annotate - [select for diffs], Wed Nov 7 00:23:23 2007 UTC (16 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.133: +844 -441 lines
Diff to previous 1.133 (colored) to selected 1.81 (colored)

Merge from vmlocking:

- pool_cache changes.
- Debugger/procfs locking fixes.
- Other minor changes.

Revision 1.131.2.1 / (download) - annotate - [select for diffs], Tue Nov 6 23:32:15 2007 UTC (16 years, 4 months ago) by matt
Branch: matt-armv6
Changes since 1.131: +2 -13 lines
Diff to previous 1.131 (colored) to selected 1.81 (colored)

sync with HEAD

Revision 1.128.2.13 / (download) - annotate - [select for diffs], Thu Nov 1 21:10:14 2007 UTC (16 years, 4 months ago) by ad
Branch: vmlocking
Changes since 1.128.2.12: +44 -6 lines
Diff to previous 1.128.2.12 (colored) next main 1.129 (colored) to selected 1.81 (colored)

pool_reclaim: acquire kernel_lock if the pool is at IPL_SOFTCLOCK,
SOFTNET or SOFTSERIAL, as mutexes at these levels must still be
spinlocks. It's not yet safe for e.g. ip_intr() to block as this
upsets code calling up from the socket layer. It can find pcbs
sitting half baked.

pool_cache_xcall: go to splvm to prevent kernel_lock from being
taken, for the reason listed above.

Pointed out by yamt@.

Revision 1.128.2.12 / (download) - annotate - [select for diffs], Mon Oct 29 16:37:44 2007 UTC (16 years, 4 months ago) by ad
Branch: vmlocking
Changes since 1.128.2.11: +12 -9 lines
Diff to previous 1.128.2.11 (colored) to selected 1.81 (colored)

pool_drain_start: tweak assertions/comments.

Revision 1.101.2.5 / (download) - annotate - [select for diffs], Sat Oct 27 11:35:33 2007 UTC (16 years, 4 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.101.2.4: +2 -13 lines
Diff to previous 1.101.2.4 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.128.2.11 / (download) - annotate - [select for diffs], Fri Oct 26 17:03:10 2007 UTC (16 years, 4 months ago) by ad
Branch: vmlocking
Changes since 1.128.2.10: +113 -24 lines
Diff to previous 1.128.2.10 (colored) to selected 1.81 (colored)

- Use a cross call to drain the per-CPU component of pool caches.
- When draining, skip over pools that are completly inactive.

Revision 1.129.12.2 / (download) - annotate - [select for diffs], Fri Oct 26 15:48:40 2007 UTC (16 years, 4 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.129.12.1: +2 -13 lines
Diff to previous 1.129.12.1 (colored) to branchpoint 1.129 (colored) to selected 1.81 (colored)

Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.

Revision 1.131.4.1 / (download) - annotate - [select for diffs], Sun Oct 14 11:48:46 2007 UTC (16 years, 5 months ago) by yamt
Branch: yamt-x86pmap
Changes since 1.131: +2 -13 lines
Diff to previous 1.131 (colored) next main 1.132 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.133 / (download) - annotate - [select for diffs], Thu Oct 11 19:53:37 2007 UTC (16 years, 5 months ago) by ad
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, yamt-x86pmap-base3, vmlocking-base, jmcneill-base
Branch point for: mjf-devfs, bouyer-xenamd64
Changes since 1.132: +2 -6 lines
Diff to previous 1.132 (colored) to selected 1.81 (colored)

Remove LOCK_ASSERT(!simple_lock_held(&foo));

Revision 1.132 / (download) - annotate - [select for diffs], Thu Oct 11 19:45:25 2007 UTC (16 years, 5 months ago) by ad
Branch: MAIN
Changes since 1.131: +2 -9 lines
Diff to previous 1.131 (colored) to selected 1.81 (colored)

Merge from vmlocking:

- G/C spinlockmgr() and simple_lock debugging.
- Always include the kernel_lock functions, for LKMs.
- Slightly improved subr_lockdebug code.
- Keep sizeof(struct lock) the same if LOCKDEBUG.

Revision 1.128.2.10 / (download) - annotate - [select for diffs], Tue Sep 25 01:36:19 2007 UTC (16 years, 5 months ago) by ad
Branch: vmlocking
Changes since 1.128.2.9: +14 -10 lines
Diff to previous 1.128.2.9 (colored) to selected 1.81 (colored)

If no constructor/destructor are provided for a pool_cache, use nullop.
Remove the tests for pc_ctor/pc_dtor != NULL.

Revision 1.128.2.9 / (download) - annotate - [select for diffs], Mon Sep 10 11:13:17 2007 UTC (16 years, 6 months ago) by ad
Branch: vmlocking
Changes since 1.128.2.8: +6 -8 lines
Diff to previous 1.128.2.8 (colored) to selected 1.81 (colored)

Fix a deadlock.

Revision 1.128.2.8 / (download) - annotate - [select for diffs], Sun Sep 9 23:17:14 2007 UTC (16 years, 6 months ago) by ad
Branch: vmlocking
Changes since 1.128.2.7: +16 -55 lines
Diff to previous 1.128.2.7 (colored) to selected 1.81 (colored)

- Re-enable pool_cache, since it works on i386 again after today's pmap
  change. pool_cache_invalidate() no longer invalidates objects stored
  in the per-CPU caches. This needs some thought.
- Remove pcg_get, pcg_put since they are only called from one place each.
- Remove cc_busy assertions, since they don't work correctly. Pointed out
  by yamt@.
- Add some more-assertions and simplify.

Revision 1.129.12.1 / (download) - annotate - [select for diffs], Mon Sep 3 16:48:49 2007 UTC (16 years, 6 months ago) by jmcneill
Branch: jmcneill-pm
Changes since 1.129: +28 -9 lines
Diff to previous 1.129 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.101.2.4 / (download) - annotate - [select for diffs], Mon Sep 3 14:41:04 2007 UTC (16 years, 6 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.101.2.3: +56 -37 lines
Diff to previous 1.101.2.3 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.129.8.1 / (download) - annotate - [select for diffs], Mon Sep 3 10:23:02 2007 UTC (16 years, 6 months ago) by skrll
Branch: nick-csl-alignment
Changes since 1.129: +28 -9 lines
Diff to previous 1.129 (colored) next main 1.130 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.128.2.7 / (download) - annotate - [select for diffs], Sat Sep 1 12:55:15 2007 UTC (16 years, 6 months ago) by ad
Branch: vmlocking
Changes since 1.128.2.6: +639 -310 lines
Diff to previous 1.128.2.6 (colored) to selected 1.81 (colored)

- Add a CPU layer to pool caches. In combination with vmem/kmem this
  provides CPU-local slab/object and general purpose allocators. The
  strategy used is as described in Jeff Bonwick's USENIX paper, except in
  at least one place where the described allocation strategy doesn't make
  sense. For exclusive access to the CPU layer the IPL is raised or kernel
  preemption disabled. Where the interrupt priority levels are software
  emulated this is much cheaper than taking a lock, and I think that
  writing to a local %pil register is likely to have a similar penalty to
  taking a lock.

  No tuning of the group sizes is currently done - all groups have 15
  items each, but this should be fairly easy to implement. Also, the
  reclamation mechanism should probably use a cross-call to drain the
  CPU-level caches on remote CPUs.

  Currently this causes kernel memory corruption on i386, yet works without
  a problem on amd64. The cache layer is disabled for the time being until I
  can find the bug.

- Change the pool_cache API so that the caches are themselves dynamically
  allocated, and that each cache is tied to a single pool only. Add some
  stubs to change pool_cache parameters that call directly through to the
  pool layer (e.g. pool_cache_sethiwat). The idea here is that pool_cache
  should become the default object allocator (and so LKM friendly), and
  that the pool allocator should be for kernel-internal use only. This will
  be posted to tech-kern@ for review.

Revision 1.128.2.6 / (download) - annotate - [select for diffs], Mon Aug 20 21:27:37 2007 UTC (16 years, 7 months ago) by ad
Branch: vmlocking
Changes since 1.128.2.5: +28 -9 lines
Diff to previous 1.128.2.5 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.131 / (download) - annotate - [select for diffs], Sat Aug 18 00:37:14 2007 UTC (16 years, 7 months ago) by ad
Branch: MAIN
CVS Tags: yamt-x86pmap-base2, yamt-x86pmap-base, nick-csl-alignment-base5
Branch point for: yamt-x86pmap, matt-armv6
Changes since 1.130: +4 -2 lines
Diff to previous 1.130 (colored) to selected 1.81 (colored)

pool_drain: add a comment.

Revision 1.130 / (download) - annotate - [select for diffs], Sat Aug 18 00:33:38 2007 UTC (16 years, 7 months ago) by ad
Branch: MAIN
Changes since 1.129: +26 -9 lines
Diff to previous 1.129 (colored) to selected 1.81 (colored)

pool_do_cache_invalidate_grouplist: drop locks while calling the destructor.
XXX Expensive - to be revisited.

Revision 1.128.2.5 / (download) - annotate - [select for diffs], Sun Jul 29 11:34:47 2007 UTC (16 years, 7 months ago) by ad
Branch: vmlocking
Changes since 1.128.2.4: +4 -2 lines
Diff to previous 1.128.2.4 (colored) to selected 1.81 (colored)

Trap free() of areas that contain undestroyed locks. Not a major problem
but it helps to catch bugs.

Revision 1.125.2.3 / (download) - annotate - [select for diffs], Sat Mar 24 14:56:04 2007 UTC (16 years, 11 months ago) by yamt
Branch: yamt-idlelwp
Changes since 1.125.2.2: +7 -7 lines
Diff to previous 1.125.2.2 (colored) to branchpoint 1.125 (colored) next main 1.126 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.128.2.4 / (download) - annotate - [select for diffs], Thu Mar 22 12:30:29 2007 UTC (17 years ago) by ad
Branch: vmlocking
Changes since 1.128.2.3: +3 -12 lines
Diff to previous 1.128.2.3 (colored) to selected 1.81 (colored)

- Remove debugging crud.
- wakeup -> cv_broadcast.

Revision 1.128.2.3 / (download) - annotate - [select for diffs], Wed Mar 21 20:10:22 2007 UTC (17 years ago) by ad
Branch: vmlocking
Changes since 1.128.2.2: +2 -9 lines
Diff to previous 1.128.2.2 (colored) to selected 1.81 (colored)

GC the simplelock/spinlock debugging stuff.

Revision 1.128.2.2 / (download) - annotate - [select for diffs], Tue Mar 13 17:50:58 2007 UTC (17 years ago) by ad
Branch: vmlocking
Changes since 1.128.2.1: +119 -131 lines
Diff to previous 1.128.2.1 (colored) to selected 1.81 (colored)

Pull in the initial set of changes for the vmlocking branch.

Revision 1.128.2.1 / (download) - annotate - [select for diffs], Tue Mar 13 16:51:56 2007 UTC (17 years ago) by ad
Branch: vmlocking
Changes since 1.128: +7 -7 lines
Diff to previous 1.128 (colored) to selected 1.81 (colored)

Sync with head.

Revision 1.129 / (download) - annotate - [select for diffs], Mon Mar 12 18:18:34 2007 UTC (17 years ago) by ad
Branch: MAIN
CVS Tags: yamt-idlelwp-base8, thorpej-atomic-base, thorpej-atomic, reinoud-bufcleanup, nick-csl-alignment-base, mjf-ufs-trans-base, mjf-ufs-trans, matt-mips64-base, matt-mips64, hpcarm-cleanup
Branch point for: nick-csl-alignment, jmcneill-pm
Changes since 1.128: +7 -7 lines
Diff to previous 1.128 (colored) to selected 1.81 (colored)

Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.

Revision 1.125.2.2 / (download) - annotate - [select for diffs], Mon Mar 12 05:58:41 2007 UTC (17 years ago) by rmind
Branch: yamt-idlelwp
Changes since 1.125.2.1: +25 -25 lines
Diff to previous 1.125.2.1 (colored) to branchpoint 1.125 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.128 / (download) - annotate - [select for diffs], Sun Mar 4 06:03:07 2007 UTC (17 years ago) by christos
Branch: MAIN
Branch point for: vmlocking
Changes since 1.127: +25 -25 lines
Diff to previous 1.127 (colored) to selected 1.81 (colored)

Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.

Revision 1.125.2.1 / (download) - annotate - [select for diffs], Tue Feb 27 16:54:27 2007 UTC (17 years ago) by yamt
Branch: yamt-idlelwp
Changes since 1.125: +7 -7 lines
Diff to previous 1.125 (colored) to selected 1.81 (colored)

- sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.

Revision 1.101.2.3 / (download) - annotate - [select for diffs], Mon Feb 26 09:11:15 2007 UTC (17 years ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.101.2.2: +28 -12 lines
Diff to previous 1.101.2.2 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.127 / (download) - annotate - [select for diffs], Thu Feb 22 06:34:44 2007 UTC (17 years ago) by thorpej
Branch: MAIN
CVS Tags: ad-audiomp-base, ad-audiomp
Changes since 1.126: +6 -6 lines
Diff to previous 1.126 (colored) to selected 1.81 (colored)

TRUE -> true, FALSE -> false

Revision 1.126 / (download) - annotate - [select for diffs], Wed Feb 21 23:00:05 2007 UTC (17 years ago) by thorpej
Branch: MAIN
Changes since 1.125: +6 -6 lines
Diff to previous 1.125 (colored) to selected 1.81 (colored)

Replace the Mach-derived boolean_t type with the C99 bool type.  A
future commit will replace use of TRUE and FALSE with true and false.

Revision 1.125 / (download) - annotate - [select for diffs], Fri Feb 9 21:55:31 2007 UTC (17 years, 1 month ago) by ad
Branch: MAIN
CVS Tags: post-newlock2-merge
Branch point for: yamt-idlelwp
Changes since 1.124: +23 -7 lines
Diff to previous 1.124 (colored) to selected 1.81 (colored)

Merge newlock2 to head.

Revision 1.122.2.3 / (download) - annotate - [select for diffs], Fri Jan 19 20:49:54 2007 UTC (17 years, 2 months ago) by ad
Branch: newlock2
Changes since 1.122.2.2: +11 -2 lines
Diff to previous 1.122.2.2 (colored) to branchpoint 1.122 (colored) next main 1.123 (colored) to selected 1.81 (colored)

Add some DEBUG code to check that items being freed were previously
allocated from the same source. Needs to be enabled via DDB.

Revision 1.101.2.2 / (download) - annotate - [select for diffs], Sat Dec 30 20:50:06 2006 UTC (17 years, 2 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.101.2.1: +64 -37 lines
Diff to previous 1.101.2.1 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.122.4.2 / (download) - annotate - [select for diffs], Sun Dec 10 07:18:45 2006 UTC (17 years, 3 months ago) by yamt
Branch: yamt-splraiseipl
Changes since 1.122.4.1: +11 -12 lines
Diff to previous 1.122.4.1 (colored) to branchpoint 1.122 (colored) next main 1.123 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.124 / (download) - annotate - [select for diffs], Wed Nov 1 10:17:58 2006 UTC (17 years, 4 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3, wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, newlock2-nbase, newlock2-base, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4, matt-nb4-arm-base, matt-nb4-arm
Changes since 1.123: +11 -12 lines
Diff to previous 1.123 (colored) to selected 1.81 (colored)

remove some __unused from function parameters.

Revision 1.122.4.1 / (download) - annotate - [select for diffs], Sun Oct 22 06:07:11 2006 UTC (17 years, 5 months ago) by yamt
Branch: yamt-splraiseipl
Changes since 1.122: +12 -11 lines
Diff to previous 1.122 (colored) to selected 1.81 (colored)

sync with head

Revision 1.122.2.2 / (download) - annotate - [select for diffs], Fri Oct 20 20:03:56 2006 UTC (17 years, 5 months ago) by ad
Branch: newlock2
Changes since 1.122.2.1: +2 -4 lines
Diff to previous 1.122.2.1 (colored) to branchpoint 1.122 (colored) to selected 1.81 (colored)

Remove sched_lock assertion.

Revision 1.123 / (download) - annotate - [select for diffs], Thu Oct 12 01:32:18 2006 UTC (17 years, 5 months ago) by christos
Branch: MAIN
CVS Tags: yamt-splraiseipl-base2
Changes since 1.122: +12 -11 lines
Diff to previous 1.122 (colored) to selected 1.81 (colored)

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386

Revision 1.122.2.1 / (download) - annotate - [select for diffs], Mon Sep 11 00:12:01 2006 UTC (17 years, 6 months ago) by ad
Branch: newlock2
Changes since 1.122: +14 -5 lines
Diff to previous 1.122 (colored) to selected 1.81 (colored)

From the newlock branch: add some KASSERT() verifying correct alignment.

Revision 1.111.2.1 / (download) - annotate - [select for diffs], Sat Sep 9 02:57:16 2006 UTC (17 years, 6 months ago) by rpaulo
Branch: rpaulo-netinet-merge-pcb
Changes since 1.111: +285 -262 lines
Diff to previous 1.111 (colored) next main 1.112 (colored) to selected 1.81 (colored)

sync with head

Revision 1.112.2.6 / (download) - annotate - [select for diffs], Sun Sep 3 15:25:22 2006 UTC (17 years, 6 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.112.2.5: +62 -35 lines
Diff to previous 1.112.2.5 (colored) to branchpoint 1.112 (colored) next main 1.113 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.122 / (download) - annotate - [select for diffs], Sun Sep 3 06:25:19 2006 UTC (17 years, 6 months ago) by christos
Branch: MAIN
CVS Tags: yamt-splraiseipl-base, yamt-pdpolicy-base9, yamt-pdpolicy-base8, rpaulo-netinet-merge-pcb-base
Branch point for: yamt-splraiseipl, newlock2
Changes since 1.121: +4 -3 lines
Diff to previous 1.121 (colored) to selected 1.81 (colored)

avoid empty else statement

Revision 1.121 / (download) - annotate - [select for diffs], Sun Aug 20 09:35:25 2006 UTC (17 years, 7 months ago) by yamt
Branch: MAIN
Changes since 1.120: +57 -31 lines
Diff to previous 1.120 (colored) to selected 1.81 (colored)

implement PR_NOALIGN.  (allow unaligned pages)
to be used by vmem quantum cache.

Revision 1.120 / (download) - annotate - [select for diffs], Sat Aug 19 14:01:15 2006 UTC (17 years, 7 months ago) by yamt
Branch: MAIN
Changes since 1.119: +1 -1 lines
Diff to previous 1.119 (colored) to selected 1.81 (colored)

pool_init: in the case of PR_NOTOUCH, don't bump item size to
sizeof(struct pool_item).

Revision 1.112.2.5 / (download) - annotate - [select for diffs], Fri Aug 11 15:45:46 2006 UTC (17 years, 7 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.112.2.4: +4 -4 lines
Diff to previous 1.112.2.4 (colored) to branchpoint 1.112 (colored) to selected 1.81 (colored)

sync with head

Revision 1.119 / (download) - annotate - [select for diffs], Fri Jul 21 10:08:41 2006 UTC (17 years, 8 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-pdpolicy-base7, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.118: +4 -4 lines
Diff to previous 1.118 (colored) to selected 1.81 (colored)

use ASSERT_SLEEPABLE where appropriate.

Revision 1.112.2.4 / (download) - annotate - [select for diffs], Mon Jun 26 12:52:57 2006 UTC (17 years, 8 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.112.2.3: +127 -137 lines
Diff to previous 1.112.2.3 (colored) to branchpoint 1.112 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.101.2.1 / (download) - annotate - [select for diffs], Wed Jun 21 15:09:38 2006 UTC (17 years, 9 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.101: +423 -375 lines
Diff to previous 1.101 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.116.2.1 / (download) - annotate - [select for diffs], Mon Jun 19 04:07:16 2006 UTC (17 years, 9 months ago) by chap
Branch: chap-midi
Changes since 1.116: +127 -137 lines
Diff to previous 1.116 (colored) next main 1.117 (colored) to selected 1.81 (colored)

Sync with head.

Revision 1.118 / (download) - annotate - [select for diffs], Wed Jun 7 22:33:40 2006 UTC (17 years, 9 months ago) by kardel
Branch: MAIN
CVS Tags: yamt-pdpolicy-base6, gdamore-uart-base, gdamore-uart, chap-midi-nbase, chap-midi-base
Changes since 1.117: +5 -14 lines
Diff to previous 1.117 (colored) to selected 1.81 (colored)

merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
  time.tv_sec -> time_second
- struct timeval mono_time is gone
  mono_time.tv_sec -> time_uptime
- access to time via
	{get,}{micro,nano,bin}time()
	get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
  Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
  NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html

Revision 1.111.4.3 / (download) - annotate - [select for diffs], Thu Jun 1 22:38:09 2006 UTC (17 years, 9 months ago) by kardel
Branch: simonb-timecounters
CVS Tags: simonb-timcounters-final
Changes since 1.111.4.2: +124 -125 lines
Diff to previous 1.111.4.2 (colored) next main 1.112 (colored) to selected 1.81 (colored)

Sync with head.

Revision 1.117 / (download) - annotate - [select for diffs], Thu May 25 14:27:28 2006 UTC (17 years, 9 months ago) by yamt
Branch: MAIN
CVS Tags: simonb-timecounters-base
Changes since 1.116: +124 -125 lines
Diff to previous 1.116 (colored) to selected 1.81 (colored)

move wait points for kva from upper layers to vm_map.  PR/33185 #1.

XXX there is a concern about interaction with kva fragmentation.
see: http://mail-index.NetBSD.org/tech-kern/2006/05/11/0000.html

Revision 1.112.6.2 / (download) - annotate - [select for diffs], Wed May 24 15:50:41 2006 UTC (17 years, 9 months ago) by tron
Branch: peter-altq
Changes since 1.112.6.1: +20 -6 lines
Diff to previous 1.112.6.1 (colored) to branchpoint 1.112 (colored) next main 1.113 (colored) to selected 1.81 (colored)

Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.

Revision 1.112.2.3 / (download) - annotate - [select for diffs], Wed May 24 10:58:41 2006 UTC (17 years, 9 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.112.2.2: +20 -5 lines
Diff to previous 1.112.2.2 (colored) to branchpoint 1.112 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.111.4.2 / (download) - annotate - [select for diffs], Sat Apr 22 11:39:59 2006 UTC (17 years, 11 months ago) by simonb
Branch: simonb-timecounters
Changes since 1.111.4.1: +98 -92 lines
Diff to previous 1.111.4.1 (colored) to selected 1.81 (colored)

Sync with head.

Revision 1.112.4.1 / (download) - annotate - [select for diffs], Wed Apr 19 05:14:00 2006 UTC (17 years, 11 months ago) by elad
Branch: elad-kernelauth
Changes since 1.112: +66 -62 lines
Diff to previous 1.112 (colored) next main 1.113 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.116 / (download) - annotate - [select for diffs], Sat Apr 15 14:23:11 2006 UTC (17 years, 11 months ago) by simonb
Branch: MAIN
CVS Tags: yamt-pdpolicy-base5, elad-kernelauth-base
Branch point for: chap-midi
Changes since 1.115: +18 -4 lines
Diff to previous 1.115 (colored) to selected 1.81 (colored)

Add a DEBUG check that panics if pool_init() is called more than
once on the same pool.

As discussed on tech-kern a few months ago.

Revision 1.115 / (download) - annotate - [select for diffs], Sat Apr 15 04:47:11 2006 UTC (17 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.114: +4 -3 lines
Diff to previous 1.114 (colored) to selected 1.81 (colored)

Coverity CID 760: Protect against NULL deref.

Revision 1.112.2.2 / (download) - annotate - [select for diffs], Tue Apr 11 11:55:47 2006 UTC (17 years, 11 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.112.2.1: +2 -3 lines
Diff to previous 1.112.2.1 (colored) to branchpoint 1.112 (colored) to selected 1.81 (colored)

sync with head

Revision 1.114 / (download) - annotate - [select for diffs], Sun Apr 2 13:25:34 2006 UTC (17 years, 11 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-pdpolicy-base4
Changes since 1.113: +0 -1 lines
Diff to previous 1.113 (colored) to selected 1.81 (colored)

pool_grow: don't increase pr_minpages.  (fix a mistake in 1.113)

Revision 1.112.2.1 / (download) - annotate - [select for diffs], Sat Apr 1 12:07:40 2006 UTC (17 years, 11 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.112: +49 -59 lines
Diff to previous 1.112 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.112.6.1 / (download) - annotate - [select for diffs], Tue Mar 28 09:42:26 2006 UTC (17 years, 11 months ago) by tron
Branch: peter-altq
Changes since 1.112: +49 -59 lines
Diff to previous 1.112 (colored) to selected 1.81 (colored)

Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.

Revision 1.113 / (download) - annotate - [select for diffs], Fri Mar 17 10:09:25 2006 UTC (18 years ago) by yamt
Branch: MAIN
CVS Tags: yamt-pdpolicy-base3
Changes since 1.112: +49 -59 lines
Diff to previous 1.112 (colored) to selected 1.81 (colored)

make duplicated code fragments into a function, pool_grow.

Revision 1.99.8.1.2.1 / (download) - annotate - [select for diffs], Fri Mar 10 13:19:48 2006 UTC (18 years ago) by tron
Branch: netbsd-3-0
CVS Tags: netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE
Changes since 1.99.8.1: +32 -30 lines
Diff to previous 1.99.8.1 (colored) next main 1.99.8.2 (colored) to selected 1.81 (colored)

Pull up following revision(s) (requested by bjh21 in ticket #1192):
	sys/sys/pool.h: revision 1.48
	sys/kern/subr_pool.c: revision 1.112
Medium-sized overhaul of POOL_SUBPAGE support so that:
1: I can understand it, and
2: It works.
Notable externally-visible changes are that POOL_SUBPAGE now has to be a
compile-time constant, and that trying to initialise a pool whose objects are
larger than POOL_SUBPAGE automatically generates a pool that doesn't use
subpages.
NetBSD/acorn26 now boots multi-user again.

Revision 1.99.8.2 / (download) - annotate - [select for diffs], Fri Mar 10 13:19:42 2006 UTC (18 years ago) by tron
Branch: netbsd-3
CVS Tags: netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1
Changes since 1.99.8.1: +32 -30 lines
Diff to previous 1.99.8.1 (colored) to branchpoint 1.99 (colored) next main 1.100 (colored) to selected 1.81 (colored)

Pull up following revision(s) (requested by bjh21 in ticket #1192):
	sys/sys/pool.h: revision 1.48
	sys/kern/subr_pool.c: revision 1.112
Medium-sized overhaul of POOL_SUBPAGE support so that:
1: I can understand it, and
2: It works.
Notable externally-visible changes are that POOL_SUBPAGE now has to be a
compile-time constant, and that trying to initialise a pool whose objects are
larger than POOL_SUBPAGE automatically generates a pool that doesn't use
subpages.
NetBSD/acorn26 now boots multi-user again.

Revision 1.110.2.2 / (download) - annotate - [select for diffs], Wed Mar 1 09:28:46 2006 UTC (18 years ago) by yamt
Branch: yamt-uio_vmspace
Changes since 1.110.2.1: +34 -32 lines
Diff to previous 1.110.2.1 (colored) next main 1.111 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.112 / (download) - annotate - [select for diffs], Fri Feb 24 11:46:20 2006 UTC (18 years ago) by bjh21
Branch: MAIN
CVS Tags: yamt-uio_vmspace-base5, yamt-pdpolicy-base2, yamt-pdpolicy-base, peter-altq-base
Branch point for: yamt-pdpolicy, peter-altq, elad-kernelauth
Changes since 1.111: +34 -32 lines
Diff to previous 1.111 (colored) to selected 1.81 (colored)

Medium-sized overhaul of POOL_SUBPAGE support so that:
1: I can understand it, and
2: It works.
Notable externally-visible changes are that POOL_SUBPAGE now has to be a
compile-time constant, and that trying to initialise a pool whose objects are
larger than POOL_SUBPAGE automatically generates a pool that doesn't use
subpages.

NetBSD/acorn26 now boots multi-user again.

Revision 1.111.4.1 / (download) - annotate - [select for diffs], Sat Feb 4 14:30:17 2006 UTC (18 years, 1 month ago) by simonb
Branch: simonb-timecounters
Changes since 1.111: +5 -14 lines
Diff to previous 1.111 (colored) to selected 1.81 (colored)

Adapt for timecounters: mostly use get*time() and use "time_second"
instead of "time.tv_sec".

Revision 1.110.2.1 / (download) - annotate - [select for diffs], Wed Feb 1 14:52:20 2006 UTC (18 years, 1 month ago) by yamt
Branch: yamt-uio_vmspace
Changes since 1.110: +3 -3 lines
Diff to previous 1.110 (colored) to selected 1.81 (colored)

sync with head.

Revision 1.111 / (download) - annotate - [select for diffs], Thu Jan 26 15:07:25 2006 UTC (18 years, 1 month ago) by christos
Branch: MAIN
Branch point for: simonb-timecounters, rpaulo-netinet-merge-pcb
Changes since 1.110: +3 -3 lines
Diff to previous 1.110 (colored) to selected 1.81 (colored)

PR/32631: Yves-Emmanuel JUTARD: Fix DIAGNOSTIC panic in the pool code. At
the time pool_get() calls pool_catchup(), pp has been free'd but it is still
in the "entered" state. The chain pool_catchup() -> pool_allocator_alloc()
-> pool_reclaim() on pp fails because pp is still in the "entered" state.
Call pr_leave() before calling calling pool_catchup() to avoid this.

Thanks for the excellent analysis!

Revision 1.110 / (download) - annotate - [select for diffs], Sat Dec 24 19:12:23 2005 UTC (18 years, 2 months ago) by perry
Branch: MAIN
Branch point for: yamt-uio_vmspace
Changes since 1.109: +14 -14 lines
Diff to previous 1.109 (colored) to selected 1.81 (colored)

Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.

Revision 1.109 / (download) - annotate - [select for diffs], Tue Dec 20 15:52:14 2005 UTC (18 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.108: +12 -9 lines
Diff to previous 1.108 (colored) to selected 1.81 (colored)

Commit temporary fix against kva starvation from yamt:

- pool_allocator_alloc: drain ourselves as well,
  so that pool_cache on us is drained as well.
- pool_cache_put_paddr: destruct objects if underlying pool is starved.
- pool_get: on kva starvation, wake up once a second and try again.

Fixes:
PR/32287: Processes hang in "mclpl"
PR/32330: shark kernel hangs under memory load.

Revision 1.87.2.7 / (download) - annotate - [select for diffs], Sun Dec 11 10:29:12 2005 UTC (18 years, 3 months ago) by christos
Branch: ktrace-lwp
Changes since 1.87.2.6: +18 -2 lines
Diff to previous 1.87.2.6 (colored) next main 1.88 (colored) to selected 1.81 (colored)

Sync with head.

Revision 1.108 / (download) - annotate - [select for diffs], Thu Dec 1 13:21:05 2005 UTC (18 years, 3 months ago) by yamt
Branch: MAIN
CVS Tags: ktrace-lwp-base
Changes since 1.107: +18 -2 lines
Diff to previous 1.107 (colored) to selected 1.81 (colored)

add "show all pools" command for ddb.

Revision 1.87.2.6 / (download) - annotate - [select for diffs], Thu Nov 10 14:09:45 2005 UTC (18 years, 4 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.87.2.5: +226 -163 lines
Diff to previous 1.87.2.5 (colored) to selected 1.81 (colored)

Sync with HEAD. Here we go again...

Revision 1.107 / (download) - annotate - [select for diffs], Wed Nov 2 14:32:54 2005 UTC (18 years, 4 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base3, yamt-readahead-base2, yamt-readahead-base, yamt-readahead
Changes since 1.106: +3 -7 lines
Diff to previous 1.106 (colored) to selected 1.81 (colored)

pool_printit: don't keep a lock when printing info.
we can't clean it up if ddb pager is quitted.

Revision 1.106 / (download) - annotate - [select for diffs], Sun Oct 16 02:55:18 2005 UTC (18 years, 5 months ago) by christos
Branch: MAIN
CVS Tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, thorpej-vnode-attr-base, thorpej-vnode-attr
Changes since 1.105: +9 -11 lines
Diff to previous 1.105 (colored) to selected 1.81 (colored)

Make the grouplist invalidate function take a grouplist instead of a group.
Suggested by yamt.

Revision 1.105 / (download) - annotate - [select for diffs], Sun Oct 16 02:21:40 2005 UTC (18 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.104: +20 -9 lines
Diff to previous 1.104 (colored) to selected 1.81 (colored)

This is why I hate gotos: My previous change had different semantics than
the original code since if fullgroups was empty and partgroups wasn't, we
would not clean up partgroups (pointed out by yamt). Well, this one has
different semantics from the original, they are the correct ones I think..

Revision 1.104 / (download) - annotate - [select for diffs], Sun Oct 16 00:28:04 2005 UTC (18 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.103: +4 -9 lines
Diff to previous 1.103 (colored) to selected 1.81 (colored)

avoid a goto.

Revision 1.103 / (download) - annotate - [select for diffs], Sat Oct 15 21:22:46 2005 UTC (18 years, 5 months ago) by chs
Branch: MAIN
Changes since 1.102: +21 -12 lines
Diff to previous 1.102 (colored) to selected 1.81 (colored)

in pool_do_cache_invalidate(), make sure to process both full and partial
group lists even if the first one we look at is empty.  fix ddb print routine.

Revision 1.102 / (download) - annotate - [select for diffs], Sun Oct 2 17:29:31 2005 UTC (18 years, 5 months ago) by chs
Branch: MAIN
Changes since 1.101: +155 -131 lines
Diff to previous 1.101 (colored) to selected 1.81 (colored)

optimize pool_caches similarly to how I optimized pools before:
split the single list of pool cache groups into three lists:
completely full, partially full, and completely empty.
use LIST instead of TAILQ where appropriate.

Revision 1.99.8.1 / (download) - annotate - [select for diffs], Sat Jun 18 11:13:12 2005 UTC (18 years, 9 months ago) by tron
Branch: netbsd-3
CVS Tags: netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1
Branch point for: netbsd-3-0
Changes since 1.99: +114 -84 lines
Diff to previous 1.99 (colored) to selected 1.81 (colored)

Pull up revision 1.101 (requested by thorpej in ticket #474):
Fix some locking issues:
- Make the locking rules for pr_rmpage() sane, and don't modify fields
protected by the pool lock without actually holding it.
- Always defer freeing the pool page to the back-end allocator, to avoid
invoking the pool_allocator with the pool locked (which would violate
the pool_allocator -> pool locking order).
- Fix pool_reclaim() to not violate the pool_cache -> pool locking order
by using a trylock.
Reviewed by Chuq Silvers.

Revision 1.101 / (download) - annotate - [select for diffs], Sat Jun 18 01:34:03 2005 UTC (18 years, 9 months ago) by thorpej
Branch: MAIN
Branch point for: yamt-lazymbuf
Changes since 1.100: +114 -84 lines
Diff to previous 1.100 (colored) to selected 1.81 (colored)

Fix some locking issues:
- Make the locking rules for pr_rmpage() sane, and don't modify fields
  protected by the pool lock without actually holding it.
- Always defer freeing the pool page to the back-end allocator, to avoid
  invoking the pool_allocator with the pool locked (which would violate
  the pool_allocator -> pool locking order).
- Fix pool_reclaim() to not violate the pool_cache -> pool locking order
  by using a trylock.

Reviewed by Chuq Silvers.

Revision 1.99.2.1 / (download) - annotate - [select for diffs], Fri Apr 29 11:29:24 2005 UTC (18 years, 10 months ago) by kent
Branch: kent-audio2
Changes since 1.99: +6 -7 lines
Diff to previous 1.99 (colored) next main 1.100 (colored) to selected 1.81 (colored)

sync with -current

Revision 1.87.2.5 / (download) - annotate - [select for diffs], Fri Apr 1 14:30:56 2005 UTC (18 years, 11 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.87.2.4: +6 -7 lines
Diff to previous 1.87.2.4 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.100 / (download) - annotate - [select for diffs], Fri Apr 1 11:59:37 2005 UTC (18 years, 11 months ago) by yamt
Branch: MAIN
CVS Tags: kent-audio2-base
Changes since 1.99: +6 -7 lines
Diff to previous 1.99 (colored) to selected 1.81 (colored)

merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
  save some resources like pv_entry.  also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.

Revision 1.99.4.1 / (download) - annotate - [select for diffs], Tue Jan 25 12:59:35 2005 UTC (19 years, 1 month ago) by yamt
Branch: yamt-km
Changes since 1.99: +6 -7 lines
Diff to previous 1.99 (colored) next main 1.100 (colored) to selected 1.81 (colored)

convert to new apis.

Revision 1.87.2.4 / (download) - annotate - [select for diffs], Mon Jan 17 19:32:25 2005 UTC (19 years, 2 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.87.2.3: +238 -70 lines
Diff to previous 1.87.2.3 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.99 / (download) - annotate - [select for diffs], Sat Jan 1 21:09:56 2005 UTC (19 years, 2 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-km-base4, yamt-km-base3, yamt-km-base2, yamt-km-base, netbsd-3-base, kent-audio1-beforemerge
Branch point for: yamt-km, netbsd-3, kent-audio2
Changes since 1.98: +22 -13 lines
Diff to previous 1.98 (colored) to selected 1.81 (colored)

PR_NOTOUCH:
- use uint8_t instead of uint16_t for freelist index.
- set ph_off only if PR_NOTOUCH.
- comment.

Revision 1.98 / (download) - annotate - [select for diffs], Sat Jan 1 21:08:02 2005 UTC (19 years, 2 months ago) by yamt
Branch: MAIN
Changes since 1.97: +32 -15 lines
Diff to previous 1.97 (colored) to selected 1.81 (colored)

in the case of !PMAP_MAP_POOLPAGE, gather pool backend allocations to
large chunks for kernel_map and kmem_map to ease kva fragmentation.

Revision 1.97 / (download) - annotate - [select for diffs], Sat Jan 1 21:04:39 2005 UTC (19 years, 2 months ago) by yamt
Branch: MAIN
Changes since 1.96: +206 -64 lines
Diff to previous 1.96 (colored) to selected 1.81 (colored)

introduce a new flag for pool_init, PR_NOTOUCH.
if it's specified, don't use free items as storage for internal state.
so that we can use pools for non memory backed objects.
inspired from solaris's KMC_NOTOUCH.

Revision 1.87.2.3 / (download) - annotate - [select for diffs], Tue Sep 21 13:35:12 2004 UTC (19 years, 6 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.87.2.2: +2 -2 lines
Diff to previous 1.87.2.2 (colored) to selected 1.81 (colored)

Fix the sync with head I botched.

Revision 1.87.2.2 / (download) - annotate - [select for diffs], Sat Sep 18 14:53:03 2004 UTC (19 years, 6 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.87.2.1: +0 -0 lines
Diff to previous 1.87.2.1 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.87.2.1 / (download) - annotate - [select for diffs], Tue Aug 3 10:52:55 2004 UTC (19 years, 7 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.87: +292 -209 lines
Diff to previous 1.87 (colored) to selected 1.81 (colored)

Sync with HEAD

Revision 1.93.2.1 / (download) - annotate - [select for diffs], Tue Jun 22 08:58:42 2004 UTC (19 years, 9 months ago) by tron
Branch: netbsd-2-0
CVS Tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2
Changes since 1.93: +3 -5 lines
Diff to previous 1.93 (colored) next main 1.94 (colored) to selected 1.81 (colored)

Pull up revision 1.96 (requested by thorpej in ticket #522):
Remove PR_IMMEDRELEASE, since setting the high water mark will achieve
the same thing.
Pointed out back in January by YAMAMOTO Takashi.

Revision 1.96 / (download) - annotate - [select for diffs], Sun Jun 20 18:19:27 2004 UTC (19 years, 9 months ago) by thorpej
Branch: MAIN
CVS Tags: kent-audio1-base, kent-audio1
Changes since 1.95: +3 -5 lines
Diff to previous 1.95 (colored) to selected 1.81 (colored)

Remove PR_IMMEDRELEASE, since setting the high water mark will achieve
the same thing.

Pointed out back in January by YAMAMOTO Takashi.

Revision 1.95 / (download) - annotate - [select for diffs], Thu May 20 05:08:29 2004 UTC (19 years, 10 months ago) by atatat
Branch: MAIN
Changes since 1.94: +5 -2 lines
Diff to previous 1.94 (colored) to selected 1.81 (colored)

Add a DIAGNOSTIC check to detect un-initialized pools.

Revision 1.94 / (download) - annotate - [select for diffs], Sun Apr 25 16:42:41 2004 UTC (19 years, 10 months ago) by simonb
Branch: MAIN
Changes since 1.93: +17 -2 lines
Diff to previous 1.93 (colored) to selected 1.81 (colored)

Initialise (most) pools from a link set instead of explicit calls
to pool_init.  Untouched pools are ones that either in arch-specific
code, or aren't initialiased during initial system startup.

 Convert struct session, ucred and lockf to pools.

Revision 1.93 / (download) - annotate - [select for diffs], Mon Mar 8 22:48:09 2004 UTC (20 years ago) by dbj
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.92: +17 -5 lines
Diff to previous 1.92 (colored) to selected 1.81 (colored)

add splvm() around a few pa_slock and psppool calls since they
may be shared with pools that can be used in interrupt context.

Revision 1.92 / (download) - annotate - [select for diffs], Sun Feb 22 00:19:48 2004 UTC (20 years, 1 month ago) by enami
Branch: MAIN
Changes since 1.91: +20 -12 lines
Diff to previous 1.91 (colored) to selected 1.81 (colored)

Modify pool page header allocation strategy as follows:
In addition to current one (i.e., don't wast so large part of the page),
- if the header fitsin the page without wasting any items, put it there.
- don't put the header in the page if it may consume rather big item.

For example, on i386, header is now allocated in the page for the pools
like fdescpl or sigapl, and allocated off the page for the pools like
buf1k or buf2k.

Revision 1.91 / (download) - annotate - [select for diffs], Fri Jan 16 12:47:37 2004 UTC (20 years, 2 months ago) by yamt
Branch: MAIN
Changes since 1.90: +23 -8 lines
Diff to previous 1.90 (colored) to selected 1.81 (colored)

- fix locking order problem. (pa_slock -> pr_slock)
- protect pr_phtree with pr_slock.
- add some LOCK_ASSERTs.

Revision 1.90 / (download) - annotate - [select for diffs], Fri Jan 9 19:00:16 2004 UTC (20 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.89: +10 -5 lines
Diff to previous 1.89 (colored) to selected 1.81 (colored)

Add a new pool initialization flag, PR_IMMEDRELEASE.  This flag causes
idle pool pages to be returned to the system immediately upon becoming
de-fragmented.

Also, in pool_do_put(), don't free back an idle page unless we are over
our minimum page claim.

Revision 1.89 / (download) - annotate - [select for diffs], Mon Dec 29 16:04:58 2003 UTC (20 years, 2 months ago) by yamt
Branch: MAIN
Changes since 1.88: +6 -3 lines
Diff to previous 1.88 (colored) to selected 1.81 (colored)

pool_prime_page: initialize ph_time to mono_time instead of zero
as it's a mono_time relative value.

Revision 1.88 / (download) - annotate - [select for diffs], Thu Nov 13 02:44:01 2003 UTC (20 years, 4 months ago) by chs
Branch: MAIN
Changes since 1.87: +214 -190 lines
Diff to previous 1.87 (colored) to selected 1.81 (colored)

two changes in improve scalability:

 (1) split the single list of pages allocated to a pool into three lists:
     completely full, partially full, and completely empty.
     there is no longer any need to traverse any list looking for a
     certain type of page.

 (2) replace the 8-element hash table for out-of-page page headers
     with a splay tree.

these two changes (together with the recent enhancements to the wait code)
give us linear scaling for a fork+exit microbenchmark.

Revision 1.87 / (download) - annotate - [select for diffs], Wed Apr 9 18:22:13 2003 UTC (20 years, 11 months ago) by thorpej
Branch: MAIN
Branch point for: ktrace-lwp
Changes since 1.86: +42 -20 lines
Diff to previous 1.86 (colored) to selected 1.81 (colored)

Add the ability for pool caches to cache the physical address of
objects.  Clients of the pool_cache API must consistently use
the "paddr" variants or not, otherwise behavior is undefined.

Enable this on Alpha, ARM, MIPS, and x86.  Other platforms must
define POOL_VTOPHYS() in the appropriate manner in order to enable
the feature.

Part 1 of a series of simple patches contributed by Wasabi Systems
to improve network performance.

Revision 1.86 / (download) - annotate - [select for diffs], Sun Mar 16 08:06:51 2003 UTC (21 years ago) by matt
Branch: MAIN
Changes since 1.85: +3 -3 lines
Diff to previous 1.85 (colored) to selected 1.81 (colored)

Only define POOL_LOGSIZE/pool_size if POOL_DIAGNOSTIC is defined.

Revision 1.85 / (download) - annotate - [select for diffs], Sun Feb 23 21:25:19 2003 UTC (21 years ago) by pk
Branch: MAIN
Changes since 1.84: +5 -5 lines
Diff to previous 1.84 (colored) to selected 1.81 (colored)

Use splvm() instead of splhigh() when accessing the internal page header pool.

Revision 1.84 / (download) - annotate - [select for diffs], Sat Jan 18 10:06:33 2003 UTC (21 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.83: +3 -3 lines
Diff to previous 1.83 (colored) to selected 1.81 (colored)

Merge the nathanw_sa branch.

Revision 1.50.2.13 / (download) - annotate - [select for diffs], Wed Dec 11 06:43:08 2002 UTC (21 years, 3 months ago) by thorpej
Branch: nathanw_sa
CVS Tags: nathanw_sa_end
Changes since 1.50.2.12: +2 -2 lines
Diff to previous 1.50.2.12 (colored) to branchpoint 1.50 (colored) next main 1.51 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.83 / (download) - annotate - [select for diffs], Sun Nov 24 11:37:57 2002 UTC (21 years, 3 months ago) by scw
Branch: MAIN
CVS Tags: nathanw_sa_before_merge, nathanw_sa_base, gmcgarry_ucred_base, gmcgarry_ucred, gmcgarry_ctxsw_base, gmcgarry_ctxsw, fvdl_fs64_base
Changes since 1.82: +4 -4 lines
Diff to previous 1.82 (colored) to selected 1.81 (colored)

Quell uninitialised variable warnings.

Revision 1.76.6.1 / (download) - annotate - [select for diffs], Mon Nov 11 23:31:43 2002 UTC (21 years, 4 months ago) by he
Branch: netbsd-1-6
CVS Tags: netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001
Changes since 1.76: +5 -3 lines
Diff to previous 1.76 (colored) next main 1.77 (colored) to selected 1.81 (colored)

Pull up revision 1.78 (requested by thorpej in ticket #582):
  Bring down a fix from the "newlock" branch, slightly modified:
   o In pool_prime_page(), assert that the object being placed
     onto the free list meets the alignment constraints (that
     "ioff" within the object is aligned to "align").
   o In pool_init(), round up the object size to the alignment
     value (or ALIGN(1), if no special alignment is needed) so
     that the above invariant holds true.

Revision 1.50.2.12 / (download) - annotate - [select for diffs], Mon Nov 11 22:13:58 2002 UTC (21 years, 4 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.50.2.11: +2 -3 lines
Diff to previous 1.50.2.11 (colored) to branchpoint 1.50 (colored) to selected 1.81 (colored)

Catch up to -current

Revision 1.82 / (download) - annotate - [select for diffs], Sat Nov 9 20:12:55 2002 UTC (21 years, 4 months ago) by thorpej
Branch: MAIN
Changes since 1.81: +4 -4 lines
Diff to previous 1.81 (colored)

Fix signed/unsigned comparison warnings.

Revision 1.81 / (download) - annotate - [selected], Fri Nov 8 02:08:57 2002 UTC (21 years, 4 months ago) by enami
Branch: MAIN
Changes since 1.80: +2 -3 lines
Diff to previous 1.80 (colored)

Parse the modifier of ddb command as documented.

Revision 1.50.2.11 / (download) - annotate - [select for diffs], Fri Oct 18 02:44:55 2002 UTC (21 years, 5 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.50.2.10: +3 -3 lines
Diff to previous 1.50.2.10 (colored) to branchpoint 1.50 (colored) to selected 1.81 (colored)

Catch up to -current.

Revision 1.60.2.4 / (download) - annotate - [select for diffs], Thu Oct 10 18:43:14 2002 UTC (21 years, 5 months ago) by jdolecek
Branch: kqueue
Changes since 1.60.2.3: +5 -5 lines
Diff to previous 1.60.2.3 (colored) to branchpoint 1.60 (colored) next main 1.61 (colored) to selected 1.81 (colored)

sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work

Revision 1.80 / (download) - annotate - [select for diffs], Fri Sep 27 15:37:46 2002 UTC (21 years, 5 months ago) by provos
Branch: MAIN
CVS Tags: kqueue-beforemerge, kqueue-base, kqueue-aftermerge
Changes since 1.79: +5 -5 lines
Diff to previous 1.79 (colored) to selected 1.81 (colored)

remove trailing \n in panic().  approved perry.

Revision 1.60.2.3 / (download) - annotate - [select for diffs], Fri Sep 6 08:48:04 2002 UTC (21 years, 6 months ago) by jdolecek
Branch: kqueue
Changes since 1.60.2.2: +8 -5 lines
Diff to previous 1.60.2.2 (colored) to branchpoint 1.60 (colored) to selected 1.81 (colored)

sync kqueue branch with HEAD

Revision 1.76.4.2 / (download) - annotate - [select for diffs], Thu Aug 29 05:23:10 2002 UTC (21 years, 6 months ago) by gehenna
Branch: gehenna-devsw
Changes since 1.76.4.1: +7 -4 lines
Diff to previous 1.76.4.1 (colored) to branchpoint 1.76 (colored) next main 1.77 (colored) to selected 1.81 (colored)

catch up with -current.

Revision 1.50.2.10 / (download) - annotate - [select for diffs], Tue Aug 27 23:47:30 2002 UTC (21 years, 6 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.50.2.9: +2 -1 lines
Diff to previous 1.50.2.9 (colored) to branchpoint 1.50 (colored) to selected 1.81 (colored)

Catch up to -current.

Revision 1.79 / (download) - annotate - [select for diffs], Sun Aug 25 23:03:40 2002 UTC (21 years, 6 months ago) by thorpej
Branch: MAIN
CVS Tags: gehenna-devsw-base
Changes since 1.78: +4 -3 lines
Diff to previous 1.78 (colored) to selected 1.81 (colored)

Fix signed/unsigned comparison warnings from GCC 3.3.

Revision 1.50.2.9 / (download) - annotate - [select for diffs], Thu Aug 1 02:46:24 2002 UTC (21 years, 7 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.50.2.8: +6 -4 lines
Diff to previous 1.50.2.8 (colored) to branchpoint 1.50 (colored) to selected 1.81 (colored)

Catch up to -current.

Revision 1.78 / (download) - annotate - [select for diffs], Tue Jul 30 01:41:00 2002 UTC (21 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.77: +5 -3 lines
Diff to previous 1.77 (colored) to selected 1.81 (colored)

Bring down a fix from the "newlock" branch, slightly modified:
* In pool_prime_page(), assert that the object being placed onto the
  free list meets the alignment constraints (that "ioff" within the
  object is aligned to "align").
* In pool_init(), round up the object size to the alignment value (or
  ALIGN(1), if no special alignment is needed) so that the above invariant
  holds true.

Revision 1.76.4.1 / (download) - annotate - [select for diffs], Mon Jul 15 10:36:39 2002 UTC (21 years, 8 months ago) by gehenna
Branch: gehenna-devsw
Changes since 1.76: +3 -3 lines
Diff to previous 1.76 (colored) to selected 1.81 (colored)

catch up with -current.

Revision 1.77 / (download) - annotate - [select for diffs], Thu Jul 11 17:18:48 2002 UTC (21 years, 8 months ago) by matt
Branch: MAIN
Changes since 1.76: +3 -3 lines
Diff to previous 1.76 (colored) to selected 1.81 (colored)

Add wchan to a panic (must have NOWAIT).

Revision 1.50.2.8 / (download) - annotate - [select for diffs], Mon Jun 24 22:10:56 2002 UTC (21 years, 8 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.50.2.7: +3 -3 lines
Diff to previous 1.50.2.7 (colored) to branchpoint 1.50 (colored) to selected 1.81 (colored)

Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).

Revision 1.50.2.7 / (download) - annotate - [select for diffs], Mon Apr 1 07:47:56 2002 UTC (21 years, 11 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.50.2.6: +344 -202 lines
Diff to previous 1.50.2.6 (colored) to branchpoint 1.50 (colored) to selected 1.81 (colored)

Catch up to -current.
(CVS: It's not just a program. It's an adventure!)

Revision 1.60.2.2 / (download) - annotate - [select for diffs], Sat Mar 16 16:01:50 2002 UTC (22 years ago) by jdolecek
Branch: kqueue
Changes since 1.60.2.1: +344 -202 lines
Diff to previous 1.60.2.1 (colored) to branchpoint 1.60 (colored) to selected 1.81 (colored)

Catch up with -current.

Revision 1.76 / (download) - annotate - [select for diffs], Wed Mar 13 10:57:18 2002 UTC (22 years ago) by simonb
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, eeh-devprop-base, eeh-devprop
Branch point for: netbsd-1-6, gehenna-devsw
Changes since 1.75: +2 -12 lines
Diff to previous 1.75 (colored) to selected 1.81 (colored)

Move 'struct pool_cache_group' definition into <sys/pool.h>

Revision 1.75 / (download) - annotate - [select for diffs], Wed Mar 13 08:12:58 2002 UTC (22 years ago) by simonb
Branch: MAIN
Changes since 1.74: +4 -6 lines
Diff to previous 1.74 (colored) to selected 1.81 (colored)

Remove two instances of an "error" variable that is only ever assigned to
but not used.

Revision 1.74.2.2 / (download) - annotate - [select for diffs], Tue Mar 12 15:54:04 2002 UTC (22 years ago) by thorpej
Branch: newlock
Changes since 1.74.2.1: +4 -5 lines
Diff to previous 1.74.2.1 (colored) to branchpoint 1.74 (colored) next main 1.75 (colored) to selected 1.81 (colored)

Do the previous differently; instead, pad the size the the structure
to the specified alignment, the way we pad to the system's natural
alignment.

Revision 1.74.2.1 / (download) - annotate - [select for diffs], Tue Mar 12 07:53:25 2002 UTC (22 years ago) by thorpej
Branch: newlock
Changes since 1.74: +16 -6 lines
Diff to previous 1.74 (colored) to selected 1.81 (colored)

Sprinkle some assertions around that ensures that the returned
object is aligned as requested.

Bug fix: in pool_prime_page(), make sure to account for alignment when
advancing the pointer through the page.

Revision 1.74 / (download) - annotate - [select for diffs], Sat Mar 9 18:06:55 2002 UTC (22 years ago) by thorpej
Branch: MAIN
CVS Tags: newlock-base
Branch point for: newlock
Changes since 1.73: +42 -2 lines
Diff to previous 1.73 (colored) to selected 1.81 (colored)

Put back pool_prime(); the i386 mp pmap uses it.

Revision 1.73 / (download) - annotate - [select for diffs], Sat Mar 9 05:14:33 2002 UTC (22 years ago) by thorpej
Branch: MAIN
Changes since 1.72: +5 -7 lines
Diff to previous 1.72 (colored) to selected 1.81 (colored)

Fix a couple of typos in simple_{,un}lock()'s.

Revision 1.72 / (download) - annotate - [select for diffs], Sat Mar 9 01:56:27 2002 UTC (22 years ago) by thorpej
Branch: MAIN
Changes since 1.71: +2 -42 lines
Diff to previous 1.71 (colored) to selected 1.81 (colored)

Remove pool_prime().  Nothing uses it, and how it should be used it not
really well-defined in the absense of PR_STATIC.

Revision 1.71 / (download) - annotate - [select for diffs], Sat Mar 9 01:37:19 2002 UTC (22 years ago) by thorpej
Branch: MAIN
Changes since 1.70: +4 -3 lines
Diff to previous 1.70 (colored) to selected 1.81 (colored)

If, when a page becomes idle, the backend allocator is waiting for
resources, release the page immediately, rather than letting it sit
around cached.

From art@openbsd.org.

Revision 1.70 / (download) - annotate - [select for diffs], Sat Mar 9 01:33:34 2002 UTC (22 years ago) by thorpej
Branch: MAIN
Changes since 1.69: +4 -26 lines
Diff to previous 1.69 (colored) to selected 1.81 (colored)

Remove PR_MALLOCOK and PR_STATIC.  The former wasn't actually used,
and the latter, while there was some code tested the bit, was woefully
incomplete and also unused by anything.  Besides, PR_STATIC functionality
could be better handled by backend allocators anyhow.

From art@openbsd.org

Revision 1.69 / (download) - annotate - [select for diffs], Fri Mar 8 21:43:54 2002 UTC (22 years ago) by thorpej
Branch: MAIN
Changes since 1.68: +3 -2 lines
Diff to previous 1.68 (colored) to selected 1.81 (colored)

Add a missing simple_unlock.

Revision 1.68 / (download) - annotate - [select for diffs], Fri Mar 8 21:41:59 2002 UTC (22 years ago) by thorpej
Branch: MAIN
Changes since 1.67: +56 -3 lines
Diff to previous 1.67 (colored) to selected 1.81 (colored)

Add an optional "drain" client callback, which can be set by the new
pool_set_drain_hook().  This hook is called in three cases:
* When a pool has hit the hard limit, just before either erroring
  out or sleeping.
* When a backend allocator fails to allocate memory.
* Just before trying to reclaim pages in pool_reclaim().

This hook requests the client to try and free some items back to
the pool.

From art@openbsd.org.

Revision 1.67 / (download) - annotate - [select for diffs], Fri Mar 8 20:51:26 2002 UTC (22 years ago) by thorpej
Branch: MAIN
Changes since 1.66: +2 -5 lines
Diff to previous 1.66 (colored) to selected 1.81 (colored)

Remove PR_FREEHEADER; nothing uses it anymore.

From art@openbsd.org.

Revision 1.66 / (download) - annotate - [select for diffs], Fri Mar 8 20:48:41 2002 UTC (22 years ago) by thorpej
Branch: MAIN
Changes since 1.65: +286 -160 lines
Diff to previous 1.65 (colored) to selected 1.81 (colored)

Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map).  Try to deal with this:

* Group all information about the backend allocator for a pool in a
  separate structure.  The pool references this structure, rather than
  the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
  to become available, but will still fail if it cannot callocate KVA
  space for the pages.  If this happens, carefully drain all pools using
  the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
  some pages, and use that information to make draining easier and more
  efficient.
* Get rid of PR_URGENT.  There was only one use of it, and it could be
  dealt with by the caller.

From art@openbsd.org.

Revision 1.60.2.1 / (download) - annotate - [select for diffs], Thu Jan 10 20:00:01 2002 UTC (22 years, 2 months ago) by thorpej
Branch: kqueue
Changes since 1.60: +132 -49 lines
Diff to previous 1.60 (colored) to selected 1.81 (colored)

Sync kqueue branch with -current.

Revision 1.50.2.6 / (download) - annotate - [select for diffs], Tue Jan 8 00:32:37 2002 UTC (22 years, 2 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.50.2.5: +6 -2 lines
Diff to previous 1.50.2.5 (colored) to branchpoint 1.50 (colored) to selected 1.81 (colored)

Catch up to -current.

Revision 1.65 / (download) - annotate - [select for diffs], Tue Nov 20 06:57:04 2001 UTC (22 years, 4 months ago) by enami
Branch: MAIN
CVS Tags: ifpoll-base
Changes since 1.64: +6 -2 lines
Diff to previous 1.64 (colored) to selected 1.81 (colored)

Call pr_log(PRLOG_GET) when POOL_DIAGNOSTIC is defined instead of DIAGNOSTIC
for consistency.

Revision 1.50.2.5 / (download) - annotate - [select for diffs], Wed Nov 14 19:16:40 2001 UTC (22 years, 4 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.50.2.4: +4 -1 lines
Diff to previous 1.50.2.4 (colored) to branchpoint 1.50 (colored) to selected 1.81 (colored)

Catch up to -current.

Revision 1.63.2.1 / (download) - annotate - [select for diffs], Mon Nov 12 21:18:52 2001 UTC (22 years, 4 months ago) by thorpej
Branch: thorpej-mips-cache
Changes since 1.63: +4 -1 lines
Diff to previous 1.63 (colored) next main 1.64 (colored) to selected 1.81 (colored)

Sync the thorpej-mips-cache branch with -current.

Revision 1.64 / (download) - annotate - [select for diffs], Mon Nov 12 15:25:20 2001 UTC (22 years, 4 months ago) by lukem
Branch: MAIN
CVS Tags: thorpej-mips-cache-base
Changes since 1.63: +4 -1 lines
Diff to previous 1.63 (colored) to selected 1.81 (colored)

add RCSIDs

Revision 1.50.2.4 / (download) - annotate - [select for diffs], Mon Oct 22 20:41:50 2001 UTC (22 years, 5 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.50.2.3: +66 -3 lines
Diff to previous 1.50.2.3 (colored) to branchpoint 1.50 (colored) to selected 1.81 (colored)

Catch up to -current.

Revision 1.63 / (download) - annotate - [select for diffs], Sun Oct 21 00:06:05 2001 UTC (22 years, 5 months ago) by chs
Branch: MAIN
Branch point for: thorpej-mips-cache
Changes since 1.62: +2 -3 lines
Diff to previous 1.62 (colored) to selected 1.81 (colored)

in pool_drain(), call pool_reclaim() while we still have interrupts blocked
since the pool in question might be one used in interrupt context.

Revision 1.60.4.2 / (download) - annotate - [select for diffs], Thu Oct 11 00:02:31 2001 UTC (22 years, 5 months ago) by fvdl
Branch: thorpej-devvp
Changes since 1.60.4.1: +65 -1 lines
Diff to previous 1.60.4.1 (colored) to branchpoint 1.60 (colored) next main 1.61 (colored) to selected 1.81 (colored)

Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.

Revision 1.62 / (download) - annotate - [select for diffs], Sun Oct 7 12:44:06 2001 UTC (22 years, 5 months ago) by bjh21
Branch: MAIN
CVS Tags: thorpej-devvp-base3
Changes since 1.61: +65 -1 lines
Diff to previous 1.61 (colored) to selected 1.81 (colored)

Add support for allocating pool memory in units smaller than a whole page.
This is activated by defining POOL_SUBPAGE to the size of the new allocation
unit, and makes pools much more efficient on machines with obscenely large
pages.  It might even make four-megabyte arm26 systems usable.

Revision 1.60.4.1 / (download) - annotate - [select for diffs], Mon Oct 1 12:46:55 2001 UTC (22 years, 5 months ago) by fvdl
Branch: thorpej-devvp
Changes since 1.60: +62 -49 lines
Diff to previous 1.60 (colored) to selected 1.81 (colored)

Catch up with -current.

Revision 1.50.2.3 / (download) - annotate - [select for diffs], Wed Sep 26 19:55:05 2001 UTC (22 years, 5 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.50.2.2: +62 -49 lines
Diff to previous 1.50.2.2 (colored) to branchpoint 1.50 (colored) to selected 1.81 (colored)

Catch up to -current.
Again.

Revision 1.61 / (download) - annotate - [select for diffs], Wed Sep 26 07:14:56 2001 UTC (22 years, 5 months ago) by chs
Branch: MAIN
CVS Tags: thorpej-devvp-base2
Changes since 1.60: +62 -49 lines
Diff to previous 1.60 (colored) to selected 1.81 (colored)

jump through hoops to avoid calling uvm_km_free_poolpage() while holding
spinlocks, since that function can sleep.  (note that there's still one
instance remaining to be fixed.)  use TAILQ_FOREACH where appropriate.

Revision 1.50.2.2 / (download) - annotate - [select for diffs], Fri Aug 24 00:11:35 2001 UTC (22 years, 7 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.50.2.1: +7 -1 lines
Diff to previous 1.50.2.1 (colored) to branchpoint 1.50 (colored) to selected 1.81 (colored)

Catch up with -current.

Revision 1.60 / (download) - annotate - [select for diffs], Sun Jul 1 06:12:20 2001 UTC (22 years, 8 months ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-devvp-base, pre-chs-ubcperf, post-chs-ubcperf
Branch point for: thorpej-devvp, kqueue
Changes since 1.59: +7 -1 lines
Diff to previous 1.59 (colored) to selected 1.81 (colored)

Protect the `pool cache group' pool with splvm(), so that pool caches
can be used by code that runs in interrupt context.

Revision 1.50.2.1 / (download) - annotate - [select for diffs], Thu Jun 21 20:06:59 2001 UTC (22 years, 9 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.50: +137 -129 lines
Diff to previous 1.50 (colored) to selected 1.81 (colored)

Catch up to -current.

Revision 1.59 / (download) - annotate - [select for diffs], Tue Jun 5 18:51:04 2001 UTC (22 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.58: +12 -8 lines
Diff to previous 1.58 (colored) to selected 1.81 (colored)

Do the reentrancy checking if POOL_DIAGNOSTIC, not DIAGNOSTIC.  Prevents
ABI change for diagnostic vs. non-diagnostic kernels.

Revision 1.58 / (download) - annotate - [select for diffs], Tue Jun 5 04:40:39 2001 UTC (22 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.57: +12 -2 lines
Diff to previous 1.57 (colored) to selected 1.81 (colored)

Assert that no locks are held if we're called with PR_WAITOK.
From Bill Sommerfeld.

Revision 1.57 / (download) - annotate - [select for diffs], Sun May 13 17:17:35 2001 UTC (22 years, 10 months ago) by sommerfeld
Branch: MAIN
Changes since 1.56: +6 -2 lines
Diff to previous 1.56 (colored) to selected 1.81 (colored)

Make this build again ifdef DIAGNOSTIC (oops)

Revision 1.56 / (download) - annotate - [select for diffs], Sun May 13 17:06:59 2001 UTC (22 years, 10 months ago) by sommerfeld
Branch: MAIN
Changes since 1.55: +32 -11 lines
Diff to previous 1.55 (colored) to selected 1.81 (colored)

Remove pool reentrancy testing overhead unless DIAGNOSTIC is defined.
Previously, we passed __FILE__ and __LINE__ on all pool_get/pool_set calls.

This change results in a measured 1.2% performance improvement in
ping-flood packets-per-second as reported by ping(8).

Revision 1.55 / (download) - annotate - [select for diffs], Thu May 10 04:51:41 2001 UTC (22 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.54: +86 -43 lines
Diff to previous 1.54 (colored) to selected 1.81 (colored)

Rearrange the code that adds pages of objects to the pool; require
that the caller allocate the pool_item_header when it allocates the
pool page, so we can avoid a locking pitfall (sleeping with a simple
lock held).

Also revive pool_prime(), as there are some letigimate uses of it,
but in doing so, eliminate some of the bogosities of the old version
(i.e. don't do an implicit "setlowat", just prime the pool, and incr
the minpages for each additional page we add, and compute the number
of pages to prime in a way that callers would expect).

Revision 1.54 / (download) - annotate - [select for diffs], Thu May 10 02:19:32 2001 UTC (22 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.53: +2 -2 lines
Diff to previous 1.53 (colored) to selected 1.81 (colored)

Use POOL_NEEDS_CATCHUP() in one more place.

Revision 1.53 / (download) - annotate - [select for diffs], Thu May 10 01:37:40 2001 UTC (22 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.52: +6 -4 lines
Diff to previous 1.52 (colored) to selected 1.81 (colored)

Encapsulate the test for a pool needing a pool_catchup() in a macro.

Revision 1.52 / (download) - annotate - [select for diffs], Wed May 9 23:46:03 2001 UTC (22 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.51: +4 -93 lines
Diff to previous 1.51 (colored) to selected 1.81 (colored)

Remove pool_create() and pool_prime().  Nothing except pool_create()
used pool_prime(), and no one uses pool_create() anymore.

This makes it easier to fix a locking pitfall.

Revision 1.51 / (download) - annotate - [select for diffs], Fri May 4 19:41:26 2001 UTC (22 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.50: +17 -4 lines
Diff to previous 1.50 (colored) to selected 1.81 (colored)

Add pool_cache_destruct_object(), used to force destruction of
an object and release back into the pool.

Revision 1.30.2.6 / (download) - annotate - [select for diffs], Sun Feb 11 19:16:48 2001 UTC (23 years, 1 month ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.30.2.5: +32 -9 lines
Diff to previous 1.30.2.5 (colored) to branchpoint 1.30 (colored) next main 1.31 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.50 / (download) - annotate - [select for diffs], Mon Jan 29 02:38:02 2001 UTC (23 years, 1 month ago) by enami
Branch: MAIN
CVS Tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base
Branch point for: nathanw_sa
Changes since 1.49: +32 -9 lines
Diff to previous 1.49 (colored) to selected 1.81 (colored)

Don't use PR_URGENT to allocate page header.  We don't want to just panic
on memory shortage.  Instead, use the same wait/nowait condition with the
item requested, and just cleanup and return failure if we can't allocate
page header while we aren't allowed to wait.

Revision 1.30.2.5 / (download) - annotate - [select for diffs], Thu Jan 18 09:23:45 2001 UTC (23 years, 2 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.30.2.4: +2 -2 lines
Diff to previous 1.30.2.4 (colored) to branchpoint 1.30 (colored) to selected 1.81 (colored)

Sync with head (for UBC+NFS fixes, mostly).

Revision 1.49 / (download) - annotate - [select for diffs], Sun Jan 14 02:06:21 2001 UTC (23 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.48: +3 -3 lines
Diff to previous 1.48 (colored) to selected 1.81 (colored)

Change some low-hanging splimp() calls to splvm().

Revision 1.30.2.4 / (download) - annotate - [select for diffs], Wed Dec 13 15:50:21 2000 UTC (23 years, 3 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.30.2.3: +50 -14 lines
Diff to previous 1.30.2.3 (colored) to branchpoint 1.30 (colored) to selected 1.81 (colored)

Sync with HEAD (for UBC fixes).

Revision 1.48 / (download) - annotate - [select for diffs], Mon Dec 11 05:22:56 2000 UTC (23 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.47: +17 -1 lines
Diff to previous 1.47 (colored) to selected 1.81 (colored)

Add some basic statistics to pool_cache.

Revision 1.47 / (download) - annotate - [select for diffs], Sun Dec 10 17:03:34 2000 UTC (23 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.46: +7 -13 lines
Diff to previous 1.46 (colored) to selected 1.81 (colored)

Don't hold a pool cache lock across any call to pool_get() or pool_put().
This allows us to change a try-lock into a normal lock in the reclaim
case.

Revision 1.30.2.3 / (download) - annotate - [select for diffs], Fri Dec 8 09:13:56 2000 UTC (23 years, 3 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.30.2.2: +372 -150 lines
Diff to previous 1.30.2.2 (colored) to branchpoint 1.30 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.46 / (download) - annotate - [select for diffs], Thu Dec 7 21:30:07 2000 UTC (23 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.45: +3 -1 lines
Diff to previous 1.45 (colored) to selected 1.81 (colored)

...and when freeing cache groups, clear `freeto' if that's the one
we're freeing.

Revision 1.45 / (download) - annotate - [select for diffs], Thu Dec 7 20:16:56 2000 UTC (23 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.44: +5 -2 lines
Diff to previous 1.44 (colored) to selected 1.81 (colored)

When we invalidate a pool cache, make sure to clear `allocfrom' if
we empty out that cache group.

Revision 1.44 / (download) - annotate - [select for diffs], Thu Dec 7 19:30:31 2000 UTC (23 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.43: +23 -2 lines
Diff to previous 1.43 (colored) to selected 1.81 (colored)

Add a /c modifier to "show pool" to display pool caches.

Revision 1.43 / (download) - annotate - [select for diffs], Thu Dec 7 05:45:57 2000 UTC (23 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.42: +325 -15 lines
Diff to previous 1.42 (colored) to selected 1.81 (colored)

This is a first-cut implementation of support for caching of
constructed objects in the pool allocator, similar to caching
of constructed objects in the Solaris SLAB allocator.

This implementation is a separate API (pool_cache_*()) layered
on top of pools to keep the caching complexity out of the way
of pools that won't benefit from it.

While we're here, allow pool items to be as large as the pool
page size.

Revision 1.42 / (download) - annotate - [select for diffs], Wed Dec 6 18:20:52 2000 UTC (23 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.41: +50 -138 lines
Diff to previous 1.41 (colored) to selected 1.81 (colored)

ANSI'ify.

Revision 1.30.2.2 / (download) - annotate - [select for diffs], Wed Nov 22 16:05:24 2000 UTC (23 years, 4 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.30.2.1: +3 -2 lines
Diff to previous 1.30.2.1 (colored) to branchpoint 1.30 (colored) to selected 1.81 (colored)

Sync with HEAD.

Revision 1.30.2.1 / (download) - annotate - [select for diffs], Mon Nov 20 18:09:07 2000 UTC (23 years, 4 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.30: +56 -50 lines
Diff to previous 1.30 (colored) to selected 1.81 (colored)

Update thorpej_scsipi to -current as of a month ago

Revision 1.41 / (download) - annotate - [select for diffs], Sun Nov 19 00:29:51 2000 UTC (23 years, 4 months ago) by sommerfeld
Branch: MAIN
Changes since 1.40: +3 -2 lines
Diff to previous 1.40 (colored) to selected 1.81 (colored)

In pool_setlowat(), only call pool_catchup() if the pool is under the
low water mark.  (Avoids annoying warning when you setlowat a static
pool).

Revision 1.40 / (download) - annotate - [select for diffs], Sat Aug 12 16:28:30 2000 UTC (23 years, 7 months ago) by sommerfeld
Branch: MAIN
Changes since 1.39: +3 -7 lines
Diff to previous 1.39 (colored) to selected 1.81 (colored)

Use ltsleep instead of simple_unlock/tsleep/simple_lock

Revision 1.39 / (download) - annotate - [select for diffs], Tue Jun 27 17:41:34 2000 UTC (23 years, 8 months ago) by mrg
Branch: MAIN
Changes since 1.38: +1 -3 lines
Diff to previous 1.38 (colored) to selected 1.81 (colored)

remove include of <vm/vm.h>

Revision 1.38 / (download) - annotate - [select for diffs], Mon Jun 26 14:21:14 2000 UTC (23 years, 8 months ago) by mrg
Branch: MAIN
Changes since 1.37: +1 -2 lines
Diff to previous 1.37 (colored) to selected 1.81 (colored)

remove/move more mach vm header files:

	<vm/pglist.h> -> <uvm/uvm_pglist.h>
	<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
	<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
	<vm/vm_object.h> -> nothing
	<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.

Revision 1.34.2.1 / (download) - annotate - [select for diffs], Thu Jun 22 17:09:16 2000 UTC (23 years, 9 months ago) by minoura
Branch: minoura-xpg4dl
Changes since 1.34: +13 -4 lines
Diff to previous 1.34 (colored) next main 1.35 (colored) to selected 1.81 (colored)

Sync w/ netbsd-1-5-base.

Revision 1.37 / (download) - annotate - [select for diffs], Sat Jun 10 18:44:44 2000 UTC (23 years, 9 months ago) by sommerfeld
Branch: MAIN
CVS Tags: netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, netbsd-1-5
Changes since 1.36: +3 -2 lines
Diff to previous 1.36 (colored) to selected 1.81 (colored)

Fix assorted bugs around shutdown/reboot/panic time.
 - add a new global variable, doing_shutdown, which is nonzero if
vfs_shutdown() or panic() have been called.
- in panic, set RB_NOSYNC if doing_shutdown is already set on entry
so we don't reenter vfs_shutdown if we panic'ed there.
 - in vfs_shutdown, don't use proc0's process for sys_sync unless
curproc is NULL.
 - in lockmgr, attribute successful locks to proc0 if doing_shutdown
&& curproc==NULL, and  panic if we can't get the lock right away; avoids the
spurious lockmgr DIAGNOSTIC panic from the ddb reboot command.
 - in subr_pool, deal with curproc==NULL in the doing_shutdown case.
 - in mfs_strategy, bitbucket writes if doing_shutdown, so we don't
wedge waiting for the mfs process.
 - in ltsleep, treat ((curproc == NULL) && doing_shutdown) like the
panicstr case.

Appears to fix: kern/9239, kern/10187, kern/9367.
May also fix kern/10122.

Revision 1.36 / (download) - annotate - [select for diffs], Wed May 31 15:29:42 2000 UTC (23 years, 9 months ago) by pk
Branch: MAIN
Changes since 1.35: +5 -2 lines
Diff to previous 1.35 (colored) to selected 1.81 (colored)

Allow a pool's pagesz to larger than the VM page size.
Enforce the required page alignment restriction in pool_prime_page().

Revision 1.35 / (download) - annotate - [select for diffs], Wed May 31 15:03:54 2000 UTC (23 years, 9 months ago) by pk
Branch: MAIN
Changes since 1.34: +7 -2 lines
Diff to previous 1.34 (colored) to selected 1.81 (colored)

Assert that the pool item size does not exceed the page size.

Revision 1.34 / (download) - annotate - [select for diffs], Mon May 8 20:09:44 2000 UTC (23 years, 10 months ago) by thorpej
Branch: MAIN
CVS Tags: minoura-xpg4dl-base
Branch point for: minoura-xpg4dl
Changes since 1.33: +17 -16 lines
Diff to previous 1.33 (colored) to selected 1.81 (colored)

__predict_false() the DIAGNOSTIC and other error condition checks.

Revision 1.33 / (download) - annotate - [select for diffs], Thu Apr 13 00:44:19 2000 UTC (23 years, 11 months ago) by chs
Branch: MAIN
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (colored) to selected 1.81 (colored)

always define PI_MAGIC so this compiles in all cases.

Revision 1.32 / (download) - annotate - [select for diffs], Mon Apr 10 02:17:42 2000 UTC (23 years, 11 months ago) by chs
Branch: MAIN
Changes since 1.31: +11 -2 lines
Diff to previous 1.31 (colored) to selected 1.81 (colored)

in pool_put(), fill the entire object with PI_MAGIC instead of just the
first element.

Revision 1.31 / (download) - annotate - [select for diffs], Mon Feb 14 19:28:19 2000 UTC (24 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.30: +16 -22 lines
Diff to previous 1.30 (colored) to selected 1.81 (colored)

Use ratecheck().

Revision 1.21.2.2.4.1 / (download) - annotate - [select for diffs], Tue Nov 30 13:34:45 1999 UTC (24 years, 3 months ago) by itojun
Branch: kame
CVS Tags: kame_141_19991130
Changes since 1.21.2.2: +7 -2 lines
Diff to previous 1.21.2.2 (colored) next main 1.21.2.3 (colored) to selected 1.81 (colored)

bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

The branch does not compile at all (due to the lack of ALTQ and some other
source code).  Please do not try to modify the branch, this is just for
referenre purposes.

synchronization to latest KAME will take place on HEAD branch soon.

Revision 1.30 / (download) - annotate - [select for diffs], Sun Aug 29 00:26:01 1999 UTC (24 years, 6 months ago) by thorpej
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, wrstuden-devbsize, fvdl-softdep-base, fvdl-softdep, comdex-fall-1999-base, comdex-fall-1999, chs-ubc2-newbase
Branch point for: thorpej_scsipi
Changes since 1.29: +9 -1 lines
Diff to previous 1.29 (colored) to selected 1.81 (colored)

In _pool_put(), panic if we're put'ing with nout == 0.  This will help us
detect a little earlier if we've dup-put'd.  Otherwise, underflow occurs,
and subsequent allocations simply hang or fail (it thinks the hardlimit
has been reached).

Revision 1.29 / (download) - annotate - [select for diffs], Thu Aug 5 04:00:04 1999 UTC (24 years, 7 months ago) by sommerfeld
Branch: MAIN
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored) to selected 1.81 (colored)

Create new pool flag PR_LIMITFAIL, indicating that even PR_WAIT
allocations should fail if the pool is at its hard limit.
Document flag in pool(9).
Use it in mbuf.h for the first allocate call for M_GET, M_GETHDR, and
MCLGET, so that m_reclaim gets called even for blocking allocations.

Revision 1.21.2.2.2.3 / (download) - annotate - [select for diffs], Mon Aug 2 22:19:14 1999 UTC (24 years, 7 months ago) by thorpej
Branch: chs-ubc2
Changes since 1.21.2.2.2.2: +9 -1 lines
Diff to previous 1.21.2.2.2.2 (colored) to branchpoint 1.21.2.2 (colored) next main 1.21.2.3 (colored) to selected 1.81 (colored)

Update from trunk.

Revision 1.28 / (download) - annotate - [select for diffs], Tue Jul 27 21:31:17 1999 UTC (24 years, 7 months ago) by thorpej
Branch: MAIN
CVS Tags: chs-ubc2-base
Changes since 1.27: +9 -1 lines
Diff to previous 1.27 (colored) to selected 1.81 (colored)

In _pool_put(), call simple_lock_freecheck() if we're LOCKDEBUG before
we put the item on the free list.

Revision 1.21.2.2.2.2 / (download) - annotate - [select for diffs], Sun Jul 4 01:37:45 1999 UTC (24 years, 8 months ago) by chs
Branch: chs-ubc2
Changes since 1.21.2.2.2.1: +10 -2 lines
Diff to previous 1.21.2.2.2.1 (colored) to branchpoint 1.21.2.2 (colored) to selected 1.81 (colored)

in pool_put(), fill the item with a distinctive pattern ifdef DEBUG.

Revision 1.21.2.4 / (download) - annotate - [select for diffs], Fri Jun 25 00:08:22 1999 UTC (24 years, 9 months ago) by perry
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-PATCH003, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001
Changes since 1.21.2.3: +8 -8 lines
Diff to previous 1.21.2.3 (colored) to branchpoint 1.21 (colored) next main 1.22 (colored) to selected 1.81 (colored)

somehow, the last commit was botched. fix it

Revision 1.21.2.3 / (download) - annotate - [select for diffs], Thu Jun 24 16:14:35 1999 UTC (24 years, 9 months ago) by perry
Branch: netbsd-1-4
Changes since 1.21.2.2: +7 -2 lines
Diff to previous 1.21.2.2 (colored) to branchpoint 1.21 (colored) to selected 1.81 (colored)

pullup 1.26->1.27 (pk): deal with missing "raise interrupt level" code

Revision 1.21.2.2.2.1 / (download) - annotate - [select for diffs], Mon Jun 21 01:24:03 1999 UTC (24 years, 9 months ago) by thorpej
Branch: chs-ubc2
Changes since 1.21.2.2: +240 -79 lines
Diff to previous 1.21.2.2 (colored) to selected 1.81 (colored)

Sync w/ -current.

Revision 1.27 / (download) - annotate - [select for diffs], Sun Jun 6 22:20:15 1999 UTC (24 years, 9 months ago) by pk
Branch: MAIN
Changes since 1.26: +7 -2 lines
Diff to previous 1.26 (colored) to selected 1.81 (colored)

Guard our global resource `phpool' against all interrupts.

Revision 1.26 / (download) - annotate - [select for diffs], Mon May 10 21:15:42 1999 UTC (24 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.25: +3 -1 lines
Diff to previous 1.25 (colored) to selected 1.81 (colored)

Make sure page allocations are counted everywhere that they need to be.

Revision 1.25 / (download) - annotate - [select for diffs], Mon May 10 21:13:05 1999 UTC (24 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.24: +230 -78 lines
Diff to previous 1.24 (colored) to selected 1.81 (colored)

Improve the pool allocator's diagnostic helpers, adding the ability to
log on a per-pool basis, reentrancy checking, and dumping various pool
information from DDB.

Revision 1.24 / (download) - annotate - [select for diffs], Thu Apr 29 17:47:19 1999 UTC (24 years, 10 months ago) by scottr
Branch: MAIN
Changes since 1.23: +3 -1 lines
Diff to previous 1.23 (colored) to selected 1.81 (colored)

Pull in opt_poollog.h for POOL_LOGSIZE.

Revision 1.21.2.2 / (download) - annotate - [select for diffs], Wed Apr 7 00:34:55 1999 UTC (24 years, 11 months ago) by thorpej
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-RELEASE, kame_14_19990705, kame_14_19990628
Branch point for: kame, chs-ubc2
Changes since 1.21.2.1: +22 -11 lines
Diff to previous 1.21.2.1 (colored) to branchpoint 1.21 (colored) to selected 1.81 (colored)

Pull up 1.22 -> 1.23.

Revision 1.23 / (download) - annotate - [select for diffs], Tue Apr 6 23:32:44 1999 UTC (24 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.22: +22 -11 lines
Diff to previous 1.22 (colored) to selected 1.81 (colored)

More locking protocol fixes.  Protect pool_head with a spin lock (statically
initialized).  This lock also protects the "next drain candidate" pointer.

XXX There is still one locking protocol problem, which should not be
a problem in practice, but is still marked as an issue in the code anyhow.

Revision 1.21.2.1 / (download) - annotate - [select for diffs], Sun Apr 4 17:20:14 1999 UTC (24 years, 11 months ago) by chs
Branch: netbsd-1-4
Changes since 1.21: +6 -6 lines
Diff to previous 1.21 (colored) to selected 1.81 (colored)

pull up rev 1.22.  approved by perry.

Revision 1.22 / (download) - annotate - [select for diffs], Sun Apr 4 17:17:31 1999 UTC (24 years, 11 months ago) by chs
Branch: MAIN
Changes since 1.21: +6 -6 lines
Diff to previous 1.21 (colored) to selected 1.81 (colored)

Undo the part of the last revision about pr_rmpage() referencing
a data structure after it was freed.  This wasn't actually a problem,
and the change caused the wrong pool_item_header to be freed
in the non-PR_PHINPAGE case.

Revision 1.21 / (download) - annotate - [select for diffs], Wed Mar 31 23:23:48 1999 UTC (24 years, 11 months ago) by thorpej
Branch: MAIN
CVS Tags: netbsd-1-4-base
Branch point for: netbsd-1-4
Changes since 1.20: +185 -124 lines
Diff to previous 1.20 (colored) to selected 1.81 (colored)

Yet more fixes to the pool allocator:

- Protect userspace from unnecessary header inclusions (as noted on
current-users).

- Some const poisioning.

- GREATLY simplify the locking protocol, and fix potential deadlock
scenarios.  In particular, assume that the back-end page allocator
provides its own locking mechanism (this is currently true for all
such allocators in the NetBSD kernel).  Doing so allows us to simply
use one spin lock for serialized access to all r/w members of the pool
descriptor.  The spin lock is released before calling the back-end
allocator, and re-acquired upon return from it.

- Fix a problem in pr_rmpage() where a data structure was referenced
after it was freed.

- Minor tweak to page manaement.  Migrate both idle and empty pages
to the end of the page list.  As soon as a page becomes un-empty
(by a pool_put()), place it at the head of the page list, and set
curpage to point to it.  This reduces fragmentation as well as the
time required to find a non-empty page as soon as curpage becomes
empty again.

- Use mono_time throughout, and protect access to it w/ splclock().

- In pool_reclaim(), if freeing an idle page would reduce the number
of allocatable items to below the low water mark, don't.

Revision 1.20 / (download) - annotate - [select for diffs], Wed Mar 31 01:14:06 1999 UTC (24 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.19: +243 -29 lines
Diff to previous 1.19 (colored) to selected 1.81 (colored)

Fix several bugs/deficiencies in the pool allocator:

- Add support for hard limits, with optional rate-limited logging of
a warning message when the pool limit is reached.  (This will be used
to fix a bug in mbuf cluster allocation on the MIPS and Alpha ports.)

- Fix some locking protocol errors.  This required splitting pr_flags
into pr_flags (which is protected by the spin lock) and pr_roflags (which
are `read only' flags, set when the pool is initialized, and never changed
again; these do not need to be protected by a mutex).

- Make the low water support actually mean something.  When a low water
mark is set, add free items to the pool until the low water mark is
reached.  When an item allocation causes the number of free items to
drop below the low water mark, make the pool catch up to it.  This can
make the pool allocator more useful for several applications (e.g.
pmap `pv entry' management) and more robust for others (for e.g. mbuf
and mbuf cluster allocation, so that the pagedaemon can use NFS to clean
pages on diskless systems without completely running dry on buffers to
receive packets in during extreme memory shoratages).

- Add a comment where we sleep waiting for more pages for the back-end
page allocator.  Specifically, instead of sleeping potentially forever,
perhaps we should just wake up once a second to try allocating a page
again.  XXX Revisit this soon.

Revision 1.19 / (download) - annotate - [select for diffs], Wed Mar 24 05:51:25 1999 UTC (25 years ago) by mrg
Branch: MAIN
Changes since 1.18: +1 -22 lines
Diff to previous 1.18 (colored) to selected 1.81 (colored)

completely remove Mach VM support.  all that is left is the all the
header files as UVM still uses (most of) these.

Revision 1.18 / (download) - annotate - [select for diffs], Tue Mar 23 02:49:03 1999 UTC (25 years ago) by thorpej
Branch: MAIN
Changes since 1.17: +4 -4 lines
Diff to previous 1.17 (colored) to selected 1.81 (colored)

Fix the order of arguments to roundup().

Revision 1.17 / (download) - annotate - [select for diffs], Sun Dec 27 21:13:43 1998 UTC (25 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.16: +8 -4 lines
Diff to previous 1.16 (colored) to selected 1.81 (colored)

Make this compile with POOL_DIAGNOSTIC, and add a POOL_LOGSIZE option.
Defopt these.

Revision 1.16 / (download) - annotate - [select for diffs], Wed Dec 16 04:28:23 1998 UTC (25 years, 3 months ago) by briggs
Branch: MAIN
Changes since 1.15: +10 -9 lines
Diff to previous 1.15 (colored) to selected 1.81 (colored)

Prototype pool_print() and pool_chk() if DEBUG.
Initialize pool hash table with PR_HASHTABSIZE (i.e., 8) LIST_INIT()s
instead of one memset().
Only check for page != ph->ph_page if PR_PHINPAGE is set (in pool_chk()).
Print pool base pointer when reporting page inconsistency in pool_chk().

Revision 1.15 / (download) - annotate - [select for diffs], Tue Sep 29 18:09:29 1998 UTC (25 years, 5 months ago) by pk
Branch: MAIN
CVS Tags: kenh-if-detach-base, kenh-if-detach, chs-ubc-base, chs-ubc
Changes since 1.14: +55 -25 lines
Diff to previous 1.14 (colored) to selected 1.81 (colored)

In addition to the spinlock, use the lockmgr() to serialize access to
the back-end page allocator. This allows the back-end to sleep since we
now relinquish the spin lock after acquiring the long-term lock.

Revision 1.14 / (download) - annotate - [select for diffs], Tue Sep 22 03:01:29 1998 UTC (25 years, 6 months ago) by thorpej
Branch: MAIN
Changes since 1.13: +4 -1 lines
Diff to previous 1.13 (colored) to selected 1.81 (colored)

Make sure the size is large enough to hold a pool_item.

Revision 1.13 / (download) - annotate - [select for diffs], Sat Sep 12 17:20:02 1998 UTC (25 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored) to selected 1.81 (colored)

Make copyrights consistent; fix weird/trailing spaces add missing (c) etc.

Revision 1.12 / (download) - annotate - [select for diffs], Fri Aug 28 21:18:37 1998 UTC (25 years, 6 months ago) by thorpej
Branch: MAIN
Changes since 1.11: +42 -1 lines
Diff to previous 1.11 (colored) to selected 1.81 (colored)

Add an alternate pool page allocator that can be used if the pool is
never accessed in interrupt context.  In the UVM case, this uses the
kernel_map, to reduce usage of the previous kmem_map resource.

Revision 1.11 / (download) - annotate - [select for diffs], Fri Aug 28 20:05:48 1998 UTC (25 years, 6 months ago) by thorpej
Branch: MAIN
Changes since 1.10: +4 -3 lines
Diff to previous 1.10 (colored) to selected 1.81 (colored)

Add a waitok boolean argument to the VM system's pool page allocator backend.

Revision 1.10 / (download) - annotate - [select for diffs], Thu Aug 13 02:10:58 1998 UTC (25 years, 7 months ago) by eeh
Branch: MAIN
Changes since 1.9: +3 -3 lines
Diff to previous 1.9 (colored) to selected 1.81 (colored)

Merge paddr_t changes into the main branch.

Revision 1.4.2.2 / (download) - annotate - [select for diffs], Sat Aug 8 03:06:56 1998 UTC (25 years, 7 months ago) by eeh
Branch: eeh-paddr_t
Changes since 1.4.2.1: +2 -2 lines
Diff to previous 1.4.2.1 (colored) to branchpoint 1.4 (colored) next main 1.5 (colored) to selected 1.81 (colored)

Revert cdevsw mmap routines to return int.

Revision 1.9 / (download) - annotate - [select for diffs], Tue Aug 4 04:03:15 1998 UTC (25 years, 7 months ago) by perry
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored) to selected 1.81 (colored)

Abolition of bcopy, ovbcopy, bcmp, and bzero, phase one.
  bcopy(x, y, z) ->  memcpy(y, x, z)
ovbcopy(x, y, z) -> memmove(y, x, z)
   bcmp(x, y, z) ->  memcmp(x, y, z)
  bzero(x, y)    ->  memset(x, 0, y)

Revision 1.8 / (download) - annotate - [select for diffs], Sun Aug 2 19:07:47 1998 UTC (25 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.7: +2 -1 lines
Diff to previous 1.7 (colored) to selected 1.81 (colored)

Make sure we initialize pr_nidle.

Revision 1.7 / (download) - annotate - [select for diffs], Sun Aug 2 04:34:46 1998 UTC (25 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.6: +10 -7 lines
Diff to previous 1.6 (colored) to selected 1.81 (colored)

Fix a braino in the idle page instrumentation.

Revision 1.6 / (download) - annotate - [select for diffs], Sat Aug 1 23:44:21 1998 UTC (25 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.5: +23 -3 lines
Diff to previous 1.5 (colored) to selected 1.81 (colored)

Instrument "idle pages" (i.e. pages which have no items allocated from
them, and could thus be freed back to the system).

Revision 1.5 / (download) - annotate - [select for diffs], Fri Jul 31 21:55:09 1998 UTC (25 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored) to selected 1.81 (colored)

Un-static pool_head; vmstat wants to find it.

Revision 1.4.2.1 / (download) - annotate - [select for diffs], Thu Jul 30 14:04:05 1998 UTC (25 years, 7 months ago) by eeh
Branch: eeh-paddr_t
Changes since 1.4: +3 -3 lines
Diff to previous 1.4 (colored) to selected 1.81 (colored)

Split vm_offset_t and vm_size_t into paddr_t, psize_t, vaddr_t, and vsize_t.

Revision 1.4 / (download) - annotate - [select for diffs], Fri Jul 24 20:19:23 1998 UTC (25 years, 8 months ago) by thorpej
Branch: MAIN
CVS Tags: eeh-paddr_t-base
Branch point for: eeh-paddr_t
Changes since 1.3: +14 -14 lines
Diff to previous 1.3 (colored) to selected 1.81 (colored)

A few small changes to how pool pages are allocated/freed:
- If either an alloc or release function is provided, make sure both are
  provided, otherwise panic, as this is a fatal error.
- If using the default allocator, default the pool pagesz to PAGE_SIZE,
  since that is the granularity of the default allocator's mechanism.
- In the default allocator, use new functions:
	uvm_km_alloc_poolpage()/uvm_km_free_poolpage(), or
	kmem_alloc_poolpage()/kmem_free_poolpage()
  rather than doing it here.  These functions may use pmap hooks to
  provide alternate methods of mapping pool pages.

Revision 1.3 / (download) - annotate - [select for diffs], Thu Jul 23 20:34:00 1998 UTC (25 years, 8 months ago) by pk
Branch: MAIN
Changes since 1.2: +825 -85 lines
Diff to previous 1.2 (colored) to selected 1.81 (colored)

Re-vamped pool manager.
	* support for customized memory supplier
	* automatic page reclaim by VM system
	* time-based hysteresis
	* cache coloring (after Bonwick's "slabs")

Revision 1.2 / (download) - annotate - [select for diffs], Thu Feb 19 23:52:14 1998 UTC (26 years, 1 month ago) by pk
Branch: MAIN
Changes since 1.1: +46 -10 lines
Diff to previous 1.1 (colored) to selected 1.81 (colored)

Add option to use "static" storage provided by the caller.
From Matthias Drochner.

Revision 1.1 / (download) - annotate - [select for diffs], Mon Dec 15 11:14:57 1997 UTC (26 years, 3 months ago) by pk
Branch: MAIN
Diff to selected 1.81 (colored)

Memory pool resource utility.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>