OpenBSD CVS

CVS log for src/sys/uvm/uvmexp.h


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

Request diff between arbitrary revisions


Default branch: MAIN


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

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

Revision 1.13 / (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.12: +4 -4 lines
Diff to previous 1.12 (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.12 / (download) - annotate - [select for diffs], Sun Mar 24 10:29:35 2024 UTC (2 months, 2 weeks ago) by mpi
Branch: MAIN
Changes since 1.11: +32 -30 lines
Diff to previous 1.11 (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.11 / (download) - annotate - [select for diffs], Fri Oct 27 19:18:53 2023 UTC (7 months, 2 weeks ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (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.10 / (download) - annotate - [select for diffs], Mon Aug 29 11:09:31 2022 UTC (21 months, 1 week ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.9: +6 -5 lines
Diff to previous 1.9 (colored)

Use a rwlock and a mutex to serialize access to global swap variables.

Adapted from NetBSD by tb@.

ok tb@, kn@

Revision 1.9 / (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_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.8: +3 -2 lines
Diff to previous 1.8 (colored)

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

ok kettenis@

Revision 1.8 / (download) - annotate - [select for diffs], Mon Dec 28 14:01:23 2020 UTC (3 years, 5 months ago) by mpi
Branch: MAIN
Changes since 1.7: +38 -1 lines
Diff to previous 1.7 (colored)

Use per-CPU counters for fault and stats counters reached in uvm_fault().

ok kettenis@, dlg@

Revision 1.7 / (download) - annotate - [select for diffs], Mon Dec 14 13:29:18 2020 UTC (3 years, 5 months ago) by mpi
Branch: MAIN
Changes since 1.6: +4 -3 lines
Diff to previous 1.6 (colored)

Grab the KERNEL_LOCK() or ensure it's held when poking at swap data structures.

This will allow uvm_fault_upper() to enter swap-related functions without
holding the KERNEL_LOCK().

ok jmatthew@

Revision 1.6 / (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.5: +10 -6 lines
Diff to previous 1.5 (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.5 / (download) - annotate - [select for diffs], Thu Apr 23 07:57:27 2020 UTC (4 years, 1 month ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored)

Document uvmexp.nswget without relying on implementation details.

Prompted by a question from schwarze@

ok deraadt@, schwarze@, visa@

Revision 1.4 / (download) - annotate - [select for diffs], Tue Nov 6 07:49:38 2018 UTC (5 years, 7 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.3: +4 -2 lines
Diff to previous 1.3 (colored)

new sysctl for userland malloc flags, kernel part. ok millert@ deraadt@

Revision 1.3 / (download) - annotate - [select for diffs], Tue Jun 19 22:35:07 2018 UTC (5 years, 11 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.2: +13 -14 lines
Diff to previous 1.2 (colored)

Rename some unused fields in struct uvmexp to
unusedNN.

Missing man page bits pointed out by
jmc@. Ports source scan by sthen@.

ok deraadt@ guenther@

Revision 1.2 / (download) - annotate - [select for diffs], Sun May 8 11:52:32 2016 UTC (8 years, 1 month ago) by stefan
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, OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.1: +2 -1 lines
Diff to previous 1.1 (colored)

Wait for RAM in uvm_fault when allocating uvm structures fails

Only fail hard when running out of swap space also, as suggested by
kettenis@

While there, let amap_add() return a success status and handle
amap_add() errors in uvm_fault() similar to other out of RAM situations.
These bits are needed for further amap reorganization diffs.

lots of feedback and ok kettenis@

Revision 1.1 / (download) - annotate - [select for diffs], Tue Jul 8 17:19:26 2014 UTC (9 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6

decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.h
don't need to be married.
ok guenther miod beck jsing kettenis

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.