OpenBSD CVS

CVS log for src/sys/uvm/uvm_pdaemon.c


[BACK] Up to [local] / src / sys / uvm

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.114 / (download) - annotate - [select for diffs], Wed May 1 12:54:27 2024 UTC (4 weeks, 4 days ago) by mpi
Branch: MAIN
CVS Tags: HEAD
Changes since 1.113: +3 -1 lines
Diff to previous 1.113 (colored)

Add per-CPU caches to the pmemrange allocator.

The caches are used primarily to reduce contention on uvm_lock_fpageq() during
concurrent page faults.  For the moment only uvm_pagealloc() tries to get a
page from the current CPU's cache.  So on some architectures the caches are
also used by the pmap layer.

Each cache is composed of two magazines, design is borrowed from jeff bonwick
vmem's paper and the implementation is similar to the one of pool_cache from
dlg@.  However there is no depot layer and magazines are refilled directly by
the pmemrange allocator.

This version includes splvm()/splx() dances because the buffer cache flips
buffers in interrupt context.  So we have to prevent recursive accesses to
per-CPU magazines.

Tested by naddy@, solene@, krw@, robert@, claudio@ and Laurence Tratt.

ok claudio@, kettenis@

Revision 1.113 / (download) - annotate - [select for diffs], Fri Apr 19 10:22:51 2024 UTC (6 weeks, 2 days ago) by mpi
Branch: MAIN
Changes since 1.112: +0 -2 lines
Diff to previous 1.112 (colored)

Revert per-CPU caches a double-free has been found by naddy@.

Revision 1.112 / (download) - annotate - [select for diffs], Wed Apr 17 13:12:58 2024 UTC (6 weeks, 4 days ago) by mpi
Branch: MAIN
Changes since 1.111: +3 -1 lines
Diff to previous 1.111 (colored)

Add per-CPU caches to the pmemrange allocator.

The caches are used primarily to reduce contention on uvm_lock_fpageq() during
concurrent page faults.  For the moment only uvm_pagealloc() tries to get a
page from the current CPU's cache.  So on some architectures the caches are
also used by the pmap layer.

Each cache is composed of two magazines, design is borrowed from jeff bonwick
vmem's paper and the implementation is similar to the one of pool_cache from
dlg@.  However there is no depot layer and magazines are refilled directly by
the pmemrange allocator.

Tested by robert@, claudio@ and Laurence Tratt.

ok kettenis@

Revision 1.111 / (download) - annotate - [select for diffs], Wed Apr 10 15:26:18 2024 UTC (7 weeks, 4 days ago) by mpi
Branch: MAIN
Changes since 1.110: +12 -18 lines
Diff to previous 1.110 (colored)

Use uvmpd_dropswap() in the case of swap shortage.

ok kn@, kettenis@, miod@

Revision 1.110 / (download) - annotate - [select for diffs], Sun Mar 24 10:29:35 2024 UTC (2 months, 1 week ago) by mpi
Branch: MAIN
Changes since 1.109: +22 -37 lines
Diff to previous 1.109 (colored)

Cleanup uvmpd_tune() & document global variable ownership.

- Stop calling uvmpd_tune() inside uvm_pageout().  OpenBSD currently doesn't
support adding RAM. `uvmexp.npages' is immutable after boot.

- Document that `uvmexp.freemin' and `uvmexp.freetarg' are immutable.

- Reduce the scope of the `uvm_pageq_lock' lock.  It serializes accesses
to `uvmexp.active' and `uvmexp.inactive'.

ok kettenis@

Revision 1.109 / (download) - annotate - [select for diffs], Fri Oct 27 19:18:53 2023 UTC (7 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5
Changes since 1.108: +3 -8 lines
Diff to previous 1.108 (colored)

Make out-of-swap checks more robust.

Consider that the swap space is full when 99% of it is filled with pages that
are no longer present in memory.  This prevents deadlocks when out-of-swap if
some swap ranges had I/O errors and have been marked as 'bad', or if some
pages are unreachable by the pagedaemon and still holding some slots.

Also introduce uvm_swapisfilled() to check if there are some free slots in
the swap.  Note that we consider the swap space completly filled if it is not
possible to write a full cluster.  This prevents deadlocks if a few slots are
never allocated.

ok miod@

Revision 1.108 / (download) - annotate - [select for diffs], Tue Oct 24 10:00:22 2023 UTC (7 months, 1 week ago) by mpi
Branch: MAIN
Changes since 1.107: +6 -9 lines
Diff to previous 1.107 (colored)

Merge two equivalent if blocks.

No functional change, ok tb@

Revision 1.107 / (download) - annotate - [select for diffs], Mon Oct 16 11:32:54 2023 UTC (7 months, 2 weeks ago) by mpi
Branch: MAIN
Changes since 1.106: +25 -23 lines
Diff to previous 1.106 (colored)

Consider required constraint when moving pages from active to inactive lists.

Make sure low pages are deactivated first when there is a shortage of inactive
pages.  Without this the system can have a ton of high pages on the active list
and never swapout anything if there's a shortage of low pages.

This prevents a deadlock on amd64 reported and tested by bluhm@.

ok kettenis@

Revision 1.106 / (download) - annotate - [select for diffs], Tue May 30 08:30:01 2023 UTC (12 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4
Changes since 1.105: +2 -2 lines
Diff to previous 1.105 (colored)

spelling
ok jmc@ guenther@ tb@

Revision 1.105 / (download) - annotate - [select for diffs], Sat Sep 10 20:35:29 2022 UTC (20 months, 3 weeks ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.104: +2 -2 lines
Diff to previous 1.104 (colored)

Remove pmap_collect() when a no-op, define __HAVE_PMAP_COLLECT otherwise.
Use that define to shunt uvm_swapout_threads(), which is a noop when
pmap_collect() does nothing.

ok mpi@

Revision 1.104 / (download) - annotate - [select for diffs], Wed Aug 31 09:26:04 2022 UTC (21 months ago) by mpi
Branch: MAIN
Changes since 1.103: +68 -60 lines
Diff to previous 1.103 (colored)

Introduce a function to trylock a page instead of duplicating the logic.

Stolen from NetBSD.

ok jsg@

Revision 1.103 / (download) - annotate - [select for diffs], Tue Aug 30 08:30:58 2022 UTC (21 months ago) by mpi
Branch: MAIN
Changes since 1.102: +21 -21 lines
Diff to previous 1.102 (colored)

Move duplicated code to free swap resources into its own function.

ok mlarkin@

Revision 1.102 / (download) - annotate - [select for diffs], Mon Aug 22 12:03:32 2022 UTC (21 months, 1 week ago) by mpi
Branch: MAIN
Changes since 1.101: +23 -60 lines
Diff to previous 1.101 (colored)

Simplify locking by using an intermediate lock variable.

While here get rid of the unused returned value of uvmpd_scan_inactive().

ok jsg@, kn@

Revision 1.101 / (download) - annotate - [select for diffs], Tue Jun 28 19:31:30 2022 UTC (23 months ago) by mpi
Branch: MAIN
Changes since 1.100: +31 -11 lines
Diff to previous 1.100 (colored)

Consider pmemrange regions when trying to free pages from the inactive list.

Instead of starting with the first page on the inactive list pick the first
one that fits in the range of a given pmemrange region.

Fix an issue where the page daemon would be hogging a CPU without freeing any
page because the global limits are satisfied.

The algorithm could certainly be revisited, the LRU is not really working and
there is a huge delay before recovering when the first pages need to be swapped and the system is in OOM situation but at least there is no starvation and the
system now recovers.

ok beck@, kettenis@

Revision 1.100 / (download) - annotate - [select for diffs], Tue Jun 28 19:23:08 2022 UTC (23 months ago) by mpi
Branch: MAIN
Changes since 1.99: +4 -4 lines
Diff to previous 1.99 (colored)

Use new & shiny define for the maximum number of pages of a swap cluster.

ok beck@, kettenis@

Revision 1.99 / (download) - annotate - [select for diffs], Thu May 12 12:49:31 2022 UTC (2 years ago) by mpi
Branch: MAIN
Changes since 1.98: +4 -3 lines
Diff to previous 1.98 (colored)

Consider BUFPAGES_DEFICIT in swap_shortage.

ok beck@

Revision 1.98 / (download) - annotate - [select for diffs], Wed May 4 14:58:26 2022 UTC (2 years ago) by mpi
Branch: MAIN
Changes since 1.97: +4 -19 lines
Diff to previous 1.97 (colored)

Merge swap-backed and object-backed inactive page lists.

ok millert@, kettenis@

Revision 1.97 / (download) - annotate - [select for diffs], Sat Apr 30 17:58:43 2022 UTC (2 years, 1 month ago) by mpi
Branch: MAIN
Changes since 1.96: +31 -14 lines
Diff to previous 1.96 (colored)

Recheck PG_BUSY after locking the page.

Another thread can set the bit if we sleep during rw_enter(9) in which case
the page shouldn't be touched.

ok semarie@

Revision 1.96 / (download) - annotate - [select for diffs], Mon Apr 11 16:43:49 2022 UTC (2 years, 1 month ago) by mpi
Branch: MAIN
Changes since 1.95: +11 -9 lines
Diff to previous 1.95 (colored)

Remove trailing spaces.

Revision 1.95 / (download) - annotate - [select for diffs], Sat Mar 12 12:34:22 2022 UTC (2 years, 2 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.94: +10 -4 lines
Diff to previous 1.94 (colored)

Uncompress some one line comments to reduce the difference with NetBSD.

No functionnal change.

Revision 1.94 / (download) - annotate - [select for diffs], Wed Dec 15 12:53:53 2021 UTC (2 years, 5 months ago) by mpi
Branch: MAIN
Changes since 1.93: +55 -19 lines
Diff to previous 1.93 (colored)

Use a per-UVM object lock to serialize the lower part of the fault handler.

Like the per-amap lock the `vmobjlock' is principally used to serialized
access to objects in the fault handler to allow faults occurring on
different CPUs and different objects to be processed in parallel.

The fault handler now acquires the `vmobjlock' of a given UVM object as
soon as it finds one.  For now a write-lock is always acquired even if
some operations could use a read-lock.

Every pager, corresponding to a different kind of UVM object, now expect
the UVM object to be locked and some operations, like *_get() return it
unlocked.  This is enforced by assertions checking for rw_write_held().

The KERNEL_LOCK() is now pushed to the VFS boundary in the vnode pager.

To ensure the correct amap or object lock is held when modifying a page
many uvm_page* operations are now asserting for the "owner" lock.
However, fields of the "struct vm_page" are still being protected by the
global `pageqlock'.  To prevent lock ordering issues with the new
`vmobjlock' and to reduce differences with NetBSD this lock is now taken
and released for each page instead of around the whole loop.

This commit does not remove the KERNEL_LOCK/UNLOCK() dance.  Unlocking
will follow if there is no fallout.

Ported from NetBSD, tested by many, thanks!

ok kettenis@, kn@

Revision 1.93 / (download) - annotate - [select for diffs], Tue Jun 29 01:46:35 2021 UTC (2 years, 11 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.92: +1 -6 lines
Diff to previous 1.92 (colored)

remove arch ifdefs around drm.h include

ok deraadt@ kettenis@

Revision 1.92 / (download) - annotate - [select for diffs], Fri Jun 25 19:27:40 2021 UTC (2 years, 11 months ago) by matthieu
Branch: MAIN
Changes since 1.91: +2 -2 lines
Diff to previous 1.91 (colored)

basic radeondrm / X support for riscv64. Ok kettenis@

- add wscons devices
- build radeondrm and add MD uvm bits to support it.

Revision 1.91 / (download) - annotate - [select for diffs], Mon May 31 13:44:04 2021 UTC (3 years ago) by jsg
Branch: MAIN
Changes since 1.90: +3 -2 lines
Diff to previous 1.90 (colored)

call drmbackoff() on powerpc64 as well

ok kettenis@

Revision 1.90 / (download) - annotate - [select for diffs], Thu Mar 4 09:00:03 2021 UTC (3 years, 3 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.89: +3 -3 lines
Diff to previous 1.89 (colored)

Modify `uvmexp.swpgonly' atomically, required for uvm_fault() w/o KERNEL_LOCK()

ok kettenis@

Revision 1.89 / (download) - annotate - [select for diffs], Mon Mar 1 09:13:33 2021 UTC (3 years, 3 months ago) by mpi
Branch: MAIN
Changes since 1.88: +34 -3 lines
Diff to previous 1.88 (colored)

If an anon is associated with a page, acquire its lock before any modification.

This change should have been part of the previous anon-locking diff and is
necessary to run the top part of uvm_fault() unlocked.

ok jmatthew@

Revision 1.88 / (download) - annotate - [select for diffs], Tue Nov 24 13:49:09 2020 UTC (3 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.87: +3 -1 lines
Diff to previous 1.87 (colored)

Grab the `pageqlock' before calling uvm_pageclean() as intended.

Document which global data structures require this lock and add some
asserts where the lock should be held.

Some code paths are still incorrect and should be revisited.

ok jmatthew@

Revision 1.87 / (download) - annotate - [select for diffs], Tue Sep 29 11:47:41 2020 UTC (3 years, 8 months ago) by mpi
Branch: MAIN
Changes since 1.86: +3 -5 lines
Diff to previous 1.86 (colored)

Introduce a helper to check if all available swap is in use.

This reduces code duplication, reduces the diff with NetBSD and will help
to introduce locks around global variables.

ok cheloha@

Revision 1.86 / (download) - annotate - [select for diffs], Sat Apr 4 22:08:02 2020 UTC (4 years, 1 month ago) by kettenis
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.85: +8 -8 lines
Diff to previous 1.85 (colored)

Tweak the code that wakes up uvm_pmalloc sleepers in the page daemin.
Although there are open questions about whether we should flag failures with
UVM_PMA_FAIL or not, we really should only wake up a sleeper if we unlink
the pma.  For now only do that if pages were actually freed in the requested
region.

Prompted by:

CID 1453061 Logically dead code

which should be fixed by this commit.

ok (and together with) beck@

Revision 1.85 / (download) - annotate - [select for diffs], Mon Dec 30 23:58:38 2019 UTC (4 years, 5 months ago) by jsg
Branch: MAIN
Changes since 1.84: +5 -5 lines
Diff to previous 1.84 (colored)

convert infinite msleep(9) to msleep_nsec(9)

ok mpi@

Revision 1.84 / (download) - annotate - [select for diffs], Wed Dec 25 11:31:41 2019 UTC (4 years, 5 months ago) by kettenis
Branch: MAIN
Changes since 1.83: +14 -1 lines
Diff to previous 1.83 (colored)

Hook up the shrinker for inteldrm(4).  This is a "light" version that only
drops graphics buffers that are cached and not in active use.
Help from beck@ for pointing out how to hook this up to our pagedaemon.

ok jsg@

Revision 1.83 / (download) - annotate - [select for diffs], Wed Jul 3 22:39:33 2019 UTC (4 years, 11 months ago) by cheloha
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.82: +4 -4 lines
Diff to previous 1.82 (colored)

Add tsleep_nsec(9), msleep_nsec(9), and rwsleep_nsec(9).

Equivalent to their unsuffixed counterparts except that (a) they take
a timeout in terms of nanoseconds, and (b) INFSLP, aka UINT64_MAX (not
zero) indicates that a timeout should not be set.

For now, zero nanoseconds is not a strictly valid invocation: we log a
warning on DIAGNOSTIC kernels if we see such a call.  We still sleep
until the next tick in such a case, however.  In the future this could
become some sort of poll... TBD.

To facilitate conversions to these interfaces: add inline conversion
functions to sys/time.h for turning your timeout into nanoseconds.

Also do a few easy conversions for warmup and to demonstrate how
further conversions should be done.

Lots of input from mpi@ and ratchov@.  Additional input from tedu@,
deraadt@, mortimer@, millert@, and claudio@.

Partly inspired by FreeBSD r247787.

positive feedback from deraadt@, ok mpi@

Revision 1.82 / (download) - annotate - [select for diffs], Fri May 10 02:33:57 2019 UTC (5 years ago) by beck
Branch: MAIN
Changes since 1.81: +4 -9 lines
Diff to previous 1.81 (colored)

simplify logic after wakeup since this variable is only manipulated
under lock
ok guenther@

Revision 1.81 / (download) - annotate - [select for diffs], Fri May 10 02:16:50 2019 UTC (5 years ago) by beck
Branch: MAIN
Changes since 1.80: +6 -6 lines
Diff to previous 1.80 (colored)

Check for nowait failed *after* the wakeup point, not before.
ok guenther@

Revision 1.80 / (download) - annotate - [select for diffs], Thu May 9 20:36:44 2019 UTC (5 years ago) by beck
Branch: MAIN
Changes since 1.79: +26 -4 lines
Diff to previous 1.79 (colored)

Ensure that pagedaemon wakeups as a result of failed UVM_PLA_NOWAIT
allocations will recover some memory from the dma_constraint range.

The allocation still fails, the intent is to ensure that the
pagedaemon will free some memory to possibly allow a subsequent
allocation to succeed.

This also adds a UVM_PLA_NOWAKE flag to allow special cases in the
buffer cache to not wake up the pagedaemon until they want to.

ok kettenis@

Revision 1.79 / (download) - annotate - [select for diffs], Thu Jan 18 18:08:51 2018 UTC (6 years, 4 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.78: +7 -1 lines
Diff to previous 1.78 (colored)

While booting it does not make sense to wait for memory, there is
no other process which could free it.  Better panic in malloc(9)
or pool_get(9) instead of sleeping forever.
tested by visa@ patrick@ Jan Klemkow
suggested by kettenis@;  OK deraadt@

Revision 1.78 / (download) - annotate - [select for diffs], Tue Feb 14 10:31:15 2017 UTC (7 years, 3 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.77: +3 -3 lines
Diff to previous 1.77 (colored)

Convert most of the manual checks for CPU hogging to sched_pause().

The distinction between preempt() and yield() stays as it is usueful
to know if a thread decided to yield by itself or if the kernel told
him to go away.

ok tedu@, guenther@

Revision 1.77 / (download) - annotate - [select for diffs], Thu Oct 8 15:58:38 2015 UTC (8 years, 7 months ago) by kettenis
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.76: +3 -1 lines
Diff to previous 1.76 (colored)

Lock the page queues by turning uvm_lock_pageq() and uvm_unlock_pageq() into
mtx_enter() and mtx_leave() operations.  Not 100% this won't blow up but
there is only one way to find out, and we need this to make progress on
further unlocking uvm.

prodded by deraadt@

Revision 1.76 / (download) - annotate - [select for diffs], Fri Aug 21 16:04:35 2015 UTC (8 years, 9 months ago) by visa
Branch: MAIN
Changes since 1.75: +7 -39 lines
Diff to previous 1.75 (colored)

Remove the unused loan_count field and the related uvm logic. Most of
the page loaning code is already in the Attic.

ok kettenis@, beck@

Revision 1.75 / (download) - annotate - [select for diffs], Wed Dec 17 19:42:15 2014 UTC (9 years, 5 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.74: +2 -2 lines
Diff to previous 1.74 (colored)

remove lock.h from uvm_extern.h. another holdover from the simpletonlock
era. fix uvm including c files to include lock.h or atomic.h as necessary.
ok deraadt

Revision 1.74 / (download) - annotate - [select for diffs], Sun Nov 16 12:31:00 2014 UTC (9 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.73: +6 -6 lines
Diff to previous 1.73 (colored)

Replace a plethora of historical protection options with just
PROT_NONE, PROT_READ, PROT_WRITE, and PROT_EXEC from mman.h.
PROT_MASK is introduced as the one true way of extracting those bits.
Remove UVM_ADV_* wrapper, using the standard names.
ok doug guenther kettenis

Revision 1.73 / (download) - annotate - [select for diffs], Sun Sep 14 14:17:27 2014 UTC (9 years, 8 months ago) by jsg
Branch: MAIN
Changes since 1.72: +1 -2 lines
Diff to previous 1.72 (colored)

remove uneeded proc.h includes
ok mpi@ kspillner@

Revision 1.72 / (download) - annotate - [select for diffs], Tue Sep 9 07:07:39 2014 UTC (9 years, 8 months ago) by blambert
Branch: MAIN
Changes since 1.71: +5 -1 lines
Diff to previous 1.71 (colored)

Make the cleaner, syncer, pagedaemon, aiodone daemons all
yield() if the cpu is marked SHOULDYIELD.

ok miod@ tedu@ phessler@

Revision 1.71 / (download) - annotate - [select for diffs], Sat Jul 12 09:02:24 2014 UTC (9 years, 10 months ago) by kettenis
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.70: +59 -1 lines
Diff to previous 1.70 (colored)

Add a function to drop all clean pages on the page daemon queues and call
it when we hibernate.

ok mlarkin@, miod@, deraadt@

Revision 1.70 / (download) - annotate - [select for diffs], Fri Jul 11 16:35:40 2014 UTC (9 years, 10 months ago) by jsg
Branch: MAIN
Changes since 1.69: +2 -7 lines
Diff to previous 1.69 (colored)

Chuck Cranor rescinded clauses in his license
on the 2nd of February 2011 in NetBSD.

http://marc.info/?l=netbsd-source-changes&m=129658899212732&w=2
http://marc.info/?l=netbsd-source-changes&m=129659095515558&w=2
http://marc.info/?l=netbsd-source-changes&m=129659157916514&w=2
http://marc.info/?l=netbsd-source-changes&m=129665962324372&w=2
http://marc.info/?l=netbsd-source-changes&m=129666033625342&w=2
http://marc.info/?l=netbsd-source-changes&m=129666052825545&w=2
http://marc.info/?l=netbsd-source-changes&m=129666922906480&w=2
http://marc.info/?l=netbsd-source-changes&m=129667725518082&w=2

Revision 1.69 / (download) - annotate - [select for diffs], Tue Jul 8 13:10:52 2014 UTC (9 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.68: +1 -1 lines
Diff to previous 1.68 (colored)

subtle rearrangement of includes

Revision 1.68 / (download) - annotate - [select for diffs], Tue Jul 8 11:38:48 2014 UTC (9 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.67: +1 -11 lines
Diff to previous 1.67 (colored)

bye bye UBC; ok beck dlg

Revision 1.67 / (download) - annotate - [select for diffs], Sun Apr 13 23:14:15 2014 UTC (10 years, 1 month ago) by tedu
Branch: MAIN
Changes since 1.66: +13 -77 lines
Diff to previous 1.66 (colored)

compress code by turning four line comments into one line comments.
emphatic ok usual suspects, grudging ok miod

Revision 1.66 / (download) - annotate - [select for diffs], Thu Feb 6 16:40:40 2014 UTC (10 years, 3 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.65: +4 -1 lines
Diff to previous 1.65 (colored)

add some more bufbackoff calls. uvm_wait optimistically (?), uvm_wait_pla
after analysis and testing. when flushing a large mmapped file, we can
eat up all the reserve bufs, but there's a good chance there will be more
clean ones available.
ok beck kettenis

Revision 1.65 / (download) - annotate - [select for diffs], Thu Feb 6 16:32:40 2014 UTC (10 years, 3 months ago) by tedu
Branch: MAIN
Changes since 1.64: +3 -3 lines
Diff to previous 1.64 (colored)

parenthesis to make the math right. ok beck kettenis

Revision 1.64 / (download) - annotate - [select for diffs], Thu May 30 16:29:46 2013 UTC (11 years ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.63: +6 -22 lines
Diff to previous 1.63 (colored)

remove lots of comments about locking per beck's request

Revision 1.63 / (download) - annotate - [select for diffs], Thu May 30 15:17:59 2013 UTC (11 years ago) by tedu
Branch: MAIN
Changes since 1.62: +1 -66 lines
Diff to previous 1.62 (colored)

remove simple_locks from uvm code. ok beck deraadt

Revision 1.62 / (download) - annotate - [select for diffs], Thu Feb 7 17:29:31 2013 UTC (11 years, 3 months ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.61: +2 -2 lines
Diff to previous 1.61 (colored)

make sure the page daemon considers BUFPAGES_INACT when deciding
to do work, just as is done when waking it up.
tested by me, phessler@, espie@, landry@
ok kettenis@

Revision 1.61 / (download) - annotate - [select for diffs], Mon Dec 10 22:42:54 2012 UTC (11 years, 5 months ago) by beck
Branch: MAIN
Changes since 1.60: +14 -22 lines
Diff to previous 1.60 (colored)

Always back the buffer cache off on any page daemon wakeup. This avoids
a few problems noticed by phessler@ and beck@ where certain allocations
would repeatedly wake the page daemon even though the page daemon's targets
were met already so it didn't do any work. We can avoid this problem when
the buffer cache has pages to throw away by always doing so any time
the page daemon is woken, rather than only when we are under the free
page target.
ok phessler@ deraadt@

Revision 1.60 / (download) - annotate - [select for diffs], Wed Nov 7 17:50:49 2012 UTC (11 years, 6 months ago) by beck
Branch: MAIN
Changes since 1.59: +23 -8 lines
Diff to previous 1.59 (colored)


Fix the buffer cache.

A long time ago (in vienna) the reserves for the cleaner and syncer were
removed. softdep and many things have not performed ths same ever since.
Follow on generations of buffer cache hackers assumed the exising code
was the reference and have been in frustrating state of coprophagia ever
since.

This commit

0) Brings back a (small) reserve allotment of buffer pages, and the kva to
   map them, to allow the cleaner and syncer to run even when under intense
   memory or kva pressure.
1) Fixes a lot of comments and variables to represent reality.
2) Simplifies and corrects how the buffer cache backs off down to the lowest
   level.
3) Corrects how the page daemons asks the buffer cache to back off, ensuring
   that uvmpd_scan is done to recover inactive pages in low memory situaitons
4) Adds a high water mark to the pool used to allocate struct buf's
5) Correct the cleaner and the sleep/wakeup cases in both low memory and low
   kva situations. (including accounting for the cleaner/syncer reserve)

Tested by many, with very much helpful input from deraadt, miod, tobiasu,
kettenis and others.

ok kettenis@ deraadt@ jj@

Revision 1.59 / (download) - annotate - [select for diffs], Wed Jul 6 19:50:38 2011 UTC (12 years, 11 months ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.58: +40 -7 lines
Diff to previous 1.58 (colored)


uvm changes for buffer cache improvements.
1) Make the pagedaemon aware of the memory ranges and size of allocations
where memory is being requested, and pass this information on to
bufbackoff(), which will later (not yet) be used to ensure that the
buffer cache gets out of the way in the right area of memory.

Note that this commit does not yet make it *do* that - as currently
the buffer cache is all in dma-able memory and it will simply back
off.

2) Add uvm_pagerealloc_multi - to be used by the buffer cache code
for reallocating pages to particular regions.

much of this work by ariane, with smatterings of me, art,and oga

ok oga@, thib@, ariane@, deraadt@

Revision 1.58 / (download) - annotate - [select for diffs], Sun Jul 3 18:34:14 2011 UTC (12 years, 11 months ago) by oga
Branch: MAIN
Changes since 1.57: +1 -24 lines
Diff to previous 1.57 (colored)

Rip out and burn support for UVM_HIST.

The vm hackers don't use it, don't maintain it and have to look at it all the
time. About time this 800 lines of code hit /dev/null.

``never liked it'' tedu@. ariane@ was very happy when i told her i wrote
this diff.

Revision 1.57 / (download) - annotate - [select for diffs], Fri Apr 1 12:58:13 2011 UTC (13 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.56: +2 -2 lines
Diff to previous 1.56 (colored)

Typo in comment.

Revision 1.56 / (download) - annotate - [select for diffs], Sun Sep 26 12:53:27 2010 UTC (13 years, 8 months ago) by thib
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.55: +6 -6 lines
Diff to previous 1.55 (colored)

remove static so things show up in ddb.

ok miod@, oga@, tedu@

Revision 1.55 / (download) - annotate - [select for diffs], Wed Oct 14 17:53:30 2009 UTC (14 years, 7 months ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.54: +4 -11 lines
Diff to previous 1.54 (colored)

Fix buffer cache backoff in the page daemon - deal with inactive pages to
more correctly reflect the new state of the world - that is - how many pages
can be cheaply reclaimed - which now includes clean buffer cache pages.

This change fixes situations where people would be running with a large bufcachepercent, and still notice swapping without the buffer cache backing off.

ok oga@, testing by many on tech@ and others. Thanks.

Revision 1.54 / (download) - annotate - [select for diffs], Sat Aug 8 13:43:59 2009 UTC (14 years, 9 months ago) by beck
Branch: MAIN
Changes since 1.53: +10 -4 lines
Diff to previous 1.53 (colored)

fix the page daemon to back off the buffer cache correctly even in the case
where we are below the inactive page target. This fixes a problem with a large
buffer cache on low memory machines where the the page daemon would woken up,
however the buffer cache would never be backed off because we were below the
inactive page target, which could result in constant paging and basically
a livelock condition.

ok oga@ art@

Revision 1.53 / (download) - annotate - [select for diffs], Sun Aug 2 16:28:40 2009 UTC (14 years, 10 months ago) by beck
Branch: MAIN
Changes since 1.52: +6 -4 lines
Diff to previous 1.52 (colored)


Dynamic buffer cache support - a re-commit of what was backed out
after c2k9

allows buffer cache to be extended and grow/shrink dynamically

tested by many, ok oga@, "why not just commit it" deraadt@

Revision 1.52 / (download) - annotate - [select for diffs], Wed Jul 22 21:05:37 2009 UTC (14 years, 10 months ago) by oga
Branch: MAIN
Changes since 1.51: +18 -33 lines
Diff to previous 1.51 (colored)

Put the PG_RELEASED changes diff back in.

This has has been tested very very thoroughly on all archs we have
excepting 88k and 68k. Please see cvs log for the individual commit
messages.

ok beck@, thib@

Revision 1.51 / (download) - annotate - [select for diffs], Fri Jun 26 20:26:02 2009 UTC (14 years, 11 months ago) by oga
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.50: +7 -2 lines
Diff to previous 1.50 (colored)

Fix a use after free in the pagedaemon.

specifically, if we free a RELEASED anon, then we will first of all
remove the page from the anon, free the anon, then get the next page
relative to the anon page, then call uvm_pagefree().

The problem is that while we zero out anon->an_page, we do not zero out
pg->uanon. Now, uvm_pagefree() if pg->uanon is not NULL zeroes out some
variables in the struct for us. One of the backed out commits added more
zeroing there which would have exacerbated this use after free under
heavy paging (which was where we saw bugs). Fix this by zeroing out
pg->uanon.

I have looked for other similar cases, but have not found any as of yet.

been in snaps a while, "please do commit that" deraadt@

Revision 1.50 / (download) - annotate - [select for diffs], Wed Jun 17 00:13:59 2009 UTC (14 years, 11 months ago) by oga
Branch: MAIN
Changes since 1.49: +11 -11 lines
Diff to previous 1.49 (colored)

date based reversion of uvm to the 4th May.

More backouts in line with previous ones, this appears to bring us back to a
stable condition.

A machine forced to 64mb of ram cycled 10GB through swap with this diff
and is still running as I type this. Other tests by ariane@ and thib@
also seem to show that it's alright.

ok deraadt@, thib@, ariane@

Revision 1.49 / (download) - annotate - [select for diffs], Tue Jun 16 00:11:29 2009 UTC (14 years, 11 months ago) by oga
Branch: MAIN
Changes since 1.48: +29 -13 lines
Diff to previous 1.48 (colored)

Backout all changes to uvm after pmemrange (which will be backed out
separately).

a change at or just before the hackathon has either exposed or added a
very very nasty memory corruption bug that is giving us hell right now.
So in the interest of kernel stability these diffs are being backed out
until such a time as that corruption bug has been found and squashed,
then the ones that are proven good may slowly return.

a quick hitlist of the main commits this backs out:

mine:
uvm_objwire
the lock change in uvm_swap.c
using trees for uvm objects instead of the hash
removing the pgo_releasepg callback.

art@'s:
putting pmap_page_protect(VM_PROT_NONE) in uvm_pagedeactivate() since
all callers called that just prior anyway.

ok beck@, ariane@.

prompted by deraadt@.

Revision 1.48 / (download) - annotate - [select for diffs], Mon Jun 15 17:01:26 2009 UTC (14 years, 11 months ago) by beck
Branch: MAIN
Changes since 1.47: +6 -8 lines
Diff to previous 1.47 (colored)

Back out all the buffer cache changes I committed during c2k9. This reverts three
commits:

1) The sysctl allowing bufcachepercent to be changed at boot time.
2) The change moving the buffer cache hash chains to a red-black tree
3) The dynamic buffer cache (Which depended on the earlier too).

ok on the backout from marco and todd

Revision 1.47 / (download) - annotate - [select for diffs], Sat Jun 6 23:35:08 2009 UTC (14 years, 11 months ago) by art
Branch: MAIN
Changes since 1.46: +1 -2 lines
Diff to previous 1.46 (colored)

Somehow I missed comitting this.

Revision 1.46 / (download) - annotate - [select for diffs], Fri Jun 5 04:29:14 2009 UTC (15 years ago) by beck
Branch: MAIN
Changes since 1.45: +8 -6 lines
Diff to previous 1.45 (colored)

Dynamic buffer cache sizing.

This commit won't change the default behaviour of the system unless the
buffer cache size is increased with sysctl kern.bufcachepercent. By default
our buffer cache is 10% of memory, which with this commit is now treated
as a low water mark.  If the buffer cache size is increased, the new size
is treated as a high water mark and the buffer cache is permitted to grow
to that percentage of memory.

If the page daemon is invoked, the page daemon will ask the buffer cache
to relenquish pages. if the buffer cache has more than the low water mark it
will relenquish pages allowing them to be consumed by uvm. after a short
period the buffer cache will attempt to re-grow back to the high water mark.

This permits the use of a large buffer cache without penalizing the available
memory for other purposes.

Above the low water mark the buffer cache remains entirely subservient to
the page daemon, so if uvm requires pages, the buffer cache will abandon
them.

ok art@ thib@ oga@

Revision 1.45 / (download) - annotate - [select for diffs], Mon Jun 1 19:54:02 2009 UTC (15 years ago) by oga
Branch: MAIN
Changes since 1.44: +13 -28 lines
Diff to previous 1.44 (colored)

Since we've now cleared up a lot of the PG_RELEASED setting, remove the
pgo_releasepg() hook and just free the page the "normal" way in the one
place we'll ever see PG_RELEASED and should care (uvm_page_unbusy,
called in aiodoned).

ok art@, beck@, thib@

Revision 1.44 / (download) - annotate - [select for diffs], Fri May 8 13:50:15 2009 UTC (15 years ago) by ariane
Branch: MAIN
Changes since 1.43: +6 -6 lines
Diff to previous 1.43 (colored)

Remove static qualifier of functions that are not inline.
Makes trace in ddb useful.

ok oga

Revision 1.43 / (download) - annotate - [select for diffs], Mon May 4 18:08:06 2009 UTC (15 years, 1 month ago) by oga
Branch: MAIN
Changes since 1.42: +6 -6 lines
Diff to previous 1.42 (colored)

Instead of keeping two ints in the uvm structure specifically just to
sleep on them (and otherwise ignore them) sleep on the pointer to the
{aiodoned,pagedaemon}_proc members, and nuke the two extra words.

"no objections" art@, ok beck@.

Revision 1.42 / (download) - annotate - [select for diffs], Fri Apr 17 07:14:04 2009 UTC (15 years, 1 month ago) by oga
Branch: MAIN
Changes since 1.41: +1 -3 lines
Diff to previous 1.41 (colored)

Another case of locking just to read uvmexp.free. Kill the locking, not
needed.

"of course" art@.

Revision 1.41 / (download) - annotate - [select for diffs], Wed Apr 15 12:43:07 2009 UTC (15 years, 1 month ago) by oga
Branch: MAIN
Changes since 1.40: +1 -4 lines
Diff to previous 1.40 (colored)

We don't need to grab the fpageqlock to do nothing but look at the value
of uvmexp.free.

"yeah, go for it" art@

Revision 1.40 / (download) - annotate - [select for diffs], Tue Apr 14 20:12:05 2009 UTC (15 years, 1 month ago) by oga
Branch: MAIN
Changes since 1.39: +13 -22 lines
Diff to previous 1.39 (colored)

The use of uvm.pagedaemon_lock is incredibly inconsistent. only a
fraction of the wakeups and sleeps involved here actually grab that
lock. The remainder, on the other hand, always have the fpageq_lock
locked.

So, make this locking correct by switching the other users over to
fpageq_lock, too.

This would probably be better off being a semaphore, but for now at
least it's correct.

"ok, unless you want to implement semaphores" art@

Revision 1.39 / (download) - annotate - [select for diffs], Mon Apr 13 22:17:54 2009 UTC (15 years, 1 month ago) by oga
Branch: MAIN
Changes since 1.38: +4 -12 lines
Diff to previous 1.38 (colored)

Convert the page queue lock to a mutex instead of a simplelock.

Fix up the one case of lock recursion (which blatantly ignored the
comment right above it saying that we don't need to lock). The rest of
the lock usage has been checked and appears to be correct.

ok ariane@.

Revision 1.38 / (download) - annotate - [select for diffs], Mon Apr 6 12:02:52 2009 UTC (15 years, 2 months ago) by oga
Branch: MAIN
Changes since 1.37: +10 -28 lines
Diff to previous 1.37 (colored)

Instead of doing splbio(); simple_lock(&uvm.aiodoned_lock); just replace
the simple lock with a real lock - a IPL_BIO mutex. While i'm here, make
the sleeping condition one hell of a lot simpler in the aio daemon.

some ideas from and ok art@.

Revision 1.37 / (download) - annotate - [select for diffs], Fri Mar 20 15:19:04 2009 UTC (15 years, 2 months ago) by oga
Branch: MAIN
Changes since 1.36: +3 -5 lines
Diff to previous 1.36 (colored)

While working on some stuff in uvm I've gotten REALLY sick of reading
K&R function declarations, so switch them all over to ansi-style, in
accordance with the prophesy.

"go for it" art@

Revision 1.36 / (download) - annotate - [select for diffs], Mon Jan 12 19:03:12 2009 UTC (15 years, 4 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.35: +3 -1 lines
Diff to previous 1.35 (colored)

Register aiodoned_proc, although it is not used anywhere yet; PR #6034

Revision 1.35 / (download) - annotate - [select for diffs], Wed Jul 2 15:21:33 2008 UTC (15 years, 11 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.34: +10 -17 lines
Diff to previous 1.34 (colored)

Make the pagedaemon a bit happier.
1. When checking if the pagedaemon should be awakened and to see how
   much work it should do, consider the buffer cache deficit
   (how much pages the buffer cache can eat max vs. how much it has
   now) as pages that are not free. They are actually still usable by
   the allocator, but the presure on the pagedaemon is increased when
   we starting to chew into the memory that the buffer cache wants to
   use.
2. Remove the stupid 512kB limit of how much memory should be our
   free target. That maybe made sense on 68k, but on modern systems
   512k is just a joke. Keep it at 3% of physical memory just like
   it was meant to be.
3. When doing allocations for the pagedaemon, always let it use the
   reserve. the whole UVM_OBJ_IS_KERN_OBJECT is silly and doesn't
   work in most cases anyway. We still don't have a reserve for
   the pagedaemon in the km_page allocator, but this seems to help
   enough. (yes, there are still bad cases in that code and the comment
   is only half-true, the whole section needs a massage, but that will
   happen later, this diff only touches pagedaemon parts)

Testing by many, prodded by theo.

Revision 1.34 / (download) - annotate - [select for diffs], Tue Dec 18 11:05:52 2007 UTC (16 years, 5 months ago) by thib
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.33: +9 -9 lines
Diff to previous 1.33 (colored)

Turn the uvm_{lock/unlock}_fpageq() inlines into
macros that just expand into the mutex functions
to keep the abstraction, do assorted cleanup.

ok miod@,art@

Revision 1.33 / (download) - annotate - [select for diffs], Mon Jun 18 21:51:15 2007 UTC (16 years, 11 months ago) by pedro
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.32: +3 -3 lines
Diff to previous 1.32 (colored)

Bring back Mickey's UVM anon change. Testing by thib@, beck@ and
ckuethe@ for a while. Okay beck@, "it is good timing" deraadt@.

Revision 1.32 / (download) - annotate - [select for diffs], Fri Apr 13 18:57:49 2007 UTC (17 years, 1 month ago) by art
Branch: MAIN
Changes since 1.31: +30 -25 lines
Diff to previous 1.31 (colored)

While splitting flags and pqflags might have been a good idea in theory
to separate locking, on most modern machines this is not enough
since operations on short types touch other short types that share the
same word in memory.

Merge pg_flags and pqflags again and now use atomic operations to change
the flags. Also bump wire_count to an int and pg_version might go
int as well, just for alignment.

tested by many, many. ok miod@

Revision 1.31 / (download) - annotate - [select for diffs], Wed Apr 4 17:44:45 2007 UTC (17 years, 2 months ago) by art
Branch: MAIN
Changes since 1.30: +14 -14 lines
Diff to previous 1.30 (colored)

Mechanically rename the "flags" and "version" fields in struct vm_page
to "pg_flags" and "pg_version", so that they are a bit easier to work with.
Whoever uses generic names like this for a popular struct obviously doesn't
read much code.

Most architectures compile and there are no functionality changes.

deraadt@ ok ("if something fails to compile, we fix that by hand")

Revision 1.30 / (download) - annotate - [select for diffs], Mon Jul 31 11:51:29 2006 UTC (17 years, 10 months ago) by mickey
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.29: +5 -5 lines
Diff to previous 1.29 (colored)

fix uvmhist #2: args are always u_long so fix missing %d and %x and no %ll; no change for normal code

Revision 1.29 / (download) - annotate - [select for diffs], Thu Jul 13 22:51:26 2006 UTC (17 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored)

Back out the anon change.  Apparently it was tested by a few, but most of
us did not see it or get a chance to test it before it was commited. It
broke cvs, in the ami driver, making it not succeed at seeing it's devices.

Revision 1.28 / (download) - annotate - [select for diffs], Wed Jun 21 16:20:05 2006 UTC (17 years, 11 months ago) by mickey
Branch: MAIN
Changes since 1.27: +3 -3 lines
Diff to previous 1.27 (colored)

from netbsd: make anons dynamically allocated from pool.
this results in lesse kva waste due to static preallocation of those
for every phys page and also every swap page.
tested by beck krw miod

Revision 1.27 / (download) - annotate - [select for diffs], Tue May 16 08:34:42 2006 UTC (18 years ago) by mickey
Branch: MAIN
Changes since 1.26: +2 -2 lines
Diff to previous 1.26 (colored)

tpyo

Revision 1.26 / (download) - annotate - [select for diffs], Sun May 7 20:06:50 2006 UTC (18 years, 1 month ago) by tedu
Branch: MAIN
Changes since 1.25: +1 -4 lines
Diff to previous 1.25 (colored)

remove drain hooks from pool.
1.  drain hooks and lists of allocators make the code complicated
2.  the only hooks in the system are the mbuf reclaim routines
3.  if reclaim is actually able to put a meaningful amount of memory back
in the system, i think something else is dicked up.  ie, if reclaiming
your ip fragment buffers makes the difference thrashing swap and not,
your system is in a load of trouble.
4.  it's a scary amount of code running with very weird spl requirements
and i'd say it's pretty much totally untested.  raise your hand if your
router is running at the edge of swap.
5.  the reclaim stuff goes back to when mbufs lived in a tiny vm_map and
you could run out of va.  that's very unlikely (like impossible) now.
ok/tested pedro krw sturm

Revision 1.20.2.5 / (download) - annotate - [select for diffs], Sat Feb 21 00:20:22 2004 UTC (20 years, 3 months ago) by tedu
Branch: UBC
Changes since 1.20.2.4: +7 -7 lines
Diff to previous 1.20.2.4 (colored) to branchpoint 1.20 (colored) next main 1.21 (colored)

add VEXECMAP.  also make sure to modify filepages count only in the not
execpages case in uvm_pageremove().
this actually appears to solve the swap freak out problems.  sitting on it for
a long time, never checked if it worked.  sigh.

Revision 1.4.2.8 / (download) - annotate - [select for diffs], Fri Mar 28 00:08:48 2003 UTC (21 years, 2 months ago) by niklas
Branch: SMP
Changes since 1.4.2.7: +2 -0 lines
Diff to previous 1.4.2.7 (colored) to branchpoint 1.4 (colored) next main 1.5 (colored)

Sync the SMP branch with 3.3

Revision 1.20.2.4 / (download) - annotate - [select for diffs], Mon Nov 4 18:02:33 2002 UTC (21 years, 7 months ago) by art
Branch: UBC
Changes since 1.20.2.3: +62 -54 lines
Diff to previous 1.20.2.3 (colored) to branchpoint 1.20 (colored)

Huge sync to NetBSD plus lots of bugfixes.
 - uvm is as in netbsd-current minus uvm_map forward merge.
 - various locking bugfixes in nfs.
 - make sure that all specops and fifoops are correct in all vnodeop vectors.
 - make the filesystem code more like filsystem code and less like vm code.

Revision 1.20.2.3 / (download) - annotate - [select for diffs], Tue Jun 11 03:33:04 2002 UTC (21 years, 11 months ago) by art
Branch: UBC
Changes since 1.20.2.2: +6 -4 lines
Diff to previous 1.20.2.2 (colored) to branchpoint 1.20 (colored)

Sync UBC branch to -current

Revision 1.25 / (download) - annotate - [select for diffs], Fri May 24 13:10:53 2002 UTC (22 years ago) by art
Branch: MAIN
CVS Tags: UBC_SYNC_B, UBC_SYNC_A, SMP_SYNC_B, SMP_SYNC_A, OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4, OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.24: +3 -1 lines
Diff to previous 1.24 (colored)

Make sure that b_iodone handlers are called at splbio (and splassert(IPL_BIO) in all known callers, just to make sure).

Revision 1.4.2.7 / (download) - annotate - [select for diffs], Thu Mar 28 14:54:27 2002 UTC (22 years, 2 months ago) by niklas
Branch: SMP
Changes since 1.4.2.6: +3 -3 lines
Diff to previous 1.4.2.6 (colored) to branchpoint 1.4 (colored)

Merge in -current from roughly a week ago

Revision 1.24 / (download) - annotate - [select for diffs], Thu Mar 14 01:27:18 2002 UTC (22 years, 2 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.23: +4 -4 lines
Diff to previous 1.23 (colored)

First round of __P removal in sys

Revision 1.4.2.6 / (download) - annotate - [select for diffs], Wed Mar 6 02:17:14 2002 UTC (22 years, 3 months ago) by niklas
Branch: SMP
Changes since 1.4.2.5: +216 -82 lines
Diff to previous 1.4.2.5 (colored) to branchpoint 1.4 (colored)

Merge in trunk

Revision 1.23 / (download) - annotate - [select for diffs], Sun Feb 10 23:15:05 2002 UTC (22 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored)

spelling

Revision 1.20.2.2 / (download) - annotate - [select for diffs], Sat Feb 2 03:28:27 2002 UTC (22 years, 4 months ago) by art
Branch: UBC
Changes since 1.20.2.1: +221 -311 lines
Diff to previous 1.20.2.1 (colored) to branchpoint 1.20 (colored)

Merge in UBC performance changes from NetBSD.
Fix a bunch of merge errors from yesterday.

Revision 1.20.2.1 / (download) - annotate - [select for diffs], Thu Jan 31 22:55:51 2002 UTC (22 years, 4 months ago) by niklas
Branch: UBC
Changes since 1.20: +24 -45 lines
Diff to previous 1.20 (colored)

Merge in -current, builds on i386, otherwise untested

Revision 1.22 / (download) - annotate - [select for diffs], Wed Jan 2 22:23:25 2002 UTC (22 years, 5 months ago) by miod
Branch: MAIN
Changes since 1.21: +37 -51 lines
Diff to previous 1.21 (colored)

Back out a few more uvm changes, especially wrt swap usage.
This unbreaks m68k m88k sparc and perhaps others, which eventually froze
when hitting swap.
Tested by various people on various platforms.
ok art@

Revision 1.21 / (download) - annotate - [select for diffs], Wed Dec 19 08:58:07 2001 UTC (22 years, 5 months ago) by art
Branch: MAIN
Changes since 1.20: +188 -40 lines
Diff to previous 1.20 (colored)

UBC was a disaster. It worked very good when it worked, but on some
machines or some configurations or in some phase of the moon (we actually
don't know when or why) files disappeared. Since we've not been able to
track down the problem in two weeks intense debugging and we need -current
to be stable, back out everything to a state it had before UBC.

We apologise for the inconvenience.

Revision 1.4.2.5 / (download) - annotate - [select for diffs], Wed Dec 5 01:23:58 2001 UTC (22 years, 6 months ago) by niklas
Branch: SMP
Changes since 1.4.2.4: +39 -187 lines
Diff to previous 1.4.2.4 (colored) to branchpoint 1.4 (colored)

Merge in -current

Revision 1.20 / (download) - annotate - [select for diffs], Wed Nov 28 19:28:15 2001 UTC (22 years, 6 months ago) by art
Branch: MAIN
CVS Tags: UBC_BASE
Branch point for: UBC
Changes since 1.19: +28 -33 lines
Diff to previous 1.19 (colored)

Sync in more uvm from NetBSD. Mostly just cosmetic stuff.
Contains also support for page coloring.

Revision 1.19 / (download) - annotate - [select for diffs], Wed Nov 28 13:47:40 2001 UTC (22 years, 6 months ago) by art
Branch: MAIN
Changes since 1.18: +14 -157 lines
Diff to previous 1.18 (colored)

Sync in more uvm changes from NetBSD.
This time we're getting rid of KERN_* and VM_PAGER_* error codes and
use errnos instead.

Revision 1.4.2.4 / (download) - annotate - [select for diffs], Tue Nov 13 23:02:31 2001 UTC (22 years, 6 months ago) by niklas
Branch: SMP
Changes since 1.4.2.3: +254 -231 lines
Diff to previous 1.4.2.3 (colored) to branchpoint 1.4 (colored)

merge in -current

Revision 1.18 / (download) - annotate - [select for diffs], Mon Nov 12 01:26:10 2001 UTC (22 years, 6 months ago) by art
Branch: MAIN
Changes since 1.17: +96 -90 lines
Diff to previous 1.17 (colored)

Bring in more changes from NetBSD. Mostly pagedaemon improvements.

Revision 1.17 / (download) - annotate - [select for diffs], Sat Nov 10 18:42:31 2001 UTC (22 years, 6 months ago) by art
Branch: MAIN
Changes since 1.16: +164 -148 lines
Diff to previous 1.16 (colored)

Merge in some parts of the ubc work that has been done in NetBSD that are not
UBC, but prerequsites for it.

- Create a daemon that processes async I/O (swap and paging in the future)
  requests that need processing in process context and that were processed
  in the pagedaemon before.
- Convert some ugly ifdef DIAGNOSTIC code to less intrusive KASSERTs.
- misc other cleanups.

Revision 1.16 / (download) - annotate - [select for diffs], Tue Nov 6 13:36:52 2001 UTC (22 years, 7 months ago) by art
Branch: MAIN
Changes since 1.15: +7 -3 lines
Diff to previous 1.15 (colored)

More sync to NetBSD.
 - Use malloc/free instead of MALLOC/FREE for variable sized allocations.
 - Move the memory inheritance code to sys/mman.h and rename from VM_* to MAP_*
 - various cleanups and simplifications.

Revision 1.15 / (download) - annotate - [select for diffs], Tue Nov 6 01:35:04 2001 UTC (22 years, 7 months ago) by art
Branch: MAIN
Changes since 1.14: +2 -4 lines
Diff to previous 1.14 (colored)

Move the last content from vm/ to uvm/
The only thing left in vm/ are just dumb wrappers.
vm/vm.h includes uvm/uvm_extern.h
vm/pmap.h includes uvm/uvm_pmap.h
vm/vm_page.h includes uvm/uvm_page.h

Revision 1.14 / (download) - annotate - [select for diffs], Mon Nov 5 22:14:54 2001 UTC (22 years, 7 months ago) by art
Branch: MAIN
Changes since 1.13: +2 -3 lines
Diff to previous 1.13 (colored)

Minor sync to NetBSD.

Revision 1.4.2.3 / (download) - annotate - [select for diffs], Wed Oct 31 03:32:14 2001 UTC (22 years, 7 months ago) by nate
Branch: SMP
Changes since 1.4.2.2: +12 -14 lines
Diff to previous 1.4.2.2 (colored) to branchpoint 1.4 (colored)

Sync the SMP branch to something just after 3.0

Revision 1.13 / (download) - annotate - [select for diffs], Tue Sep 11 20:05:26 2001 UTC (22 years, 8 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.12: +1 -2 lines
Diff to previous 1.12 (colored)

Don't include <vm/vm_kern.h> if you don't need foo_map.

Revision 1.12 / (download) - annotate - [select for diffs], Sat Aug 11 10:57:22 2001 UTC (22 years, 9 months ago) by art
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

Various random fixes from NetBSD.
Including support for zeroing pages in the idle loop (not enabled yet).

Revision 1.11 / (download) - annotate - [select for diffs], Wed Jul 18 14:27:07 2001 UTC (22 years, 10 months ago) by art
Branch: MAIN
Changes since 1.10: +3 -3 lines
Diff to previous 1.10 (colored)

Make uvm_wait take a const char *

Revision 1.10 / (download) - annotate - [select for diffs], Wed Jul 18 10:47:05 2001 UTC (22 years, 10 months ago) by art
Branch: MAIN
Changes since 1.9: +10 -11 lines
Diff to previous 1.9 (colored)

Get rid of the PMAP_NEW option by making it mandatory for all archs.
The archs that didn't have a proper PMAP_NEW now have a dummy implementation
with wrappers around the old functions.

Revision 1.4.2.2 / (download) - annotate - [select for diffs], Mon May 14 22:47:47 2001 UTC (23 years ago) by niklas
Branch: SMP
Changes since 1.4.2.1: +8 -6 lines
Diff to previous 1.4.2.1 (colored) to branchpoint 1.4 (colored)

merge in approximately 2.9 into SMP branch

Revision 1.9 / (download) - annotate - [select for diffs], Thu Mar 22 03:05:56 2001 UTC (23 years, 2 months ago) by smart
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.8: +3 -2 lines
Diff to previous 1.8 (colored)

Sync style, typo, and comments a little closer to NetBSD.  art@ ok

Revision 1.8 / (download) - annotate - [select for diffs], Thu Mar 8 15:21:37 2001 UTC (23 years, 3 months ago) by smart
Branch: MAIN
Changes since 1.7: +5 -5 lines
Diff to previous 1.7 (colored)

Replace thread_wakeup() with wakeup().  It is defined in vm_extern.h as a
wrapper, so this removes a dependence on the old VM system.  From NetBSD.
art@ ok

Revision 1.7 / (download) - annotate - [select for diffs], Mon Jan 29 02:07:48 2001 UTC (23 years, 4 months ago) by niklas
Branch: MAIN
Changes since 1.6: +1 -0 lines
Diff to previous 1.6 (colored)

$OpenBSD$

Revision 1.6 / (download) - annotate - [select for diffs], Fri Nov 10 15:33:11 2000 UTC (23 years, 6 months ago) by provos
Branch: MAIN
Changes since 1.5: +1 -1 lines
Diff to previous 1.5 (colored)

seperate -> separate, okay aaron@

Revision 1.4.2.1 / (download) - annotate - [select for diffs], Fri Mar 24 09:09:51 2000 UTC (24 years, 2 months ago) by niklas
Branch: SMP
Changes since 1.4: +5 -9 lines
Diff to previous 1.4 (colored)

Sync with -current

Revision 1.5 / (download) - annotate - [select for diffs], Thu Mar 16 22:11:05 2000 UTC (24 years, 2 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7
Changes since 1.4: +5 -9 lines
Diff to previous 1.4 (colored)

Bring in some new UVM code from NetBSD (not current).

 - Introduce a new type of map that are interrupt safe and never allow faults
   in them. mb_map and kmem_map are made intrsafe.
 - Add "access protection" to uvm_vslock (to be passed down to uvm_fault and
   later to pmap_enter).
 - madvise(2) now works.
 - various cleanups.

Revision 1.4 / (download) - annotate - [select for diffs], Thu Dec 30 18:21:55 1999 UTC (24 years, 5 months ago) by provos
Branch: MAIN
CVS Tags: SMP_BASE
Branch point for: SMP
Changes since 1.3: +3 -3 lines
Diff to previous 1.3 (colored)

swap encryption for UVM, option UVM_SWAP_ENCRYPT.  needs to be enabled
via sysctl.
Pages are encrypted with the Blowfish encryption algorithm, the key
is initialized randomly on first swap out, ensuring that entropy has
accumulated in the kernel randomness pool.  Eventually, swap encryption
will be decided on a process by process basis, e.g. a process that reads from
a cryptographic filesystem will enable swap encrypt for its pages. okay
art@ and deraadt@.

Revision 1.3 / (download) - annotate - [select for diffs], Mon Aug 23 08:13:25 1999 UTC (24 years, 9 months ago) by art
Branch: MAIN
CVS Tags: kame_19991208, OPENBSD_2_6_BASE, OPENBSD_2_6
Changes since 1.2: +138 -42 lines
Diff to previous 1.2 (colored)

sync with NetBSD from 1999.05.24 (there is a reason for this date)
 Mostly cleanups, but also a few improvements to pagedaemon for better
 handling of low memory and/or low swap conditions.

Revision 1.2 / (download) - annotate - [select for diffs], Fri Feb 26 05:32:08 1999 UTC (25 years, 3 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_2_5_BASE, OPENBSD_2_5
Changes since 1.1: +1 -0 lines
Diff to previous 1.1 (colored)

add OpenBSD tags

Revision 1.1 / (download) - annotate - [select for diffs], Fri Feb 26 01:30:17 1999 UTC (25 years, 3 months ago) by art
Branch: MAIN

Import of uvm from NetBSD. Some local changes, some code disabled

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.