The NetBSD Project

CVS log for src/sys/sys/pool.h

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

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.96 / (download) - annotate - [select for diffs], Wed Dec 22 16:57:28 2021 UTC (2 years, 3 months ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, netbsd-10-base, netbsd-10-0-RELEASE, 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, HEAD
Changes since 1.95: +4 -4 lines
Diff to previous 1.95 (unified)

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.95 / (download) - annotate - [select for diffs], Tue Dec 21 18:59:22 2021 UTC (2 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.94: +4 -2 lines
Diff to previous 1.94 (unified)

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.94 / (download) - annotate - [select for diffs], Sun Jul 25 06:00:31 2021 UTC (2 years, 8 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.93: +7 -1 lines
Diff to previous 1.93 (unified)

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

Revision 1.93 / (download) - annotate - [select for diffs], Wed Feb 24 06:11:38 2021 UTC (3 years, 1 month ago) by simonb
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.92: +3 -4 lines
Diff to previous 1.92 (unified)

Add comments for the PR_WANTED and PR_PHINPAGE flags, remove unused
PR_LOGGING flag.

Revision 1.92 / (download) - annotate - [select for diffs], Thu Jun 18 16:56:31 2020 UTC (3 years, 10 months ago) by maxv
Branch: MAIN
Branch point for: thorpej-futex
Changes since 1.91: +14 -14 lines
Diff to previous 1.91 (unified)

style

Revision 1.91 / (download) - annotate - [select for diffs], Sun Jun 14 21:34:25 2020 UTC (3 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.90: +20 -23 lines
Diff to previous 1.90 (unified)

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.90 / (download) - annotate - [select for diffs], Mon Apr 13 00:27:17 2020 UTC (4 years ago) by chs
Branch: MAIN
CVS Tags: phil-wifi-20200421, bouyer-xenpvh-base2, bouyer-xenpvh-base1
Changes since 1.89: +7 -5 lines
Diff to previous 1.89 (unified)

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.89 / (download) - annotate - [select for diffs], Thu May 9 08:16:15 2019 UTC (4 years, 11 months ago) by skrll
Branch: MAIN
CVS Tags: phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, is-mlppp-base, is-mlppp, bouyer-xenpvh-base, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache
Branch point for: bouyer-xenpvh
Changes since 1.88: +2 -1 lines
Diff to previous 1.88 (unified)

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

	show uvmexp

Revision 1.88 / (download) - annotate - [select for diffs], Sat Apr 13 08:41:37 2019 UTC (5 years ago) by maxv
Branch: MAIN
CVS Tags: isaki-audio2-base, isaki-audio2
Changes since 1.87: +14 -1 lines
Diff to previous 1.87 (unified)

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.87 / (download) - annotate - [select for diffs], Wed Mar 27 18:27:47 2019 UTC (5 years ago) by maxv
Branch: MAIN
Changes since 1.86: +3 -3 lines
Diff to previous 1.86 (unified)

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.86 / (download) - annotate - [select for diffs], Tue Mar 26 18:31:30 2019 UTC (5 years ago) by maxv
Branch: MAIN
Changes since 1.85: +1 -6 lines
Diff to previous 1.85 (unified)

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

Revision 1.85 / (download) - annotate - [select for diffs], Sun Mar 17 19:57:54 2019 UTC (5 years, 1 month ago) by maxv
Branch: MAIN
Changes since 1.84: +3 -2 lines
Diff to previous 1.84 (unified)

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.84 / (download) - annotate - [select for diffs], Sun Feb 10 17:13:33 2019 UTC (5 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.83: +2 -1 lines
Diff to previous 1.83 (unified)

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

Revision 1.83 / (download) - annotate - [select for diffs], Sun Dec 16 21:03:35 2018 UTC (5 years, 4 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226
Changes since 1.82: +2 -1 lines
Diff to previous 1.82 (unified)

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.82 / (download) - annotate - [select for diffs], Sat Dec 16 03:13:29 2017 UTC (6 years, 4 months ago) by mrg
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-base, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, 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.81: +2 -1 lines
Diff to previous 1.81 (unified)

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.81 / (download) - annotate - [select for diffs], Sat Dec 2 08:15:43 2017 UTC (6 years, 4 months ago) by mrg
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202
Changes since 1.80: +2 -1 lines
Diff to previous 1.80 (unified)

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.80 / (download) - annotate - [select for diffs], Sat Oct 28 19:19:10 2017 UTC (6 years, 5 months ago) by riastradh
Branch: MAIN
Changes since 1.79: +2 -1 lines
Diff to previous 1.79 (unified)

Define the new flag too for previous commit.

XXX pullup-8
XXX pullup-7
XXX pullup-6
XXX pullup-5...

Revision 1.79 / (download) - annotate - [select for diffs], Wed Jul 29 00:10:25 2015 UTC (8 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, 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, nick-nhusb-base-20151226, nick-nhusb-base-20150921, netbsd-8-base, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: netbsd-8
Changes since 1.78: +3 -1 lines
Diff to previous 1.78 (unified)

move stdbool.h to sys, reuire pool.h to include <sys/stdbool.h> for bool,
centralize definitions of bool, true, false, to <sys/stdbool.h>

Revision 1.78 / (download) - annotate - [select for diffs], Tue Jul 28 12:32:44 2015 UTC (8 years, 8 months ago) by maxv
Branch: MAIN
Changes since 1.77: +7 -1 lines
Diff to previous 1.77 (unified)

Introduce POOL_REDZONE.

Revision 1.77 / (download) - annotate - [select for diffs], Fri Sep 5 05:42:50 2014 UTC (9 years, 7 months ago) by matt
Branch: MAIN
CVS Tags: nick-nhusb-base-20150606, nick-nhusb-base-20150406, nick-nhusb-base
Branch point for: nick-nhusb
Changes since 1.76: +3 -2 lines
Diff to previous 1.76 (unified)

Don't nest structure definitions.

Revision 1.76 / (download) - annotate - [select for diffs], Fri Jun 13 19:09:07 2014 UTC (9 years, 10 months ago) by joerg
Branch: MAIN
CVS Tags: tls-maxphys-base, tls-earlyentropy-base, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, 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, 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, netbsd-7
Changes since 1.75: +34 -1 lines
Diff to previous 1.75 (unified)

Add kern.pool for memory pool stats.

Revision 1.75 / (download) - annotate - [select for diffs], Tue Jun 5 22:51:47 2012 UTC (11 years, 10 months ago) by jym
Branch: MAIN
CVS Tags: yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, rmind-smpnet-nbase, rmind-smpnet-base, rmind-smpnet, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, khorben-n900, agc-symver-base, agc-symver
Branch point for: tls-maxphys, tls-earlyentropy
Changes since 1.74: +2 -3 lines
Diff to previous 1.74 (unified)

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.74 / (download) - annotate - [select for diffs], Sat May 5 19:15:10 2012 UTC (11 years, 11 months ago) by rmind
Branch: MAIN
CVS Tags: yamt-pagecache-base5, jmcneill-usbmp-base10
Changes since 1.73: +1 -28 lines
Diff to previous 1.73 (unified)

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

Revision 1.73 / (download) - annotate - [select for diffs], Fri Jan 27 19:48:41 2012 UTC (12 years, 2 months ago) by para
Branch: MAIN
CVS Tags: yamt-pagecache-base4, netbsd-6-base, 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, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2
Changes since 1.72: +2 -6 lines
Diff to previous 1.72 (unified)

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.72 / (download) - annotate - [select for diffs], Mon Nov 21 04:36:05 2011 UTC (12 years, 5 months ago) by christos
Branch: MAIN
CVS Tags: jmcneill-usbmp-pre-base2, jmcneill-usbmp-base
Branch point for: jmcneill-usbmp
Changes since 1.71: +4 -4 lines
Diff to previous 1.71 (unified)

change printf gcc attribute to __printflike(), requested by joerg.

Revision 1.71 / (download) - annotate - [select for diffs], Sun Nov 20 23:37:00 2011 UTC (12 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.70: +6 -4 lines
Diff to previous 1.70 (unified)

add more missing printf attributes.

Revision 1.70 / (download) - annotate - [select for diffs], Thu Jun 3 10:40:17 2010 UTC (13 years, 10 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base7, uebayasi-xip-base6, uebayasi-xip-base5, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, rmind-uvmplock-nbase, rmind-uvmplock-base, matt-mips64-premerge-20101231, jruoho-x86intr-base, jruoho-x86intr, jmcneill-audiomp3-base, jmcneill-audiomp3, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: yamt-pagecache
Changes since 1.69: +2 -2 lines
Diff to previous 1.69 (unified)

Report result of pool_reclaim() from pool_drain_end().

Revision 1.69 / (download) - annotate - [select for diffs], Sun May 30 02:28:13 2010 UTC (13 years, 10 months ago) by dholland
Branch: MAIN
Changes since 1.68: +2 -1 lines
Diff to previous 1.68 (unified)

Uses MAXCPUS from sys/param.h; include that explicitly instead of by
accident.

Revision 1.68 / (download) - annotate - [select for diffs], Wed Dec 30 18:57:16 2009 UTC (14 years, 3 months ago) by elad
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, uebayasi-xip-base1, uebayasi-xip-base
Branch point for: uebayasi-xip, rmind-uvmplock
Changes since 1.67: +2 -3 lines
Diff to previous 1.67 (unified)

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.67 / (download) - annotate - [select for diffs], Thu Oct 15 20:50:12 2009 UTC (14 years, 6 months ago) by thorpej
Branch: MAIN
CVS Tags: matt-premerge-20091211, jym-xensuspend-nbase
Changes since 1.66: +1 -2 lines
Diff to previous 1.66 (unified)

- 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.66 / (download) - annotate - [select for diffs], Thu Oct 8 21:54:45 2009 UTC (14 years, 6 months ago) by jym
Branch: MAIN
Changes since 1.65: +2 -1 lines
Diff to previous 1.65 (unified)

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.65 / (download) - annotate - [select for diffs], Sun Sep 13 18:45:12 2009 UTC (14 years, 7 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8
Changes since 1.64: +1 -18 lines
Diff to previous 1.64 (unified)

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.64 / (download) - annotate - [select for diffs], Fri Jul 4 16:38:59 2008 UTC (15 years, 9 months ago) by ad
Branch: MAIN
CVS Tags: yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, yamt-nfs-mp-base4, yamt-nfs-mp-base3, wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, simonb-wapbl-nbase, simonb-wapbl-base, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base2, nick-hppapmap-base, nick-hppapmap, netbsd-5-base, 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, netbsd-5, mjf-devfs2-base, 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, matt-mips64-base2, jymxensuspend-base, jym-xensuspend-base, jym-xensuspend, haad-nbase2, haad-dm-base2, haad-dm-base1, haad-dm-base, haad-dm, ad-audiomp2-base, ad-audiomp2
Changes since 1.63: +2 -1 lines
Diff to previous 1.63 (unified)

- 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.63 / (download) - annotate - [select for diffs], Mon Apr 28 20:24:11 2008 UTC (15 years, 11 months ago) by martin
Branch: MAIN
CVS Tags: yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-nfs-mp-base2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, hpcarm-cleanup-nbase
Branch point for: wrstuden-revivesa, simonb-wapbl
Changes since 1.62: +1 -8 lines
Diff to previous 1.62 (unified)

Remove clause 3 and 4 from TNF licenses

Revision 1.62 / (download) - annotate - [select for diffs], Wed Dec 26 16:01:38 2007 UTC (16 years, 3 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base, yamt-nfs-mp-base, yamt-lazymbuf-base15, yamt-lazymbuf-base14, vmlocking2-base3, nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, matt-armv6-nbase, matt-armv6-base, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-base, bouyer-xeni386-nbase, bouyer-xeni386-base, ad-socklock-base1
Branch point for: yamt-pf42, yamt-nfs-mp, mjf-devfs2
Changes since 1.61: +3 -3 lines
Diff to previous 1.61 (unified)

Merge more changes from vmlocking2, mainly:

- Locking improvements.
- Use pool_cache for more items.

Revision 1.61 / (download) - annotate - [select for diffs], Mon Dec 24 16:45:16 2007 UTC (16 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.60: +3 -3 lines
Diff to previous 1.60 (unified)

Make values of PR_WAITOK/PR_NOWAIT match KM_SLEEP/KM_NOSLEEP. This makes it
trivial to emulate most of Solaris' kmem_cache interface with a few macros.

Revision 1.60 / (download) - annotate - [select for diffs], Thu Dec 20 23:49:11 2007 UTC (16 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.59: +22 -13 lines
Diff to previous 1.59 (unified)

- 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.59 / (download) - annotate - [select for diffs], Thu Dec 13 02:45:10 2007 UTC (16 years, 4 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-kmem-base3
Changes since 1.58: +2 -1 lines
Diff to previous 1.58 (unified)

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

Revision 1.58 / (download) - annotate - [select for diffs], Sun Nov 18 16:27:42 2007 UTC (16 years, 5 months ago) by ad
Branch: MAIN
CVS Tags: yamt-kmem-base2, yamt-kmem-base, vmlocking2-base2, vmlocking2-base1, vmlocking-nbase, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, jmcneill-pm-base, cube-autoconf-base, cube-autoconf, bouyer-xenamd64-base2, bouyer-xenamd64-base
Branch point for: yamt-kmem, vmlocking2, bouyer-xeni386
Changes since 1.57: +4 -5 lines
Diff to previous 1.57 (unified)

Work around issues with pool_cache on sparc.

Revision 1.57 / (download) - annotate - [select for diffs], Wed Nov 7 00:23:42 2007 UTC (16 years, 5 months ago) by ad
Branch: MAIN
Changes since 1.56: +98 -62 lines
Diff to previous 1.56 (unified)

Merge from vmlocking:

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

Revision 1.56 / (download) - annotate - [select for diffs], Mon Mar 12 18:18:37 2007 UTC (17 years, 1 month ago) by ad
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-x86pmap-base2, yamt-x86pmap-base, yamt-x86pmap, yamt-idlelwp-base8, vmlocking-base, thorpej-atomic-base, thorpej-atomic, reinoud-bufcleanup, nick-csl-alignment-base5, nick-csl-alignment-base, nick-csl-alignment, mjf-ufs-trans-base, mjf-ufs-trans, matt-mips64-base, matt-mips64, jmcneill-base, hpcarm-cleanup
Branch point for: mjf-devfs, matt-armv6, jmcneill-pm, bouyer-xenamd64
Changes since 1.55: +5 -4 lines
Diff to previous 1.55 (unified)

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

Revision 1.55 / (download) - annotate - [select for diffs], Fri Feb 9 21:55:37 2007 UTC (17 years, 2 months ago) by ad
Branch: MAIN
CVS Tags: post-newlock2-merge, ad-audiomp-base, ad-audiomp
Branch point for: yamt-idlelwp, vmlocking
Changes since 1.54: +6 -1 lines
Diff to previous 1.54 (unified)

Merge newlock2 to head.

Revision 1.54 / (download) - annotate - [select for diffs], Sun Aug 20 09:35:25 2006 UTC (17 years, 8 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3, yamt-splraiseipl-base2, yamt-splraiseipl-base, yamt-splraiseipl, yamt-pdpolicy-base9, yamt-pdpolicy-base8, wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, rpaulo-netinet-merge-pcb-base, 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
Branch point for: newlock2
Changes since 1.53: +2 -1 lines
Diff to previous 1.53 (unified)

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

Revision 1.53 / (download) - annotate - [select for diffs], Wed Jul 5 15:19:38 2006 UTC (17 years, 9 months ago) by itohy
Branch: MAIN
CVS Tags: yamt-pdpolicy-base7, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.52: +2 -2 lines
Diff to previous 1.52 (unified)

Back out previous change.  The problem was not here.  Oops.

Revision 1.52 / (download) - annotate - [select for diffs], Tue Jul 4 14:09:37 2006 UTC (17 years, 9 months ago) by itohy
Branch: MAIN
Changes since 1.51: +2 -2 lines
Diff to previous 1.51 (unified)

Do not define the link_set symbol as static, or a.out linker won't find it.

Revision 1.51 / (download) - annotate - [select for diffs], Sat May 27 08:41:13 2006 UTC (17 years, 10 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-pdpolicy-base6, simonb-timecounters-base, gdamore-uart-base, chap-midi-nbase, chap-midi-base
Branch point for: gdamore-uart
Changes since 1.50: +3 -7 lines
Diff to previous 1.50 (unified)

remove a nested function so that its initializers can be compiled by gcc2.
pointed by Havard Eidnes.

Revision 1.50 / (download) - annotate - [select for diffs], Fri May 26 00:26:12 2006 UTC (17 years, 10 months ago) by uebayasi
Branch: MAIN
Changes since 1.49: +3 -1 lines
Diff to previous 1.49 (unified)

Expose struct pool::struct callback_entry pr_reclaimerentry only when _KERNEL
is defined.  Fix build of src/sbin/mount/mount_tmpfs/mount_tmpfs.c.

Revision 1.49 / (download) - annotate - [select for diffs], Thu May 25 14:27:28 2006 UTC (17 years, 10 months ago) by yamt
Branch: MAIN
Changes since 1.48: +16 -3 lines
Diff to previous 1.48 (unified)

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.48 / (download) - annotate - [select for diffs], Fri Feb 24 11:46:20 2006 UTC (18 years, 1 month ago) by bjh21
Branch: MAIN
CVS Tags: yamt-uio_vmspace-base5, yamt-pdpolicy-base5, yamt-pdpolicy-base4, yamt-pdpolicy-base3, yamt-pdpolicy-base2, yamt-pdpolicy-base, peter-altq-base, peter-altq, elad-kernelauth-base, elad-kernelauth
Branch point for: yamt-pdpolicy, chap-midi
Changes since 1.47: +6 -1 lines
Diff to previous 1.47 (unified)

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.47 / (download) - annotate - [select for diffs], Thu Dec 1 13:21:05 2005 UTC (18 years, 4 months ago) by yamt
Branch: MAIN
CVS Tags: ktrace-lwp-base
Branch point for: yamt-uio_vmspace, simonb-timecounters, rpaulo-netinet-merge-pcb
Changes since 1.46: +2 -1 lines
Diff to previous 1.46 (unified)

add "show all pools" command for ddb.

Revision 1.46 / (download) - annotate - [select for diffs], Sun Oct 2 17:29:31 2005 UTC (18 years, 6 months ago) by chs
Branch: MAIN
CVS Tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base3, yamt-readahead-base2, yamt-readahead-base, yamt-readahead, thorpej-vnode-attr-base, thorpej-vnode-attr
Changes since 1.45: +12 -11 lines
Diff to previous 1.45 (unified)

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.45 / (download) - annotate - [select for diffs], Sat Jan 1 21:04:39 2005 UTC (19 years, 3 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-km-base4, yamt-km-base3, yamt-km-base2, yamt-km-base, yamt-km, netbsd-3-base, 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, kent-audio2-base, kent-audio2, kent-audio1-beforemerge
Branch point for: yamt-lazymbuf, netbsd-3-0, netbsd-3
Changes since 1.44: +3 -1 lines
Diff to previous 1.44 (unified)

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.44 / (download) - annotate - [select for diffs], Sun Jun 20 18:19:27 2004 UTC (19 years, 10 months ago) by thorpej
Branch: MAIN
CVS Tags: kent-audio1-base, kent-audio1
Changes since 1.43: +1 -2 lines
Diff to previous 1.43 (unified)

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

Pointed out back in January by YAMAMOTO Takashi.

Revision 1.43 / (download) - annotate - [select for diffs], Sun Apr 25 16:42:43 2004 UTC (19 years, 11 months ago) by simonb
Branch: MAIN
Changes since 1.42: +19 -1 lines
Diff to previous 1.42 (unified)

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.42 / (download) - annotate - [select for diffs], Fri Jan 9 19:00:16 2004 UTC (20 years, 3 months ago) by thorpej
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.41: +2 -1 lines
Diff to previous 1.41 (unified)

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.41 / (download) - annotate - [select for diffs], Thu Nov 13 02:44:01 2003 UTC (20 years, 5 months ago) by chs
Branch: MAIN
Changes since 1.40: +11 -6 lines
Diff to previous 1.40 (unified)

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.40 / (download) - annotate - [select for diffs], Sun Sep 7 11:37:13 2003 UTC (20 years, 7 months ago) by yamt
Branch: MAIN
Changes since 1.39: +3 -3 lines
Diff to previous 1.39 (unified)

remove variable names from prototype for consistency.

Revision 1.39 / (download) - annotate - [select for diffs], Wed Apr 9 18:22:13 2003 UTC (21 years ago) by thorpej
Branch: MAIN
Branch point for: ktrace-lwp
Changes since 1.38: +12 -4 lines
Diff to previous 1.38 (unified)

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.38 / (download) - annotate - [select for diffs], Sun Aug 25 23:03:39 2002 UTC (21 years, 7 months ago) by thorpej
Branch: MAIN
CVS Tags: nathanw_sa_before_merge, nathanw_sa_base, kqueue-beforemerge, kqueue-base, kqueue-aftermerge, gmcgarry_ucred_base, gmcgarry_ucred, gmcgarry_ctxsw_base, gmcgarry_ctxsw, gehenna-devsw-base, fvdl_fs64_base
Changes since 1.37: +2 -2 lines
Diff to previous 1.37 (unified)

Fix signed/unsigned comparison warnings from GCC 3.3.

Revision 1.37 / (download) - annotate - [select for diffs], Wed Mar 13 10:57:19 2002 UTC (22 years, 1 month 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, 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, netbsd-1-6, eeh-devprop-base, eeh-devprop
Branch point for: gehenna-devsw
Changes since 1.36: +11 -1 lines
Diff to previous 1.36 (unified)

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

Revision 1.36 / (download) - annotate - [select for diffs], Mon Mar 11 01:19:17 2002 UTC (22 years, 1 month ago) by enami
Branch: MAIN
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (unified)

Fix indentation.

Revision 1.35 / (download) - annotate - [select for diffs], Mon Mar 11 01:16:43 2002 UTC (22 years, 1 month ago) by enami
Branch: MAIN
Changes since 1.34: +2 -2 lines
Diff to previous 1.34 (unified)

Fix function decl. of _pool_reclaim() so that subr_pool.c compiles again
even if POOL_DIAGNOSTIC is defined.

Revision 1.34 / (download) - annotate - [select for diffs], Sat Mar 9 18:06:54 2002 UTC (22 years, 1 month ago) by thorpej
Branch: MAIN
CVS Tags: newlock-base, newlock
Changes since 1.33: +1 -0 lines
Diff to previous 1.33 (unified)

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

Revision 1.33 / (download) - annotate - [select for diffs], Sat Mar 9 01:56:27 2002 UTC (22 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.32: +1 -2 lines
Diff to previous 1.32 (unified)

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.32 / (download) - annotate - [select for diffs], Sat Mar 9 01:33:33 2002 UTC (22 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.31: +1 -3 lines
Diff to previous 1.31 (unified)

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.31 / (download) - annotate - [select for diffs], Fri Mar 8 21:41:59 2002 UTC (22 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.30: +9 -1 lines
Diff to previous 1.30 (unified)

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.30 / (download) - annotate - [select for diffs], Fri Mar 8 20:51:25 2002 UTC (22 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.29: +1 -2 lines
Diff to previous 1.29 (unified)

Remove PR_FREEHEADER; nothing uses it anymore.

From art@openbsd.org.

Revision 1.29 / (download) - annotate - [select for diffs], Fri Mar 8 20:48:45 2002 UTC (22 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.28: +39 -30 lines
Diff to previous 1.28 (unified)

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.28 / (download) - annotate - [select for diffs], Sun Oct 7 12:44:06 2001 UTC (22 years, 6 months ago) by bjh21
Branch: MAIN
CVS Tags: thorpej-mips-cache-base, thorpej-mips-cache, thorpej-devvp-base3, ifpoll-base
Changes since 1.27: +2 -1 lines
Diff to previous 1.27 (unified)

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.27 / (download) - annotate - [select for diffs], Wed Jun 6 22:00:17 2001 UTC (22 years, 10 months ago) by rafal
Branch: MAIN
CVS Tags: thorpej-devvp-base2, thorpej-devvp-base, pre-chs-ubcperf, post-chs-ubcperf
Branch point for: thorpej-devvp, kqueue
Changes since 1.26: +5 -1 lines
Diff to previous 1.26 (unified)

Jason's last fix broke builds with POOL_DIAGNOSTIC (the kernel didn't link
as pool_get was never defined).  Fix that.

Revision 1.26 / (download) - annotate - [select for diffs], Tue Jun 5 18:51:03 2001 UTC (22 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.25: +3 -3 lines
Diff to previous 1.25 (unified)

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

Revision 1.25 / (download) - annotate - [select for diffs], Sun May 13 17:17:34 2001 UTC (22 years, 11 months ago) by sommerfeld
Branch: MAIN
Changes since 1.24: +5 -5 lines
Diff to previous 1.24 (unified)

Make this build again ifdef DIAGNOSTIC (oops)

Revision 1.24 / (download) - annotate - [select for diffs], Sun May 13 17:06:58 2001 UTC (22 years, 11 months ago) by sommerfeld
Branch: MAIN
Changes since 1.23: +8 -2 lines
Diff to previous 1.23 (unified)

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.23 / (download) - annotate - [select for diffs], Thu May 10 04:51:41 2001 UTC (22 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.22: +2 -1 lines
Diff to previous 1.22 (unified)

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.22 / (download) - annotate - [select for diffs], Wed May 9 23:46:02 2001 UTC (22 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.21: +1 -7 lines
Diff to previous 1.21 (unified)

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.21 / (download) - annotate - [select for diffs], Fri May 4 19:41:25 2001 UTC (22 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.20: +2 -1 lines
Diff to previous 1.20 (unified)

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

Revision 1.20 / (download) - annotate - [select for diffs], Mon Dec 11 05:22:55 2000 UTC (23 years, 4 months ago) by thorpej
Branch: MAIN
CVS Tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base
Branch point for: nathanw_sa
Changes since 1.19: +9 -1 lines
Diff to previous 1.19 (unified)

Add some basic statistics to pool_cache.

Revision 1.19 / (download) - annotate - [select for diffs], Thu Dec 7 05:45:57 2000 UTC (23 years, 4 months ago) by thorpej
Branch: MAIN
Changes since 1.18: +33 -2 lines
Diff to previous 1.18 (unified)

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.18 / (download) - annotate - [select for diffs], Wed Dec 6 18:20:52 2000 UTC (23 years, 4 months ago) by thorpej
Branch: MAIN
Changes since 1.17: +22 -26 lines
Diff to previous 1.17 (unified)

ANSI'ify.

Revision 1.17 / (download) - annotate - [select for diffs], Mon Feb 14 21:17:04 2000 UTC (24 years, 2 months ago) by fvdl
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, minoura-xpg4dl-base, minoura-xpg4dl
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (unified)

Change ratecap to its presumably intended type of struct timeval.

Revision 1.16 / (download) - annotate - [select for diffs], Thu Aug 5 04:00:03 1999 UTC (24 years, 8 months ago) by sommerfeld
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.15: +2 -1 lines
Diff to previous 1.15 (unified)

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.15 / (download) - annotate - [select for diffs], Mon May 10 21:13:05 1999 UTC (24 years, 11 months ago) by thorpej
Branch: MAIN
CVS Tags: chs-ubc2-base
Changes since 1.14: +20 -14 lines
Diff to previous 1.14 (unified)

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.14 / (download) - annotate - [select for diffs], Wed Mar 31 23:23:47 1999 UTC (25 years ago) by thorpej
Branch: MAIN
CVS Tags: netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH003, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001, netbsd-1-4, kame_14_19990705, kame_14_19990628, kame_141_19991130, kame
Branch point for: chs-ubc2
Changes since 1.13: +32 -17 lines
Diff to previous 1.13 (unified)

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.13 / (download) - annotate - [select for diffs], Wed Mar 31 01:14:06 1999 UTC (25 years ago) by thorpej
Branch: MAIN
Changes since 1.12: +16 -2 lines
Diff to previous 1.12 (unified)

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.12 / (download) - annotate - [select for diffs], Sun Dec 27 21:13:43 1998 UTC (25 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.11: +6 -2 lines
Diff to previous 1.11 (unified)

Make this compile with POOL_DIAGNOSTIC, and add a POOL_LOGSIZE option.
Defopt these.

Revision 1.11 / (download) - annotate - [select for diffs], Wed Dec 16 04:28:23 1998 UTC (25 years, 4 months ago) by briggs
Branch: MAIN
Changes since 1.10: +5 -1 lines
Diff to previous 1.10 (unified)

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.10 / (download) - annotate - [select for diffs], Tue Sep 29 18:09:29 1998 UTC (25 years, 6 months ago) by pk
Branch: MAIN
CVS Tags: kenh-if-detach-base, kenh-if-detach, chs-ubc-base, chs-ubc
Changes since 1.9: +10 -1 lines
Diff to previous 1.9 (unified)

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.9 / (download) - annotate - [select for diffs], Sun Sep 13 14:46:24 1998 UTC (25 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 (unified)

Fix copyright typos...

Revision 1.8 / (download) - annotate - [select for diffs], Sat Sep 5 17:30:40 1998 UTC (25 years, 7 months ago) by pk
Branch: MAIN
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (unified)

Update copyright.

Revision 1.7 / (download) - annotate - [select for diffs], Fri Aug 28 21:18:38 1998 UTC (25 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.6: +8 -1 lines
Diff to previous 1.6 (unified)

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.6 / (download) - annotate - [select for diffs], Sat Aug 1 23:44:20 1998 UTC (25 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.5: +2 -1 lines
Diff to previous 1.5 (unified)

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 02:53:34 1998 UTC (25 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.4: +2 -1 lines
Diff to previous 1.4 (unified)

Add PR_NOWAIT (0) for symmetry.

Revision 1.4 / (download) - annotate - [select for diffs], Thu Jul 23 20:34:02 1998 UTC (25 years, 9 months ago) by pk
Branch: MAIN
CVS Tags: eeh-paddr_t-base
Branch point for: eeh-paddr_t
Changes since 1.3: +80 -16 lines
Diff to previous 1.3 (unified)

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.3 / (download) - annotate - [select for diffs], Thu Feb 19 23:51:48 1998 UTC (26 years, 2 months ago) by pk
Branch: MAIN
Changes since 1.2: +8 -3 lines
Diff to previous 1.2 (unified)

Add option to use "static" storage provided by the caller.
From Matthias Drochner.

Revision 1.2 / (download) - annotate - [select for diffs], Tue Feb 10 00:25:41 1998 UTC (26 years, 2 months ago) by perry
Branch: MAIN
Changes since 1.1: +6 -1 lines
Diff to previous 1.1 (unified)

add/cleanup multiple inclusion protection.

Revision 1.1 / (download) - annotate - [select for diffs], Mon Dec 15 11:14:57 1997 UTC (26 years, 4 months ago) by pk
Branch: MAIN

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>