OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.177 / (download) - annotate - [select for diffs], Wed May 1 12:54:27 2024 UTC (5 weeks, 6 days ago) by mpi
Branch: MAIN
CVS Tags: HEAD
Changes since 1.176: +6 -14 lines
Diff to previous 1.176 (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.176 / (download) - annotate - [select for diffs], Fri Apr 19 10:22:51 2024 UTC (7 weeks, 4 days ago) by mpi
Branch: MAIN
Changes since 1.175: +13 -5 lines
Diff to previous 1.175 (colored)

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

Revision 1.175 / (download) - annotate - [select for diffs], Wed Apr 17 13:12:58 2024 UTC (7 weeks, 5 days ago) by mpi
Branch: MAIN
Changes since 1.174: +6 -14 lines
Diff to previous 1.174 (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.174 / (download) - annotate - [select for diffs], Tue Feb 13 10:16:28 2024 UTC (3 months, 3 weeks ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5
Changes since 1.173: +1 -5 lines
Diff to previous 1.173 (colored)

Remove sanity checks from uvm_pagefree(). The first thing this function does
is invoke uvm_pageclean(), which performs the exact same sanity check, so
one set of checks is enough.

ok mpi@

Revision 1.173 / (download) - annotate - [select for diffs], Sat Aug 12 07:22:56 2023 UTC (10 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4
Changes since 1.172: +9 -4 lines
Diff to previous 1.172 (colored)

Add sanity checks in uvm_pagelookup().

ok kettenis@

Revision 1.172 / (download) - annotate - [select for diffs], Sat May 13 09:24:59 2023 UTC (12 months, 4 weeks ago) by mpi
Branch: MAIN
Changes since 1.171: +9 -23 lines
Diff to previous 1.171 (colored)

Put back in the simplification of the aiodone daemon.

Previous "breakage" of the swap on arm64 has been found to be an issue
on one machine the rockpro/arm64 related to a deadlock built into the
sdmmc(4) stack interacting with swapping code both running under
KERNEL_LOCK().

This issue is easily reproducible on -current and entering swap when
building LLVM on a rockpro crashes the machine by memory corruption.

Tested by mlarkin@ on octeon & i386, by myself on amd64 & arm64 and by
sthen@ on i386 port bulk.

ok beck@ some time ago.

Previous commit message:

Simplify the aiodone daemon which is only used for async writes.

- Remove unused support for asynchronous read, including error conditions

- Grab the proper lock for each page that has been written to swap.  This
allows to enable an assertion in uvm_page_unbusy().

- Move the uvm_anon_release() call outside of uvm_page_unbusy() and
assert for the different anon cases.

ok beck@, kettenis@

Revision 1.171 / (download) - annotate - [select for diffs], Tue Apr 11 00:45:09 2023 UTC (14 months ago) by jsg
Branch: MAIN
Changes since 1.170: +2 -2 lines
Diff to previous 1.170 (colored)

fix double words in comments
feedback and ok jmc@ miod, ok millert@

Revision 1.170 / (download) - annotate - [select for diffs], Mon Aug 29 02:58:13 2022 UTC (21 months, 1 week ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.169: +2 -2 lines
Diff to previous 1.169 (colored)

static inline, not inline static

c99 6.11.5:
"The placement of a storage-class specifier other than at the beginning
of the declaration specifiers in a declaration is an obsolescent
feature."

ok guenther@

Revision 1.169 / (download) - annotate - [select for diffs], Mon Aug 1 14:15:46 2022 UTC (22 months, 1 week ago) by mpi
Branch: MAIN
Changes since 1.168: +18 -1 lines
Diff to previous 1.168 (colored)

Introduce and use uvm_pagewait() where PG_WANTED is set.

No change in behavior.

ok kn@, semarie@, kettenis@

Revision 1.168 / (download) - annotate - [select for diffs], Sun Jul 24 11:00:22 2022 UTC (22 months, 2 weeks ago) by mpi
Branch: MAIN
Changes since 1.167: +23 -8 lines
Diff to previous 1.167 (colored)

Revert simplification of the aiodone daemon it breaks swap on arm64.

Found the hard way by mlarkin@ and deraadt@.

Revision 1.167 / (download) - annotate - [select for diffs], Mon Jul 11 11:33:17 2022 UTC (23 months ago) by mpi
Branch: MAIN
Changes since 1.166: +8 -23 lines
Diff to previous 1.166 (colored)

Simplify the aiodone daemon which is only used for async writes.

- Remove unused support for asynchronous read, including error conditions

- Grab the proper lock for each page that has been written to swap.  This
  allows to enable an assertion in uvm_page_unbusy().

- Move the uvm_anon_release() call outside of uvm_page_unbusy() and
  assert for the different anon cases.

ok beck@, kettenis@

Revision 1.166 / (download) - annotate - [select for diffs], Thu May 12 12:48:36 2022 UTC (2 years, 1 month ago) by mpi
Branch: MAIN
Changes since 1.165: +23 -37 lines
Diff to previous 1.165 (colored)

Introduce uvm_pagedequeue() to reduce code duplication.

ok kettenis@

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

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

ok millert@, kettenis@

Revision 1.164 / (download) - annotate - [select for diffs], Thu Apr 28 09:59:28 2022 UTC (2 years, 1 month ago) by mpi
Branch: MAIN
Changes since 1.163: +2 -4 lines
Diff to previous 1.163 (colored)

Call uvm_pageactivate() from uvm_pageunwire() instead of rerolling it.

Having fewer places manipulating the global list of active/inactive pages
will help future LRU improvements.

ok kettenis@, kn@

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

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

No functionnal change.

Revision 1.162 / (download) - annotate - [select for diffs], Thu Mar 10 10:46:56 2022 UTC (2 years, 3 months ago) by mpi
Branch: MAIN
Changes since 1.161: +1 -3 lines
Diff to previous 1.161 (colored)

Do not clear the PG_BUSY flag before passing the anon to uvm_anon_release().

Should prevent a KASSERT() from tiggering when freeing an anon after swaping-out
its memory.

This code path has been broken since at least January 2021 and is apparently not
so easy to trigger.

Found the hard way by sthen@

ok kettenis@, kn@

Revision 1.161 / (download) - annotate - [select for diffs], Wed Jan 19 02:08:24 2022 UTC (2 years, 4 months ago) by mpi
Branch: MAIN
Changes since 1.160: +8 -1 lines
Diff to previous 1.160 (colored)

Comment out an incorrect lock assertion.

The swap code path in uvm_aio_aiodone() is not holding the corresponding
page lock and shouldn't as long as anons are locked inside uvm_page_unbusy()
to handle the PG_RELEASED case.

Reported by Ralf Horstmann on bugs@

Revision 1.160 / (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.159: +59 -10 lines
Diff to previous 1.159 (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.159 / (download) - annotate - [select for diffs], Sun Oct 17 11:39:40 2021 UTC (2 years, 7 months ago) by patrick
Branch: MAIN
Changes since 1.158: +3 -3 lines
Diff to previous 1.158 (colored)

km_alloc(9) needs to be passed a size that is a multiple of PAGE_SIZE.

ok mpi@

Revision 1.158 / (download) - annotate - [select for diffs], Sun Sep 5 11:44:46 2021 UTC (2 years, 9 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.157: +5 -1 lines
Diff to previous 1.157 (colored)

Introduce dummy pagers for 'special' subsystems using UVM objects.

Some pmaps (x86, hppa) and the buffer cache rely on UVM objects to allocate
and manipulate pages.  These objects should not be manipulated by uvm_fault()
and do not currently require the same locking enforcement.

Use the dummy pagers to explicitly document which UVM functions are meant to
manipulate UVM objects (uobj) that do not need the upcoming `vmobjlock' and
instead still rely on the KERNEL_LOCK().

Tested by many as part of a larger diff.

ok kettenis@, beck@

Revision 1.157 / (download) - annotate - [select for diffs], Wed Apr 21 10:02:05 2021 UTC (3 years, 1 month ago) by mpi
Branch: MAIN
Changes since 1.156: +3 -3 lines
Diff to previous 1.156 (colored)

Convert remaining uvm_km_zalloc(9) to km_alloc(9).

Tested by bluhm@, jj@, kettenis@ and Scott Bennett.

ok kettenis@

Revision 1.156 / (download) - annotate - [select for diffs], Fri Mar 26 13:40:05 2021 UTC (3 years, 2 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.155: +17 -17 lines
Diff to previous 1.155 (colored)

Remove parenthesis around return value to reduce the diff with NetBSD.

No functional change.

ok mlarkin@

Revision 1.155 / (download) - annotate - [select for diffs], Tue Jan 19 13:21:36 2021 UTC (3 years, 4 months ago) by mpi
Branch: MAIN
Changes since 1.154: +3 -2 lines
Diff to previous 1.154 (colored)

(re)Introduce locking for amaps & anons.

A rwlock is attached to every amap and is shared with all its anon.  The
same lock will be used by multiple amaps if they have anons in common.

This should be enough to get the upper part of the fault handler out of the
KERNEL_LOCK() which seems to bring up to 20% improvements in builds.

This is based/copied/adapted from the most recent work done in NetBSD which
is an evolution of the precendent simple_lock scheme.

Tested by many, thanks!

ok kettenis@, mvs@

Revision 1.154 / (download) - annotate - [select for diffs], Wed Dec 2 16:32:00 2020 UTC (3 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.153: +7 -5 lines
Diff to previous 1.153 (colored)

Document that the page queue must only be locked if the page is managed.

ok kettenis@

Revision 1.153 / (download) - annotate - [select for diffs], Tue Dec 1 13:56:22 2020 UTC (3 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.152: +14 -51 lines
Diff to previous 1.152 (colored)

Turn uvm_pagealloc() mp-safe by checking uvmexp global with pageqlock held.

Use a new flag, UVM_PLA_USERESERVE, to tell uvm_pmr_getpages() that using
kernel reserved pages is allowed.

Merge duplicated checks waking the pagedaemon to uvm_pmr_getpages().

Add two more pages to the amount reserved for the kernel to compensate the
fact that the pagedaemon may now consume an additional page.

Document locking of some uvmexp fields.

ok kettenis@

Revision 1.152 / (download) - annotate - [select for diffs], Fri Nov 27 12:45:00 2020 UTC (3 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.151: +2 -2 lines
Diff to previous 1.151 (colored)

Set the correct IPL for `pageqlock' now that it is grabbed from interrupt.

Reported by AIsha Tammy.

ok kettenis@

Revision 1.151 / (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.150: +17 -1 lines
Diff to previous 1.150 (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.150 / (download) - annotate - [select for diffs], Tue Sep 22 14:31:08 2020 UTC (3 years, 8 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.149: +3 -3 lines
Diff to previous 1.149 (colored)

Spell inline correctly.

Reduce differences with NetBSD.

ok mvs@, kettenis@

Revision 1.149 / (download) - annotate - [select for diffs], Fri Nov 29 18:32:40 2019 UTC (4 years, 6 months ago) by kettenis
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.148: +16 -6 lines
Diff to previous 1.148 (colored)

Split out the code that removes a page from uvm objects and clears the flags
into a separate uvm_pageclean() function and call it from uvm_pagefree().

ok mpi@, guenther@, beck@

Revision 1.148 / (download) - annotate - [select for diffs], Tue Feb 26 14:24:21 2019 UTC (5 years, 3 months ago) by visa
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.147: +3 -1 lines
Diff to previous 1.147 (colored)

Introduce safe memory reclamation, a mechanism for reclaiming shared
objects that readers can access without locking. This provides a basis
for read-copy-update operations.

Readers access SMR-protected shared objects inside SMR read-side
critical section where sleeping is not allowed. To reclaim
an SMR-protected object, the writer has to ensure mutual exclusion of
other writers, remove the object's shared reference and wait until
read-side references cannot exist any longer. As an alternative to
waiting, the writer can schedule a callback that gets invoked when
reclamation is safe.

The mechanism relies on CPU quiescent states to determine when an
SMR-protected object is ready for reclamation.

The <sys/smr.h> header additionally provides an implementation of
singly- and doubly-linked lists that can be used together with SMR.
These lists allow lockless read access with a concurrent writer.

Discussed with many
OK mpi@ sashan@

Revision 1.147 / (download) - annotate - [select for diffs], Sat May 12 17:17:27 2018 UTC (6 years, 1 month ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.146: +4 -1 lines
Diff to previous 1.146 (colored)

Re-apply inadvertantly misplaced r1.127 from kettenis@:

"Buffer cache pages are wired but not counted as such.  Therefore we
have to set the wire count on the pages to 0 before we call
uvm_pagefree() on them, just like we do in buf_free_pages().
Otherwise the wired pages counter goes negative.  While there, also
sprinkle some KASSERTs in there that buf_free_pages() has as well."

ok beck@ (again)

Revision 1.146 / (download) - annotate - [select for diffs], Mon Nov 7 00:26:33 2016 UTC (7 years, 7 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.145: +4 -4 lines
Diff to previous 1.145 (colored)

Split PID from TID, giving processes a PID unrelated to the TID of their
initial thread

ok jsing@ kettenis@

Revision 1.145 / (download) - annotate - [select for diffs], Fri Sep 16 02:35:42 2016 UTC (7 years, 8 months ago) by dlg
Branch: MAIN
Changes since 1.144: +6 -6 lines
Diff to previous 1.144 (colored)

move the vm_page struct from being stored in RB macro trees to RBT functions

vm_page structs go into three trees, uvm_objtree, uvm_pmr_addr, and
uvm_pmr_size. all these have been moved to RBT code.

this should give us a decent chunk of code space back.

Revision 1.144 / (download) - annotate - [select for diffs], Fri Oct 30 16:47:01 2015 UTC (8 years, 7 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.143: +3 -3 lines
Diff to previous 1.143 (colored)

Fix two (verified to be harmless) off-by-ones in bounds checks in
uvm_page_init() (causing uvmexp.npages to be sligthly wrong if
pmap_steal_memory() has been used) and uvm_page_physload().

ok guenther@ kettenis@ visa@ beck@

Revision 1.143 / (download) - annotate - [select for diffs], Thu Oct 8 15:58:38 2015 UTC (8 years, 8 months ago) by kettenis
Branch: MAIN
Changes since 1.142: +2 -1 lines
Diff to previous 1.142 (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.142 / (download) - annotate - [select for diffs], Mon Sep 21 12:59:01 2015 UTC (8 years, 8 months ago) by visa
Branch: MAIN
Changes since 1.141: +3 -5 lines
Diff to previous 1.141 (colored)

Drop a misleading XXX about PQ_AOBJ. Clear PQ_ANON unconditionally for
consistency with PQ_AOBJ.

Input kettenis@, ok beck@

Revision 1.141 / (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.140: +2 -39 lines
Diff to previous 1.140 (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.140 / (download) - annotate - [select for diffs], Sun Jul 19 22:52:30 2015 UTC (8 years, 10 months ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.139: +3 -3 lines
Diff to previous 1.139 (colored)

Fix backward test that broke the cache

Revision 1.139 / (download) - annotate - [select for diffs], Sun Jul 19 21:21:14 2015 UTC (8 years, 10 months ago) by beck
Branch: MAIN
Changes since 1.138: +33 -27 lines
Diff to previous 1.138 (colored)

Change uvm_page[re]alloc_multi to actually use the flags passed in, and return
a value so that they may be called with UVM_PLA_NOWAIT
ok kettenis@

Revision 1.138 / (download) - annotate - [select for diffs], Thu Apr 23 09:56:23 2015 UTC (9 years, 1 month ago) by dlg
Branch: MAIN
Changes since 1.137: +1 -13 lines
Diff to previous 1.137 (colored)

tedu remnants of the previous attempt to implement page zeroing in
the idle thread.

ok deraadt@

Revision 1.137 / (download) - annotate - [select for diffs], Sat Mar 14 03:38:53 2015 UTC (9 years, 3 months ago) by jsg
Branch: MAIN
Changes since 1.136: +1 -2 lines
Diff to previous 1.136 (colored)

Remove some includes include-what-you-use claims don't
have any direct symbols used.  Tested for indirect use by compiling
amd64/i386/sparc64 kernels.

ok tedu@ deraadt@

Revision 1.136 / (download) - annotate - [select for diffs], Sat Feb 28 06:11:04 2015 UTC (9 years, 3 months ago) by mlarkin
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.135: +2 -2 lines
Diff to previous 1.135 (colored)


Typo in comment 'reseve' -> 'reserve'

Revision 1.135 / (download) - annotate - [select for diffs], Sun Feb 8 02:17:08 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.134: +4 -6 lines
Diff to previous 1.134 (colored)

Something is subtly wrong with this.  On ramdisks, processes run out of
mappable memory (direct or via execve), perhaps because of the address
allocator behind maps and the way wiring counts work?

Revision 1.134 / (download) - annotate - [select for diffs], Sat Feb 7 01:46:27 2015 UTC (9 years, 4 months ago) by kettenis
Branch: MAIN
Changes since 1.133: +1 -80 lines
Diff to previous 1.133 (colored)

Tedu the old idle page zeroing code.

ok tedu@, guenther@, miod@

Revision 1.133 / (download) - annotate - [select for diffs], Fri Feb 6 10:58:35 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.132: +6 -4 lines
Diff to previous 1.132 (colored)

Clear PQ_AOBJ before calling uvm_pagefree(), clearing up one false XXX
comment (one is fixed, one is deleted).
ok kettenis beck

Revision 1.132 / (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.131: +3 -3 lines
Diff to previous 1.131 (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.131 / (download) - annotate - [select for diffs], Fri Jul 11 16:35:40 2014 UTC (9 years, 11 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.130: +2 -7 lines
Diff to previous 1.130 (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.130 / (download) - annotate - [select for diffs], Sun Apr 13 23:14:15 2014 UTC (10 years, 2 months ago) by tedu
Branch: MAIN
Changes since 1.129: +19 -99 lines
Diff to previous 1.129 (colored)

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

Revision 1.129 / (download) - annotate - [select for diffs], Thu Jan 23 22:06:30 2014 UTC (10 years, 4 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.128: +1 -5 lines
Diff to previous 1.128 (colored)

unifdef -D__HAVE_VM_PAGE_MD - no functional change.

Revision 1.128 / (download) - annotate - [select for diffs], Tue Jul 9 15:37:43 2013 UTC (10 years, 11 months ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.127: +10 -18 lines
Diff to previous 1.127 (colored)

back out the cache flipper temporarily to work out of tree.
will come back soon.
ok deraadt@

Revision 1.127 / (download) - annotate - [select for diffs], Fri Jun 21 21:42:17 2013 UTC (10 years, 11 months ago) by kettenis
Branch: MAIN
Changes since 1.126: +4 -2 lines
Diff to previous 1.126 (colored)

Buffer cache pages are wired but not counted as such.  Therefore we have to
set the wire count on the pages to 0 before we call uvm_pagefree() on them,
just like we do in buf_free_pages().  Otherwise the wired pages counter goes
negative.  While there, also sprinkle some KASSERTs in there that
buf_free_pages() has as well.

ok beck@

Revision 1.126 / (download) - annotate - [select for diffs], Tue Jun 11 19:01:20 2013 UTC (11 years ago) by beck
Branch: MAIN
Changes since 1.125: +15 -9 lines
Diff to previous 1.125 (colored)

High memory page flipping for the buffer cache.

This change splits the buffer cache free lists into lists of dma reachable
buffers and high memory buffers based on the ranges returned by pmemrange.
Buffers move from dma to high memory as they age, but are flipped to dma
reachable memory if IO is needed to/from and high mem buffer. The total
amount of buffers  allocated is now bufcachepercent of both the dma and
the high memory region.

This change allows the use of large buffer caches on amd64 using more than
4 GB of memory

ok tedu@ krw@ - testing by many.

Revision 1.125 / (download) - annotate - [select for diffs], Thu May 30 16:29:46 2013 UTC (11 years ago) by tedu
Branch: MAIN
Changes since 1.124: +2 -20 lines
Diff to previous 1.124 (colored)

remove lots of comments about locking per beck's request

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

remove simple_locks from uvm code. ok beck deraadt

Revision 1.123 / (download) - annotate - [select for diffs], Wed Mar 27 02:02:23 2013 UTC (11 years, 2 months ago) by tedu
Branch: MAIN
Changes since 1.122: +9 -7 lines
Diff to previous 1.122 (colored)

combine several atomic_clearbits calls into one. slightly faster on
machines where atomic ops aren't so simple.
ok beck deraadt miod

Revision 1.122 / (download) - annotate - [select for diffs], Tue Mar 12 21:10:11 2013 UTC (11 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.121: +86 -76 lines
Diff to previous 1.121 (colored)

preserving main-branch topology for a perverse reason:
step 3 - re-merge 1.116 to 1.118

Revision 1.121 / (download) - annotate - [select for diffs], Tue Mar 12 21:08:04 2013 UTC (11 years, 3 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.120: +2 -2 lines
Diff to previous 1.120 (colored)

preserving main-branch topology for a perverse reason:
step 2 - re-merge 1.119 (the WAITOK diff)

Revision 1.120 / (download) - annotate - [select for diffs], Tue Mar 12 21:07:02 2013 UTC (11 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.119: +77 -87 lines
Diff to previous 1.119 (colored)

preserving main-branch topology for a perverse reason:
step 1 - backout 1.116 to 1.119

Revision 1.119 / (download) - annotate - [select for diffs], Tue Mar 12 20:47:16 2013 UTC (11 years, 3 months ago) by beck
Branch: MAIN
Changes since 1.118: +2 -2 lines
Diff to previous 1.118 (colored)

Fix horrible typo of mine checking for WAITOK flags, found by sthen.
This fix actually by mikeb@, this needs thorough testing to verify
it doesn't bring up other issues in what it hid.
ok deraadt@

Revision 1.118 / (download) - annotate - [select for diffs], Wed Mar 6 22:26:15 2013 UTC (11 years, 3 months ago) by beck
Branch: MAIN
Changes since 1.117: +4 -3 lines
Diff to previous 1.117 (colored)

Account for the size of the allocation when defending the pagedaemon reserve.
Spotted by oga@nicotinebsd.org, with help from dhill@. Fix by me.
ok miod@

Revision 1.117 / (download) - annotate - [select for diffs], Sun Mar 3 22:37:58 2013 UTC (11 years, 3 months ago) by miod
Branch: MAIN
Changes since 1.116: +81 -73 lines
Diff to previous 1.116 (colored)

Use local vm_physseg pointers instead of compting vm_physmem[index] gazillions
of times. No function change but makes the code a bit smaller.

ok mpi@

Revision 1.116 / (download) - annotate - [select for diffs], Sat Mar 2 23:07:55 2013 UTC (11 years, 3 months ago) by miod
Branch: MAIN
Changes since 1.115: +3 -2 lines
Diff to previous 1.115 (colored)

Simplify uvm_pagealloc() to only need one atomic operation on the page flags
instead of two, building upon the knowledge of the state uvm_pagealloc_pg()
leaves the uvm_page in.
ok mpi@

Revision 1.115 / (download) - annotate - [select for diffs], Thu Feb 7 17:38:12 2013 UTC (11 years, 4 months ago) by beck
Branch: MAIN
Changes since 1.114: +28 -2 lines
Diff to previous 1.114 (colored)

Bring back reserve enforcement and page daemon wakeup into uvm_pglistalloc,
It was removed as this function was redone to use pmemrange in mid 2010
with the result that kernel malloc and other users of this function can
consume the page daemon reserve and run us out of memory.
ok kettenis@

Revision 1.114 / (download) - annotate - [select for diffs], Fri Jul 8 00:10:59 2011 UTC (12 years, 11 months ago) by tedu
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.113: +34 -6 lines
Diff to previous 1.113 (colored)

some machines don't boot with the previous uvm reserve enforcement diff.
back it out.

Revision 1.113 / (download) - annotate - [select for diffs], Thu Jul 7 20:52:50 2011 UTC (12 years, 11 months ago) by oga
Branch: MAIN
Changes since 1.112: +6 -34 lines
Diff to previous 1.112 (colored)

Move the uvm reserve enforcement from uvm_pagealloc to pmemrange.

More and more things are allocating outside of uvm_pagealloc these days making
it easy for something like the buffer cache to eat your last page with no
repercussions (other than a hung machine, of course).

ok ariane@ also ok ariane@ again after I spotted and fixed a possible underflow
problem in the calculation.

Revision 1.112 / (download) - annotate - [select for diffs], Wed Jul 6 19:50:38 2011 UTC (12 years, 11 months ago) by beck
Branch: MAIN
Changes since 1.111: +37 -2 lines
Diff to previous 1.111 (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.111 / (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.110: +1 -31 lines
Diff to previous 1.110 (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.110 / (download) - annotate - [select for diffs], Thu Jun 23 21:55:58 2011 UTC (12 years, 11 months ago) by oga
Branch: MAIN
Changes since 1.109: +2 -2 lines
Diff to previous 1.109 (colored)

Check for the correct flag when checking to see if the page is part of an aobj.

This is no function change since aobjs never actually hit this path. (also it is
my bug from a while ago).

ok ariane@

Revision 1.109 / (download) - annotate - [select for diffs], Thu Jun 23 21:50:26 2011 UTC (12 years, 11 months ago) by oga
Branch: MAIN
Changes since 1.108: +76 -1 lines
Diff to previous 1.108 (colored)

Move uvm_pglistalloc and uvm_pglistfree to uvm_page.c and garbage
college uvm_pglist.c

uvm_pglistalloc and free are just thin wrappers around pmemrange these
days and don't really need their own file.

ok ariane@

Revision 1.108 / (download) - annotate - [select for diffs], Mon May 30 22:25:24 2011 UTC (13 years ago) by oga
Branch: MAIN
Changes since 1.107: +6 -28 lines
Diff to previous 1.107 (colored)

Remove the freelist member from vm_physseg

The new world order of pmemrange makes this data completely redundant
(being dealt with by the pmemrange constraints instead). Remove all code
that messes with the freelist.

While touching every caller of uvm_page_physload() anyway, add the flags
argument to all callers (all but one is 0 and that one already used
PHYSLOAD_DEVICE) and remove the macro magic to allow callers to continue
without it.

Should shrink the code a bit, as well.

matthew@ pointed out some mistakes i'd made.
``freelist death, I like. Ok.' ariane@
`I agree with the general direction, go ahead and i'll fix any fallout
shortly'' miod@ (68k 88k and vax i could not check would build)

Revision 1.107 / (download) - annotate - [select for diffs], Tue May 10 21:38:04 2011 UTC (13 years, 1 month ago) by oga
Branch: MAIN
Changes since 1.106: +1 -18 lines
Diff to previous 1.106 (colored)

Kill vm_page_lookup_freelist.

it belongs to a world order that isn't here anymore. More importantly it
has been unused for a fair while now.

ok thib@

Revision 1.106 / (download) - annotate - [select for diffs], Fri Apr 15 21:35:16 2011 UTC (13 years, 1 month ago) by oga
Branch: MAIN
Changes since 1.105: +5 -3 lines
Diff to previous 1.105 (colored)

Add a bit of paranoia to uvm_pageinsert.

At various times diffs have had debugging that checked that we don't
insert a page into the tree on top of an existing page, leaking that
page's references.  Until the recent hackathon (and introduction if
uvm_pagealloc_multi) the bufcache for example did a rb tree look up on
insert to check (under #ifdef DEBUG || 1) so instead just check it on
pageinsert every time, since RB_INSERT returns any duplicates so this
check is pretty much free.

``emphatically yes'' beck@

Revision 1.105 / (download) - annotate - [select for diffs], Sun Apr 3 12:36:08 2011 UTC (13 years, 2 months ago) by beck
Branch: MAIN
Changes since 1.104: +30 -30 lines
Diff to previous 1.104 (colored)

knf - trailing whitespace flense.
ok henning@

Revision 1.104 / (download) - annotate - [select for diffs], Sat Apr 2 16:47:17 2011 UTC (13 years, 2 months ago) by beck
Branch: MAIN
Changes since 1.103: +27 -1 lines
Diff to previous 1.103 (colored)

Constrain the buffer cache to use only the dma reachable region of memory.
With this change bufcachepercent will be the percentage of dma reachable
memory that the buffer cache will attempt to use.
ok deraadt@ thib@ oga@

Revision 1.103 / (download) - annotate - [select for diffs], Sat Apr 2 12:38:37 2011 UTC (13 years, 2 months ago) by ariane
Branch: MAIN
Changes since 1.102: +26 -1 lines
Diff to previous 1.102 (colored)

Count the number of physical pages within a memory range.
Bob needs this.

ok art@ bob@ thib@

Revision 1.102 / (download) - annotate - [select for diffs], Sat Aug 7 03:50:02 2010 UTC (13 years, 10 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.101: +2 -2 lines
Diff to previous 1.101 (colored)

No "\n" needed at the end of panic() strings.

Bogus chunks pointed out by matthew@ and miod@. No cookies for
marco@ and jasper@.

ok deraadt@ miod@ matthew@ jasper@ macro@

Revision 1.101 / (download) - annotate - [select for diffs], Sun Jun 27 03:03:49 2010 UTC (13 years, 11 months ago) by thib
Branch: MAIN
Changes since 1.100: +28 -13 lines
Diff to previous 1.100 (colored)

uvm constraints. Add two mandatory MD symbols, uvm_md_constraints
which contains the constraints for DMA/memory allocation for each
architecture, and dma_constraints which contains the range of addresses
that are dma accessable by the system.

This is based on ariane@'s physcontig diff, with lots of bugfixes and
additions the following additions by my self:

Introduce a new function pool_set_constraints() which sets the address
range for which we allocate pages for the pool from, this is now used
for the mbuf/mbuf cluster pools to keep them dma accessible.

The !direct archs no longer stuff pages into the kernel object in
uvm_km_getpage_pla but rather do a pmap_extract() in uvm_km_putpages.

Tested heavily by my self on i386, amd64 and sparc64. Some tests on
alpha and SGI.

"commit it" beck, art, oga, deraadt
"i like the diff" deraadt

Revision 1.100 / (download) - annotate - [select for diffs], Thu Apr 22 19:02:55 2010 UTC (14 years, 1 month ago) by oga
Branch: MAIN
Changes since 1.99: +52 -145 lines
Diff to previous 1.99 (colored)

Committing on behalf or ariane@.

recommit pmemrange:
        physmem allocator: change the view of free memory from single
        free pages to free ranges.  Classify memory based on region with
        associated use-counter (which is used to construct a priority
        list of where to allocate memory).

	Based on code from tedu@, help from many.

Useable now that bugs have been found and fixed in most architecture's
pmap.c

ok by everyone who has done a pmap or uvm commit in the last year.

Revision 1.99 / (download) - annotate - [select for diffs], Tue Apr 20 22:05:44 2010 UTC (14 years, 1 month ago) by tedu
Branch: MAIN
Changes since 1.98: +2 -1 lines
Diff to previous 1.98 (colored)

remove proc.h include from uvm_map.h.  This has far reaching effects, as
sysctl.h was reliant on this particular include, and many drivers included
sysctl.h unnecessarily.  remove sysctl.h or add proc.h as needed.
ok deraadt

Revision 1.98 / (download) - annotate - [select for diffs], Wed Mar 24 00:36:04 2010 UTC (14 years, 2 months ago) by oga
Branch: MAIN
Changes since 1.97: +34 -21 lines
Diff to previous 1.97 (colored)

Bring back PHYSLOAD_DEVICE for uvm_page_physload.

ok kettenis@ beck@ (tentatively) and ariane@. deraadt asked for it to be
commited now.

original commit message:

	extend uvm_page_physload to have the ability to add "device" pages to
	the system.

	This is needed in the case where you need managed pages so you can
	handle faulting and pmap_page_protect() on said pages when you manage
	memory in such regions (i'm looking at you, graphics cards).

	these pages are flagged PG_DEV, and shall never be on the freelists,
	assert this. behaviour remains unchanged in the non-device case,
	specifically for all archs currently in the tree we panic if called
	after bootstrap.

	ok art@ kettenis@, beck@

Revision 1.97 / (download) - annotate - [select for diffs], Wed Oct 14 17:53:30 2009 UTC (14 years, 8 months ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.96: +2 -2 lines
Diff to previous 1.96 (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.96 / (download) - annotate - [select for diffs], Thu Aug 13 15:29:59 2009 UTC (14 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.95: +6 -1 lines
Diff to previous 1.95 (colored)

PAGEFASTRECYCLE is an option we have been using for a while to encourage
the kernel to reuse freed pages as quickly as possible, and it has been
finding bugs (some of which we have already fixed)
ok kettenis

Revision 1.95 / (download) - annotate - [select for diffs], Thu Aug 6 15:28:14 2009 UTC (14 years, 10 months ago) by oga
Branch: MAIN
Changes since 1.94: +26 -150 lines
Diff to previous 1.94 (colored)

reintroduce the uvm_tree commit.

Now instead of the global object hashtable, we have a per object tree.

Testing shows no performance difference and a slight code shrink. OTOH when
locking is more fine grained this should be faster due to lock contention on
uvm.hashlock.

ok thib@, art@.

Revision 1.94 / (download) - annotate - [select for diffs], Sun Jul 26 21:26:10 2009 UTC (14 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.93: +1 -1 lines
Diff to previous 1.93 (colored)

stop trying to fast-recycle pages for now.  a few bugs have been found and
fixed, but now it is time for a little break from the chaos.
ok kettenis

Revision 1.93 / (download) - annotate - [select for diffs], Thu Jul 23 21:39:10 2009 UTC (14 years, 10 months ago) by kettenis
Branch: MAIN
Changes since 1.92: +2 -2 lines
Diff to previous 1.92 (colored)

Insert free pages at the head of the page queues.  Should provide better
cache locality and will pave the way for the new pmemrange allocator.
Based on hints from art@ and ariane@.

ok ariane@, deraadt@, oga@

Revision 1.92 / (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.91: +9 -2 lines
Diff to previous 1.91 (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.91 / (download) - annotate - [select for diffs], Wed Jun 17 00:13:59 2009 UTC (14 years, 11 months ago) by oga
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.90: +5 -7 lines
Diff to previous 1.90 (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.90 / (download) - annotate - [select for diffs], Tue Jun 16 16:42:41 2009 UTC (14 years, 11 months ago) by ariane
Branch: MAIN
Changes since 1.89: +125 -48 lines
Diff to previous 1.89 (colored)

Backout pmemrange (which to most people is more well known as physmem
allocator).

"i can't see any obvious problems" oga

Revision 1.89 / (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.88: +149 -32 lines
Diff to previous 1.88 (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.88 / (download) - annotate - [select for diffs], Sun Jun 14 03:04:08 2009 UTC (15 years ago) by deraadt
Branch: MAIN
Changes since 1.87: +18 -31 lines
Diff to previous 1.87 (colored)

backout:
> extend uvm_page_physload to have the ability to add "device" pages to the
> system.
since it was overlayed over a system that we warned would go "in to be
tested, but may be pulled out".  oga, you just made me spend 20 minutes
of time I should not have had to spend doing this.

Revision 1.87 / (download) - annotate - [select for diffs], Sun Jun 7 02:01:54 2009 UTC (15 years ago) by oga
Branch: MAIN
Changes since 1.86: +32 -19 lines
Diff to previous 1.86 (colored)

extend uvm_page_physload to have the ability to add "device" pages to the
system.

This is needed in the case where you need managed pages so you can
handle faulting and pmap_page_protect() on said pages when you manage
memory in such regions (i'm looking at you, graphics cards).

these pages are flagged PG_DEV, and shall never be on the freelists,
assert this. behaviour remains unchanged in the non-device case,
specifically for all archs currently in the tree we panic if called
after bootstrap.

ok art@, kettenis@, ariane@, beck@.

Revision 1.86 / (download) - annotate - [select for diffs], Sat Jun 6 17:46:44 2009 UTC (15 years ago) by art
Branch: MAIN
Changes since 1.85: +3 -1 lines
Diff to previous 1.85 (colored)

Since all callers of uvm_pagedeactivate did pmap_page_protect(.., VM_PROT_NONE)
just move that into uvm_pagedeactivate.

oga@ ok

Revision 1.85 / (download) - annotate - [select for diffs], Wed Jun 3 04:56:54 2009 UTC (15 years ago) by ariane
Branch: MAIN
Changes since 1.84: +4 -2 lines
Diff to previous 1.84 (colored)

phys allocator fix: zeroed pages are not clean.

Revision 1.84 / (download) - annotate - [select for diffs], Tue Jun 2 23:00:19 2009 UTC (15 years ago) by oga
Branch: MAIN
Changes since 1.83: +17 -145 lines
Diff to previous 1.83 (colored)

Instead of the global hash table with the terrible hashfunction and a
global lock, switch the uvm object pages to being kept in a per-object
RB_TREE. Right now this is approximately the same speed, but cleaner.
When biglock usage is reduced this will improve concurrency due to lock
contention..

ok beck@ art@. Thanks to jasper for the speed testing.

Revision 1.83 / (download) - annotate - [select for diffs], Tue Jun 2 19:49:08 2009 UTC (15 years ago) by ariane
Branch: MAIN
Changes since 1.82: +3 -3 lines
Diff to previous 1.82 (colored)

Clear PQ_ENCRYPT flag on uvm_pagefree, because free pages are by definition
not encrypted.

Revision 1.82 / (download) - annotate - [select for diffs], Mon Jun 1 19:54:02 2009 UTC (15 years ago) by oga
Branch: MAIN
Changes since 1.81: +9 -2 lines
Diff to previous 1.81 (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.81 / (download) - annotate - [select for diffs], Mon Jun 1 17:42:33 2009 UTC (15 years ago) by ariane
Branch: MAIN
Changes since 1.80: +48 -125 lines
Diff to previous 1.80 (colored)

physmem allocator: change the view of free memory from single free pages
to free ranges.
Classify memory based on region with associated use-counter (which is used
to construct a priority list of where to allocate memory).

Based on code from tedu@, help from many.
Ok art@

Revision 1.80 / (download) - annotate - [select for diffs], Fri May 8 15:10:35 2009 UTC (15 years, 1 month ago) by ariane
Branch: MAIN
Changes since 1.79: +4 -2 lines
Diff to previous 1.79 (colored)

Clear PQ_AOBJ at pageremove: when a page is no longer part of a uvm_object,
it is also not part of an aobj.
Clear anon flags at pagefree: page is no longer part of an anon.

ok oga

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

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

ok oga

Revision 1.78 / (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.77: +2 -2 lines
Diff to previous 1.77 (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.77 / (download) - annotate - [select for diffs], Fri May 1 20:44:22 2009 UTC (15 years, 1 month ago) by oga
Branch: MAIN
Changes since 1.76: +3 -4 lines
Diff to previous 1.76 (colored)

uvm_page_alloc() + memset -> uvm_page_zalloc()

nothing uses this code yet, but might as well do it the right way.

"if you can't live without commiting this." miod@

Revision 1.76 / (download) - annotate - [select for diffs], Tue Apr 28 16:06:07 2009 UTC (15 years, 1 month ago) by miod
Branch: MAIN
Changes since 1.75: +2 -2 lines
Diff to previous 1.75 (colored)

Revert pageqlock back from a mutex to a simple_lock, as it needs to be
recursive in some cases (mostly involving swapping). A proper fix is in
the works, but this will unbreak kernels for now.

Revision 1.75 / (download) - annotate - [select for diffs], Tue Apr 14 20:12:05 2009 UTC (15 years, 2 months ago) by oga
Branch: MAIN
Changes since 1.74: +1 -3 lines
Diff to previous 1.74 (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.74 / (download) - annotate - [select for diffs], Mon Apr 13 22:17:54 2009 UTC (15 years, 2 months ago) by oga
Branch: MAIN
Changes since 1.73: +2 -2 lines
Diff to previous 1.73 (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.73 / (download) - annotate - [select for diffs], Mon Apr 6 17:03:51 2009 UTC (15 years, 2 months ago) by oga
Branch: MAIN
Changes since 1.72: +4 -11 lines
Diff to previous 1.72 (colored)

In the case where VM_PHYSSEG_MAX == 1 make vm_physseg_find and
PHYS_TO_VM_PAGE inline again. This should stop function call overhead
killing the vax and other slow archs while keeping the benefit for the
faster platforms.

suggested by miod. ok miod@, toby@.

Revision 1.72 / (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.71: +2 -2 lines
Diff to previous 1.71 (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.71 / (download) - annotate - [select for diffs], Thu Mar 26 13:38:45 2009 UTC (15 years, 2 months ago) by oga
Branch: MAIN
Changes since 1.70: +26 -54 lines
Diff to previous 1.70 (colored)

Convert splvm() + simplelock(&uvm.hashlock); around the page hash table
into a IPL_VM blocking mutex, also slightly extend the locked area so
that it actually protects access to the page array (as the comment on
the lock declaration says it should).

ansify a few functions while i'm in the file.

"ok, even though you're sneaking in ansification in a diff. You dirty
you." art@

Revision 1.70 / (download) - annotate - [select for diffs], Wed Mar 25 20:00:18 2009 UTC (15 years, 2 months ago) by oga
Branch: MAIN
Changes since 1.69: +185 -2 lines
Diff to previous 1.69 (colored)

Move all of the pseudo-inline functions in uvm into C files.

By pseudo-inline, I mean that if a certain macro was defined, they would
be inlined. However, no architecture defines that, and none has for a
very very long time. Therefore mainly this just makes the code a damned
sight easier to read. Some k&r -> ansi declarations while I'm in there.

"just commit it" art@. ok weingart@.

Revision 1.69 / (download) - annotate - [select for diffs], Tue Mar 24 16:29:42 2009 UTC (15 years, 2 months ago) by oga
Branch: MAIN
Changes since 1.68: +94 -1 lines
Diff to previous 1.68 (colored)

vm_physseg_find and VM_PAGE_TO_PHYS are both called many times in your
average arch port. They are also inline. This does not help, de-inline them.

shaves about 1k on i386 and amd64 bsd.mp. Probably similar amounts of
most architectures.

"no issue" beck@ "Nuke nuke nuke... make them functions" weingart@ "this
is good" art@

Revision 1.68 / (download) - annotate - [select for diffs], Mon Mar 23 13:25:11 2009 UTC (15 years, 2 months ago) by art
Branch: MAIN
Changes since 1.67: +2 -2 lines
Diff to previous 1.67 (colored)

Processor affinity for processes.
 - Split up run queues so that every cpu has one.
 - Make setrunqueue choose the cpu where we want to make this process
   runnable (this should be refined and less brutal in the future).
 - When choosing the cpu where we want to run, make some kind of educated
   guess where it will be best to run (very naive right now).
Other:
 - Set operations for sets of cpus.
 - load average calculations per cpu.
 - sched_is_idle() -> curcpu_is_idle()

tested, debugged and prodded by many@

Revision 1.67 / (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_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.66: +8 -15 lines
Diff to previous 1.66 (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.66 / (download) - annotate - [select for diffs], Sat Apr 12 20:37:35 2008 UTC (16 years, 2 months ago) by miod
Branch: MAIN
Changes since 1.65: +4 -1 lines
Diff to previous 1.65 (colored)

Prune the in-use swap encryption keys in uvm_shutdown(), per deraadt@'s idea.

Revision 1.65 / (download) - annotate - [select for diffs], Wed Apr 9 16:58:11 2008 UTC (16 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.64: +6 -1 lines
Diff to previous 1.64 (colored)

Add new stub uvm_shutdown() and call it from the right place in MD boot()

Revision 1.64 / (download) - annotate - [select for diffs], Fri Jan 4 19:26:52 2008 UTC (16 years, 5 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.63: +2 -2 lines
Diff to previous 1.63 (colored)

Only compile in uvm_page_physdump() if option DDB as it's not directly callable
and supposed to be only used from within ddb.

Revision 1.63 / (download) - annotate - [select for diffs], Tue Dec 18 11:05:52 2007 UTC (16 years, 5 months ago) by thib
Branch: MAIN
Changes since 1.62: +17 -17 lines
Diff to previous 1.62 (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.62 / (download) - annotate - [select for diffs], Thu Nov 29 00:26:41 2007 UTC (16 years, 6 months ago) by tedu
Branch: MAIN
Changes since 1.61: +2 -2 lines
Diff to previous 1.61 (colored)

use a working mutex for the freepage list. ok art deraadt

Revision 1.61 / (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.60: +7 -5 lines
Diff to previous 1.60 (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.60 / (download) - annotate - [select for diffs], Fri May 18 14:41:55 2007 UTC (17 years ago) by art
Branch: MAIN
Changes since 1.59: +2 -2 lines
Diff to previous 1.59 (colored)

Instead of checking whichqs directly, add a "sched_is_idle()" macro to
sys/sched.h and use that to check if there's something to do.

kettenis@ thib@ ok

Revision 1.59 / (download) - annotate - [select for diffs], Fri Apr 13 18:57:49 2007 UTC (17 years, 2 months ago) by art
Branch: MAIN
Changes since 1.58: +20 -20 lines
Diff to previous 1.58 (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.58 / (download) - annotate - [select for diffs], Wed Apr 11 12:10:42 2007 UTC (17 years, 2 months ago) by art
Branch: MAIN
Changes since 1.57: +2 -3 lines
Diff to previous 1.57 (colored)

Instead of managing pages for intrsafe maps in special objects (aka.
kmem_object) just so that we can remove them, just use pmap_extract
to get the pages to free and simplify a lot of code to not deal with
the list of intrsafe maps, intrsafe objects, etc.

miod@ ok

Revision 1.57 / (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.56: +22 -25 lines
Diff to previous 1.56 (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.56 / (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.55: +8 -8 lines
Diff to previous 1.55 (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.55 / (download) - annotate - [select for diffs], Wed Jul 26 23:15:55 2006 UTC (17 years, 10 months ago) by mickey
Branch: MAIN
Changes since 1.54: +3 -3 lines
Diff to previous 1.54 (colored)

fix fmts for UVMHIST_LOG() entries making it more useful on 64bit archs; miod@ ok

Revision 1.54 / (download) - annotate - [select for diffs], Thu Jul 13 22:51:26 2006 UTC (17 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.53: +4 -6 lines
Diff to previous 1.53 (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.53 / (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.52: +7 -5 lines
Diff to previous 1.52 (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.52 / (download) - annotate - [select for diffs], Thu Apr 27 15:21:19 2006 UTC (18 years, 1 month ago) by mickey
Branch: MAIN
Changes since 1.51: +2 -2 lines
Diff to previous 1.51 (colored)

from PAE work:
as freepages being vconverted back to byte address make sure to
perform calculations in (upcoming) larger paddr_t to avoid losing
higher bits in calculation.

Revision 1.51 / (download) - annotate - [select for diffs], Mon Jan 16 13:11:05 2006 UTC (18 years, 4 months ago) by mickey
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.50: +32 -1 lines
Diff to previous 1.50 (colored)

add another uvm histroy for physpage alloc/free and propagate a debugging pgfree check into pglist; no functional change for normal kernels; make histories uncommon

Revision 1.50 / (download) - annotate - [select for diffs], Sun Dec 26 21:22:14 2004 UTC (19 years, 5 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.49: +2 -2 lines
Diff to previous 1.49 (colored)

Use list and queue macros where applicable to make the code easier to read;
no change in compiler assembly output.

Revision 1.6.4.11 / (download) - annotate - [select for diffs], Sat Jun 5 23:13:13 2004 UTC (20 years ago) by niklas
Branch: SMP
Changes since 1.6.4.10: +2 -1 lines
Diff to previous 1.6.4.10 (colored) to branchpoint 1.6 (colored) next main 1.7 (colored)

Merge with the trunk

Revision 1.49 / (download) - annotate - [select for diffs], Mon Feb 23 06:19:32 2004 UTC (20 years, 3 months ago) by drahn
Branch: MAIN
CVS Tags: SMP_SYNC_B, SMP_SYNC_A, OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.48: +2 -1 lines
Diff to previous 1.48 (colored)

sync of pmap_update() calls with NetBSD. pmap_update is defined away on
all architectures but arm, where it is needed.

Revision 1.38.2.7 / (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.38.2.6: +9 -5 lines
Diff to previous 1.38.2.6 (colored) to branchpoint 1.38 (colored) next main 1.39 (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.6.4.10 / (download) - annotate - [select for diffs], Sat Jun 7 11:09:09 2003 UTC (21 years ago) by ho
Branch: SMP
Changes since 1.6.4.9: +2 -2 lines
Diff to previous 1.6.4.9 (colored) to branchpoint 1.6 (colored)

Sync SMP branch to -current

Revision 1.48 / (download) - annotate - [select for diffs], Sun Jun 1 00:26:09 2003 UTC (21 years ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.47: +2 -2 lines
Diff to previous 1.47 (colored)

Typo in panic message.

Revision 1.38.2.6 / (download) - annotate - [select for diffs], Mon May 19 22:41:30 2003 UTC (21 years ago) by tedu
Branch: UBC
Changes since 1.38.2.5: +4 -4 lines
Diff to previous 1.38.2.5 (colored) to branchpoint 1.38 (colored)

sync

Revision 1.6.4.9 / (download) - annotate - [select for diffs], Tue May 13 19:36:58 2003 UTC (21 years, 1 month ago) by ho
Branch: SMP
Changes since 1.6.4.8: +5 -5 lines
Diff to previous 1.6.4.8 (colored) to branchpoint 1.6 (colored)

Sync the SMP branch to -current. This includes moving to ELF.

Revision 1.47 / (download) - annotate - [select for diffs], Sat Mar 29 01:13:57 2003 UTC (21 years, 2 months ago) by mickey
Branch: MAIN
CVS Tags: UBC_SYNC_A
Changes since 1.46: +5 -5 lines
Diff to previous 1.46 (colored)

ubchist is not a fully cooked kadaver and though use the other well formed pdhist one until ubc gaets back. art@ ok

Revision 1.6.4.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.6.4.7: +8 -5 lines
Diff to previous 1.6.4.7 (colored) to branchpoint 1.6 (colored)

Sync the SMP branch with 3.3

Revision 1.38.2.5 / (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.38.2.4: +50 -29 lines
Diff to previous 1.38.2.4 (colored) to branchpoint 1.38 (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.38.2.4 / (download) - annotate - [select for diffs], Tue Oct 29 00:36:50 2002 UTC (21 years, 7 months ago) by art
Branch: UBC
Changes since 1.38.2.3: +7 -6 lines
Diff to previous 1.38.2.3 (colored) to branchpoint 1.38 (colored)

sync to -current

Revision 1.46 / (download) - annotate - [select for diffs], Sat Oct 12 01:09:45 2002 UTC (21 years, 8 months ago) by krw
Branch: MAIN
CVS Tags: UBC_SYNC_B, OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.45: +3 -3 lines
Diff to previous 1.45 (colored)

Remove more '\n's from panic() statements. Both trailing and leading.

Diff generated by Chris Kuethe.

Revision 1.45 / (download) - annotate - [select for diffs], Thu Sep 12 12:56:16 2002 UTC (21 years, 9 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.44: +2 -2 lines
Diff to previous 1.44 (colored)

Change the PMAP_PAGEIDLEZERO api to take the struct vm_page instead of the pa.

Revision 1.44 / (download) - annotate - [select for diffs], Tue Sep 10 18:29:44 2002 UTC (21 years, 9 months ago) by art
Branch: MAIN
Changes since 1.43: +3 -3 lines
Diff to previous 1.43 (colored)

Change the pmap_zero_page and pmap_copy_page API to take the struct vm_page *
instead of the pa. Most callers already had it handy and those who didn't
only called it for managed pages and were outside time-critical code.

This will allow us to make those functions clean and fast on sparc and
sparc64 letting us to avoid unnecessary cache flushes.

deraadt@ miod@ drahn@ ok.

Revision 1.43 / (download) - annotate - [select for diffs], Tue Jun 11 09:45:16 2002 UTC (22 years ago) by art
Branch: MAIN
Changes since 1.42: +4 -1 lines
Diff to previous 1.42 (colored)

Allow MD code to define __HAVE_VM_PAGE_MD to add own members into struct vm_page.
From NetBSD.

Revision 1.38.2.3 / (download) - annotate - [select for diffs], Tue Jun 11 03:33:04 2002 UTC (22 years ago) by art
Branch: UBC
Changes since 1.38.2.2: +4 -4 lines
Diff to previous 1.38.2.2 (colored) to branchpoint 1.38 (colored)

Sync UBC branch to -current

Revision 1.6.4.7 / (download) - annotate - [select for diffs], Thu Mar 28 14:54:26 2002 UTC (22 years, 2 months ago) by niklas
Branch: SMP
Changes since 1.6.4.6: +4 -4 lines
Diff to previous 1.6.4.6 (colored) to branchpoint 1.6 (colored)

Merge in -current from roughly a week ago

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

First round of __P removal in sys

Revision 1.6.4.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.6.4.5: +155 -312 lines
Diff to previous 1.6.4.5 (colored) to branchpoint 1.6 (colored)

Merge in trunk

Revision 1.38.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.38.2.1: +95 -164 lines
Diff to previous 1.38.2.1 (colored) to branchpoint 1.38 (colored)

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

Revision 1.38.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.38: +9 -12 lines
Diff to previous 1.38 (colored)

Merge in -current, builds on i386, otherwise untested

Revision 1.41 / (download) - annotate - [select for diffs], Mon Jan 28 11:53:48 2002 UTC (22 years, 4 months ago) by art
Branch: MAIN
Changes since 1.40: +3 -3 lines
Diff to previous 1.40 (colored)

allocate vm pages with uvm_km_alloc (this code is ifdefed out anyway).

Revision 1.40 / (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.39: +12 -15 lines
Diff to previous 1.39 (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.39 / (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.38: +148 -306 lines
Diff to previous 1.38 (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.38 / (download) - annotate - [select for diffs], Thu Dec 6 12:43:20 2001 UTC (22 years, 6 months ago) by art
Branch: MAIN
CVS Tags: UBC_BASE
Branch point for: UBC
Changes since 1.37: +9 -5 lines
Diff to previous 1.37 (colored)

Keep track of how many pages a vnode hold with vhold and vholdrele
so that we can get back the old behavior where a vnode with cached data
is less likely to be recycled than a vnode without cached data.

XXX - This is a brute-force solution - we do it where uvmexp.vnodepages
 are changed, I am not really sure it is correct but people have been
 very happy with the diff so far and want this in the tree.

Revision 1.6.4.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.6.4.4: +297 -186 lines
Diff to previous 1.6.4.4 (colored) to branchpoint 1.6 (colored)

Merge in -current

Revision 1.37 / (download) - annotate - [select for diffs], Tue Dec 4 23:22:42 2001 UTC (22 years, 6 months ago) by art
Branch: MAIN
Changes since 1.36: +3 -3 lines
Diff to previous 1.36 (colored)

Yet another sync to NetBSD uvm.
Today we add a pmap argument to pmap_update() and allocate map entries for
kernel_map from kmem_map instead of using the static entries. This should
get rid of MAX_KMAPENT panics. Also some uvm_loan problems are fixed.

Revision 1.36 / (download) - annotate - [select for diffs], Fri Nov 30 17:24:19 2001 UTC (22 years, 6 months ago) by art
Branch: MAIN
Changes since 1.35: +1 -44 lines
Diff to previous 1.35 (colored)

Kill uvm_pagealloc_contig. The two drivers that still used it should have
been converted to bus_dma ages ago, but since noone haven't bothered to do that
I haven't bothered to do more than to test that the kernel still builds
with those changes.

Revision 1.35 / (download) - annotate - [select for diffs], Wed Nov 28 19:28:15 2001 UTC (22 years, 6 months ago) by art
Branch: MAIN
Changes since 1.34: +278 -120 lines
Diff to previous 1.34 (colored)

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

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

more sync to netbsd. some bugfixes in uvm_km_kmemalloc, lots of fixes in uvm_loan.

Revision 1.33 / (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.32: +2 -2 lines
Diff to previous 1.32 (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.32 / (download) - annotate - [select for diffs], Tue Nov 27 05:27:12 2001 UTC (22 years, 6 months ago) by art
Branch: MAIN
Changes since 1.31: +1 -7 lines
Diff to previous 1.31 (colored)

Merge in the unified buffer cache code as found in NetBSD 2001/03/10. The
code is written mostly by Chuck Silvers <chuq@chuq.com>/<chs@netbsd.org>.

Tested for the past few weeks by many developers, should be in a pretty stable
state, but will require optimizations and additional cleanups.

Revision 1.6.4.4 / (download) - annotate - [select for diffs], Tue Nov 13 23:02:31 2001 UTC (22 years, 7 months ago) by niklas
Branch: SMP
Changes since 1.6.4.3: +149 -85 lines
Diff to previous 1.6.4.3 (colored) to branchpoint 1.6 (colored)

merge in -current

Revision 1.31 / (download) - annotate - [select for diffs], Mon Nov 12 01:26:09 2001 UTC (22 years, 7 months ago) by art
Branch: MAIN
Changes since 1.30: +39 -38 lines
Diff to previous 1.30 (colored)

Bring in more changes from NetBSD. Mostly pagedaemon improvements.

Revision 1.30 / (download) - annotate - [select for diffs], Sat Nov 10 18:42:31 2001 UTC (22 years, 7 months ago) by art
Branch: MAIN
Changes since 1.29: +107 -56 lines
Diff to previous 1.29 (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.29 / (download) - annotate - [select for diffs], Wed Nov 7 02:55:50 2001 UTC (22 years, 7 months ago) by art
Branch: MAIN
Changes since 1.28: +23 -8 lines
Diff to previous 1.28 (colored)

Another sync of uvm to NetBSD. Just minor fiddling, no major changes.

Revision 1.28 / (download) - annotate - [select for diffs], Wed Nov 7 01:18:01 2001 UTC (22 years, 7 months ago) by art
Branch: MAIN
Changes since 1.27: +2 -2 lines
Diff to previous 1.27 (colored)

Add an alignment argument to uvm_map that specifies an alignment hint
for the virtual address.

Revision 1.27 / (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.26: +4 -4 lines
Diff to previous 1.26 (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.26 / (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.25: +2 -4 lines
Diff to previous 1.25 (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.25 / (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.24: +2 -3 lines
Diff to previous 1.24 (colored)

Minor sync to NetBSD.

Revision 1.6.4.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.6.4.2: +211 -50 lines
Diff to previous 1.6.4.2 (colored) to branchpoint 1.6 (colored)

Sync the SMP branch to something just after 3.0

Revision 1.24 / (download) - annotate - [select for diffs], Wed Sep 19 20:50:59 2001 UTC (22 years, 8 months ago) by mickey
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.23: +1 -2 lines
Diff to previous 1.23 (colored)

merge vm/vm_kern.h into uvm/uvm_extern.h; art@ ok

Revision 1.23 / (download) - annotate - [select for diffs], Sat Aug 25 12:13:27 2001 UTC (22 years, 9 months ago) by art
Branch: MAIN
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored)

Default to disabled zeroing of pages in the idle loop.

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

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

Revision 1.21 / (download) - annotate - [select for diffs], Mon Aug 6 14:03:05 2001 UTC (22 years, 10 months ago) by art
Branch: MAIN
Changes since 1.20: +4 -4 lines
Diff to previous 1.20 (colored)

Add a new type voff_t (right now it's typedefed as off_t) used for offsets
into objects.

Gives the possibilty to mmap beyond the size of vaddr_t.

From NetBSD.

Revision 1.20 / (download) - annotate - [select for diffs], Tue Jul 31 14:03:47 2001 UTC (22 years, 10 months ago) by art
Branch: MAIN
Changes since 1.19: +15 -9 lines
Diff to previous 1.19 (colored)

Allocate page buckets from kernel_map. This should save a good
amount of kmem_map on machines with lots of physical memory.

Revision 1.19 / (download) - annotate - [select for diffs], Wed Jul 25 14:47:59 2001 UTC (22 years, 10 months ago) by art
Branch: MAIN
Changes since 1.18: +32 -9 lines
Diff to previous 1.18 (colored)

Some updates to UVM from NetBSD. Nothing really critical, just a sync.

Revision 1.18 / (download) - annotate - [select for diffs], Thu Jul 19 14:31:32 2001 UTC (22 years, 10 months ago) by art
Branch: MAIN
Changes since 1.17: +1 -7 lines
Diff to previous 1.17 (colored)

Missed one in PMAP_NEW fix.

Revision 1.17 / (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.16: +2 -10 lines
Diff to previous 1.16 (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.6.4.2 / (download) - annotate - [select for diffs], Mon May 14 22:47:47 2001 UTC (23 years, 1 month ago) by niklas
Branch: SMP
Changes since 1.6.4.1: +25 -20 lines
Diff to previous 1.6.4.1 (colored) to branchpoint 1.6 (colored)

merge in approximately 2.9 into SMP branch

Revision 1.16 / (download) - annotate - [select for diffs], Tue Apr 10 06:59:12 2001 UTC (23 years, 2 months ago) by niklas
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.15: +3 -2 lines
Diff to previous 1.15 (colored)

Fix for machines which need to enlarge the kernel address space, at least
1GB i386 machines needs this.  The fix is heavily based on Jason Thorpe's
found in NetBSD.  Here is his original commit message:

Instead of checking vm_physmem[<physseg>].pgs to determine if
uvm_page_init() has completed, add a boolean uvm.page_init_done,
and test against that.  Use this same boolean (rather than
pmap_initialized) in pmap_growkernel() to determine if we are
being called via uvm_page_init() to grow the kernel address space.

This fixes a problem on some i386 configurations where pmap_init()
itself was needing to have the kernel page table grown, and since
pmap_initialized was not yet set to TRUE, pmap_growkernel() was
choosing the wrong code path.

Revision 1.15 / (download) - annotate - [select for diffs], Thu Mar 22 18:05:33 2001 UTC (23 years, 2 months ago) by niklas
Branch: MAIN
Changes since 1.14: +6 -6 lines
Diff to previous 1.14 (colored)

pastos in diagnostic strings

Revision 1.14 / (download) - annotate - [select for diffs], Thu Mar 22 03:05:56 2001 UTC (23 years, 2 months ago) by smart
Branch: MAIN
Changes since 1.13: +6 -6 lines
Diff to previous 1.13 (colored)

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

Revision 1.13 / (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.12: +3 -3 lines
Diff to previous 1.12 (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.12 / (download) - annotate - [select for diffs], Sat Mar 3 12:28:55 2001 UTC (23 years, 3 months ago) by art
Branch: MAIN
Changes since 1.11: +3 -2 lines
Diff to previous 1.11 (colored)

Allow the syncer to get pages from the pagedaemon reserve.
Otherwise we can end up in a situation where the syncer waits for pages
and the pagedaemon waits for buffers.

Revision 1.11 / (download) - annotate - [select for diffs], Fri Mar 2 09:07:39 2001 UTC (23 years, 3 months ago) by art
Branch: MAIN
Changes since 1.10: +3 -3 lines
Diff to previous 1.10 (colored)

Reserve more pages for the pagedaemon and the kernel.
With soft updates, writing out pages to disk can cause a bunch of allocations.

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

$OpenBSD$

Revision 1.9 / (download) - annotate - [select for diffs], Thu Sep 7 20:15:28 2000 UTC (23 years, 9 months ago) by art
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

Convert bzero to memset(X, 0..) and bcopy to memcpy.
This is to match (make diffs smaller) the code in NetBSD.
new gcc inlines those functions, so this could also be a performance win.

Revision 1.8 / (download) - annotate - [select for diffs], Tue Apr 25 23:10:30 2000 UTC (24 years, 1 month ago) by niklas
Branch: MAIN
CVS Tags: OPENBSD_2_7_BASE, OPENBSD_2_7
Changes since 1.7: +4 -2 lines
Diff to previous 1.7 (colored)

A fix to the dreaded isadmaattach panic which hunts people playing with
large memory machines.  This time I really hope we can continue quite a bit
away over the Gig.

Revision 1.6.4.1 / (download) - annotate - [select for diffs], Fri Mar 24 09:09:50 2000 UTC (24 years, 2 months ago) by niklas
Branch: SMP
Changes since 1.6: +7 -13 lines
Diff to previous 1.6 (colored)

Sync with -current

Revision 1.7 / (download) - annotate - [select for diffs], Thu Mar 16 22:11:04 2000 UTC (24 years, 3 months ago) by art
Branch: MAIN
Changes since 1.6: +7 -13 lines
Diff to previous 1.6 (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.6 / (download) - annotate - [select for diffs], Fri Sep 10 16:59:14 1999 UTC (24 years, 9 months ago) by mickey
Branch: MAIN
CVS Tags: kame_19991208, SMP_BASE, OPENBSD_2_6_BASE, OPENBSD_2_6
Branch point for: SMP
Changes since 1.5: +8 -5 lines
Diff to previous 1.5 (colored)

fixup the uvm_map() call in the uvm_pagealloc_contig() w/
right uvm_map flags values, also fix the error ondition check.
couple of spaces vs tabs in the same code spot.
art@ ok

Revision 1.5 / (download) - annotate - [select for diffs], Fri Sep 3 18:02:22 1999 UTC (24 years, 9 months ago) by art
Branch: MAIN
Changes since 1.4: +9 -3 lines
Diff to previous 1.4 (colored)

Change the pmap_enter api to pass down an argument that indicates
the access type that caused this mapping. This is to simplify pmaps
with mod/ref emulation (none for the moment) and in some cases speed
up pmap_is_{referenced,modified}.
At the same time, clean up some mappings that had too high protection.

XXX - the access type is incorrect in old vm, it's only used by uvm and MD code.
The actual use of this in pmap_enter implementations is not in this commit.

Revision 1.4 / (download) - annotate - [select for diffs], Mon Aug 23 08:13:24 1999 UTC (24 years, 9 months ago) by art
Branch: MAIN
Changes since 1.3: +29 -14 lines
Diff to previous 1.3 (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.3 / (download) - annotate - [select for diffs], Fri Jul 23 14:47:06 1999 UTC (24 years, 10 months ago) by ho
Branch: MAIN
Changes since 1.2: +46 -1 lines
Diff to previous 1.2 (colored)

Add uvm_pagealloc_contig

Revision 1.2 / (download) - annotate - [select for diffs], Fri Feb 26 05:32:07 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:16 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.