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.201 / (download) - annotate - [select for diffs], Mon Feb 17 20:40:06 2014 UTC (2 months ago) by para
Branch: MAIN
CVS Tags: tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, HEAD
Changes since 1.200: +5 -4 lines
Diff to previous 1.200 (colored) to selected 1.165.2.2 (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 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) next main 1.199 (colored) to selected 1.165.2.2 (colored)

resync from head

Revision 1.200 / (download) - annotate - [select for diffs], Mon Mar 11 21:37:54 2013 UTC (13 months, 1 week ago) by pooka
Branch: MAIN
CVS Tags: tls-maxphys-base, rmind-smpnet-nbase, rmind-smpnet-base, rmind-smpnet, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, khorben-n900, agc-symver-base, agc-symver
Changes since 1.199: +15 -4 lines
Diff to previous 1.199 (colored) to selected 1.165.2.2 (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 (13 months, 4 weeks ago) by tls
Branch: tls-maxphys
Changes since 1.198: +4 -4 lines
Diff to previous 1.198 (colored) to selected 1.165.2.2 (colored)

resync with head

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

printflike maintenance.

Revision 1.190.2.3 / (download) - annotate - [select for diffs], Tue Oct 30 17:22:34 2012 UTC (17 months, 3 weeks ago) by yamt
Branch: yamt-pagecache
Changes since 1.190.2.2: +35 -47 lines
Diff to previous 1.190.2.2 (colored) to branchpoint 1.190 (colored) next main 1.191 (colored) to selected 1.165.2.2 (colored)

sync with head

Revision 1.198 / (download) - annotate - [select for diffs], Tue Aug 28 15:52:19 2012 UTC (19 months, 3 weeks 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.165.2.2 (colored)

proper locking for DEBUG

Revision 1.194.2.1 / (download) - annotate - [select for diffs], Mon Jul 2 19:04:42 2012 UTC (21 months, 3 weeks 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-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-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) next main 1.195 (colored) to selected 1.165.2.2 (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 (22 months, 2 weeks ago) by jym
Branch: MAIN
Changes since 1.196: +11 -35 lines
Diff to previous 1.196 (colored) to selected 1.165.2.2 (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 (22 months, 2 weeks ago) by jym
Branch: MAIN
Changes since 1.195: +23 -15 lines
Diff to previous 1.195 (colored) to selected 1.165.2.2 (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 (22 months, 3 weeks 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.165.2.2 (colored)

sync to latest -current.

Revision 1.190.2.2 / (download) - annotate - [select for diffs], Wed May 23 10:08:11 2012 UTC (23 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.165.2.2 (colored)

sync with head.

Revision 1.195 / (download) - annotate - [select for diffs], Sat May 5 19:15:10 2012 UTC (23 months, 2 weeks 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.165.2.2 (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 (2 years ago) by yamt
Branch: yamt-pagecache
Changes since 1.190: +91 -197 lines
Diff to previous 1.190 (