OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.66 / (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.65: +168 -1 lines
Diff to previous 1.65 (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.65 / (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.64: +0 -153 lines
Diff to previous 1.64 (colored)

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

Revision 1.64 / (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.63: +154 -1 lines
Diff to previous 1.63 (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.63 / (download) - annotate - [select for diffs], Mon Apr 10 04:21:20 2023 UTC (14 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4
Changes since 1.62: +3 -3 lines
Diff to previous 1.62 (colored)

spelling

Revision 1.62 / (download) - annotate - [select for diffs], Thu Jun 2 18:00:53 2022 UTC (2 years ago) by kettenis
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.61: +2 -2 lines
Diff to previous 1.61 (colored)

Take the size of allocation into account when checking the kernel reserve.

ok mpi@

Revision 1.61 / (download) - annotate - [select for diffs], Fri Mar 12 14:15:49 2021 UTC (3 years, 3 months ago) by jsg
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.60: +5 -5 lines
Diff to previous 1.60 (colored)

spelling

ok mpi@

Revision 1.60 / (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.59: +36 -1 lines
Diff to previous 1.59 (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.59 / (download) - annotate - [select for diffs], Tue Feb 18 12:13:40 2020 UTC (4 years, 3 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.58: +2 -2 lines
Diff to previous 1.58 (colored)

Cleanup <sys/kthread.h> and <sys/proc.h> includes.

Do not include <sys/kthread.h> where it is not needed and stop including
<sys/proc.h> in it.

ok visa@, anton@

Revision 1.58 / (download) - annotate - [select for diffs], Wed Jan 1 01:50:00 2020 UTC (4 years, 5 months ago) by beck
Branch: MAIN
Changes since 1.57: +135 -6 lines
Diff to previous 1.57 (colored)

Add uvm_pmr_remove_1strange_reverse to efficiently free pages
in reverse order from uvm.  Use it in uvm_pmr_freepageq when the
pages appear to be in reverse order.

This greatly improves cases of massive page freeing as noticed by
mlarkin@ in his ongoing efforts to have the most gigantish buffer
cache on the planet.

Most of this work done by me with help and polish from kettenis@
at e2k19.  Follow on commits to this will make use of this for
more efficient freeing of amaps and a few other things.

ok kettenis@ deraadt@

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

convert infinite msleep(9) to msleep_nsec(9)

ok mpi@

Revision 1.56 / (download) - annotate - [select for diffs], Sun Dec 8 12:37:45 2019 UTC (4 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.55: +2 -2 lines
Diff to previous 1.55 (colored)

Convert infinite sleeps to {m,t}sleep_nsec(9).

ok visa@, jca@

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

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

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

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

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

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

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

Partly inspired by FreeBSD r247787.

positive feedback from deraadt@, ok mpi@

Revision 1.54 / (download) - annotate - [select for diffs], Thu May 9 20:36:44 2019 UTC (5 years, 1 month ago) by beck
Branch: MAIN
Changes since 1.53: +14 -3 lines
Diff to previous 1.53 (colored)

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

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

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

ok kettenis@

Revision 1.53 / (download) - annotate - [select for diffs], Fri Sep 16 02:52:24 2016 UTC (7 years, 8 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.52: +11 -11 lines
Diff to previous 1.52 (colored)

fix some DEBUG code so its using the right rb tree code

Revision 1.52 / (download) - annotate - [select for diffs], Fri Sep 16 02:47:09 2016 UTC (7 years, 8 months ago) by dlg
Branch: MAIN
Changes since 1.51: +13 -11 lines
Diff to previous 1.51 (colored)

move uvm_pmemrange_addr from RB macros to RBT functions

Revision 1.51 / (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.50: +39 -41 lines
Diff to previous 1.50 (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.50 / (download) - annotate - [select for diffs], Fri Jan 29 11:50:40 2016 UTC (8 years, 4 months ago) by tb
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.49: +2 -2 lines
Diff to previous 1.49 (colored)

Therefor -> Therefore (where appropriate)

from ray@, ok jmc@

Revision 1.49 / (download) - annotate - [select for diffs], Sun Dec 6 10:42:43 2015 UTC (8 years, 6 months ago) by blambert
Branch: MAIN
Changes since 1.48: +3 -1 lines
Diff to previous 1.48 (colored)


Since the page zeroing thread runs without the kernel lock,
it relies upon the fpageq lock for data consistency and
sleep/wakeup interlocking.

Therefore, code which modifies page zeroing thread data
or performs a wakeup of the thread must also hold the
fpageq lock.

Fix an instance where this was not the case.

ok kettenis@
diff --git a/sys/uvm/uvm_pmemrange.c b/sys/uvm/uvm_pmemrange.c

Revision 1.48 / (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.47: +1 -3 lines
Diff to previous 1.47 (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.47 / (download) - annotate - [select for diffs], Wed Aug 19 12:24:30 2015 UTC (8 years, 9 months ago) by visa
Branch: MAIN
Changes since 1.46: +2 -2 lines
Diff to previous 1.46 (colored)

Make uvm_pmr_isfree() work correctly when RB_NFIND() returns
an exact match.

ok kettenis@

Revision 1.46 / (download) - annotate - [select for diffs], Sat Jun 27 21:25:55 2015 UTC (8 years, 11 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.45: +3 -3 lines
Diff to previous 1.45 (colored)

uvm_pmr_get1page() should return psize_t, not int; dhill@

Revision 1.45 / (download) - annotate - [select for diffs], Sat Jun 20 20:20:08 2015 UTC (8 years, 11 months ago) by kettenis
Branch: MAIN
Changes since 1.44: +28 -4 lines
Diff to previous 1.44 (colored)

Fix a bug that causes uvm_pmr_get1page() to fail for allocations that
specify an address constraint even when free pages that meet the constraint
are still available.  This happens because the old code was using the root
of the size tree as a starting point for a search down the address tree.
This meant only part of the address tree was searched, and that part could
very well not contain any of the pages that met the constraint.  Instead,
always walk the address tree from its root if the list of single pages is
empty and the root of the size tree doesn't meet our constraints.

From Visa Hankala.

ok deraadt@

Revision 1.44 / (download) - annotate - [select for diffs], Thu Nov 13 00:47:44 2014 UTC (9 years, 7 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.43: +2 -2 lines
Diff to previous 1.43 (colored)

bzero -> memset

Revision 1.43 / (download) - annotate - [select for diffs], Fri Oct 3 22:25:58 2014 UTC (9 years, 8 months ago) by guenther
Branch: MAIN
Changes since 1.42: +2 -1 lines
Diff to previous 1.42 (colored)

Initialize uvm_pagezero_thread()'s page list variable.

ok krw@ sthen@

Revision 1.42 / (download) - annotate - [select for diffs], Fri Oct 3 18:06:47 2014 UTC (9 years, 8 months ago) by kettenis
Branch: MAIN
Changes since 1.41: +50 -4 lines
Diff to previous 1.41 (colored)

Introduce a thread for zeroing pages without holding the kernel lock.  This
way we can do some useful kernel lock in parallel with other things and create
a reservoir of zeroed pages ready for use elsewhere.  This should reduce
latency.  The thread runs at the absolutel lowest priority such that we don't
keep other kernel threads or userland from doing useful work.

Can be easily disabled by disabling the kthread_create(9) call in main().
Which perhaps we should do for non-MP kernels.

ok deraadt@, tedu@

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

remove uneeded proc.h includes
ok mpi@ kspillner@

Revision 1.40 / (download) - annotate - [select for diffs], Sun Apr 13 23:14:15 2014 UTC (10 years, 2 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.39: +10 -31 lines
Diff to previous 1.39 (colored)

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

Revision 1.39 / (download) - annotate - [select for diffs], Sat Apr 5 17:18:00 2014 UTC (10 years, 2 months ago) by miod
Branch: MAIN
Changes since 1.38: +6 -3 lines
Diff to previous 1.38 (colored)

Fix logic error and prevent theoretical infinite loop in the worst case scenario
in uvm_pmr_rootupdate(). Issue spotted and fix provided by Kieran Devlin.

Revision 1.38 / (download) - annotate - [select for diffs], Fri Mar 21 21:39:36 2014 UTC (10 years, 2 months ago) by miod
Branch: MAIN
Changes since 1.37: +3 -5 lines
Diff to previous 1.37 (colored)

Allow for two more pmap-specific bits in vm_page pg_flags. Define
PG_PMAPMASK as all the possible pmap-specific bits (similar to the other
PG_fooMASK) to make sure MI code does not need to be updated, the next time
more bits are allocated to greedy pmaps.

No functional change, soon to be used by the (greedy) mips64 pmap.

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

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

Revision 1.36 / (download) - annotate - [select for diffs], Tue Jan 29 19:55:48 2013 UTC (11 years, 4 months ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.35: +9 -8 lines
Diff to previous 1.35 (colored)

7 &&'ed elements in a single KASSERT involving complex tests is just painful
when you hit it. Separate out these tests.
ok millert@ kettenis@, phessler@, with miod@ bikeshedding.

Revision 1.35 / (download) - annotate - [select for diffs], Mon Jan 21 18:25:27 2013 UTC (11 years, 4 months ago) by beck
Branch: MAIN
Changes since 1.34: +10 -4 lines
Diff to previous 1.34 (colored)

Stop hiding when this is failing - make this as obvious as it is
when uvm_wait gets hit from the pagedaemon. - code copied from uvm_wait.
ok guenther@, kettenis@

Revision 1.34 / (download) - annotate - [select for diffs], Thu Jan 5 17:49:45 2012 UTC (12 years, 5 months ago) by ariane
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.33: +6 -6 lines
Diff to previous 1.33 (colored)

Prevent integer wrap-around in pmemrange.

Found by and original fix from Geoff Steckel.
While here, switch the assert that prevents this from happening from DEBUG to DIAGNOSTIC.

ok thib@, miod@

Revision 1.33 / (download) - annotate - [select for diffs], Sat Dec 3 20:07:06 2011 UTC (12 years, 6 months ago) by miod
Branch: MAIN
Changes since 1.32: +5 -5 lines
Diff to previous 1.32 (colored)

Be sure not to access the vm_page array out of bounds in uvm_pmr_freepages().
Among other things, this fixes early panics on hppa system which memory size
is exactly 128MB.

Found the hard way and reported by fries@, not reported by beck@

Revision 1.32 / (download) - annotate - [select for diffs], Fri Jul 8 18:25:56 2011 UTC (12 years, 11 months ago) by ariane
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.31: +1 -47 lines
Diff to previous 1.31 (colored)

Move uvm_pmr_alloc_pig to kern/subr_hibernate.c

No callers, no functional change.

Revision 1.31 / (download) - annotate - [select for diffs], Fri Jul 8 18:20:10 2011 UTC (12 years, 11 months ago) by ariane
Branch: MAIN
Changes since 1.30: +1 -39 lines
Diff to previous 1.30 (colored)

Move uvm_pmr_zero_everything() to subr_hibernate.

This function will probably die before ever being called
from the in-tree code, since hibernate will move to RLE encoding.

No functional change, function had no callers.

Revision 1.30 / (download) - annotate - [select for diffs], Fri Jul 8 18:15:44 2011 UTC (12 years, 11 months ago) by ariane
Branch: MAIN
Changes since 1.29: +1 -20 lines
Diff to previous 1.29 (colored)

Expose pmemrange internal functions via pmemrange.h.
This is so I can move the pig allocator to subr_hibernate.

No functional change.

Revision 1.29 / (download) - annotate - [select for diffs], Fri Jul 8 00:10:59 2011 UTC (12 years, 11 months ago) by tedu
Branch: MAIN
Changes since 1.28: +1 -37 lines
Diff to previous 1.28 (colored)

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

Revision 1.28 / (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.27: +37 -1 lines
Diff to previous 1.27 (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.27 / (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.26: +99 -8 lines
Diff to previous 1.26 (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.26 / (download) - annotate - [select for diffs], Tue Jul 5 19:48:02 2011 UTC (12 years, 11 months ago) by ariane
Branch: MAIN
Changes since 1.25: +4 -6 lines
Diff to previous 1.25 (colored)

Don't derefence the item past the end of the array to figure out if
the extraction loop should stop.
No more 298 pages in 42 segments when asking for only 32 pages in 1 segment.

ok oga@

Revision 1.25 / (download) - annotate - [select for diffs], Wed Jun 22 00:16:47 2011 UTC (12 years, 11 months ago) by ariane
Branch: MAIN
Changes since 1.24: +39 -1 lines
Diff to previous 1.24 (colored)

Validate pmemrange result, enabling early catching of bugs in the code.

ok beck@

Revision 1.24 / (download) - annotate - [select for diffs], Mon May 30 21:25:08 2011 UTC (13 years ago) by oga
Branch: MAIN
Changes since 1.23: +3 -2 lines
Diff to previous 1.23 (colored)

for (some; stuff; here)
	;

instead of
for (some; stuff; here);

reads easier.

ok ariane@

Revision 1.23 / (download) - annotate - [select for diffs], Mon May 30 21:23:36 2011 UTC (13 years ago) by oga
Branch: MAIN
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored)

s/hart/heart/ to make more sense (another dutchism).

ok ariane@

Revision 1.22 / (download) - annotate - [select for diffs], Wed Apr 6 12:31:10 2011 UTC (13 years, 2 months ago) by mlarkin
Branch: MAIN
Changes since 1.21: +3 -1 lines
Diff to previous 1.21 (colored)

fix uvm_pmr_alloc_pig to return the proper pig range size
ok ariane

Revision 1.21 / (download) - annotate - [select for diffs], Tue Apr 5 22:33:51 2011 UTC (13 years, 2 months ago) by ariane
Branch: MAIN
Changes since 1.20: +3 -3 lines
Diff to previous 1.20 (colored)

Test iterated variable instead of a temporary variable from the previous
code block (not 'high_next' but 'low').
While here, change the KASSERT to a KDASSERT.

Pointed out by Amit Kulkarni.

ok thib@, miod@

Revision 1.20 / (download) - annotate - [select for diffs], Mon Apr 4 22:58:48 2011 UTC (13 years, 2 months ago) by ariane
Branch: MAIN
Changes since 1.19: +1 -11 lines
Diff to previous 1.19 (colored)

Remove debug code.

Pointed out and ok mlarkin@

Revision 1.19 / (download) - annotate - [select for diffs], Sun Apr 3 22:07:37 2011 UTC (13 years, 2 months ago) by ariane
Branch: MAIN
Changes since 1.18: +93 -1 lines
Diff to previous 1.18 (colored)

Helper functions for suspend.

Allow reclaiming pages from all pools.
Allow zeroing all pages.
Allocate the more equal pig.

mlarking@ needs this.
Not called yet.

ok mlarkin@, theo@

Revision 1.18 / (download) - annotate - [select for diffs], Sat Aug 28 22:27:47 2010 UTC (13 years, 9 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.17: +2 -1 lines
Diff to previous 1.17 (colored)

Fix an uninitialized value leading to bogus KASSERT in uvm_pmr_use_inc().

Revision 1.17 / (download) - annotate - [select for diffs], Thu Jul 1 21:40:32 2010 UTC (13 years, 11 months ago) by oga
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.16: +16 -16 lines
Diff to previous 1.16 (colored)

We don't do CamelCase: fix style(9) violations in goto labels.

no binary change.

Revision 1.16 / (download) - annotate - [select for diffs], Tue Jun 29 20:59:04 2010 UTC (13 years, 11 months ago) by thib
Branch: MAIN
Changes since 1.15: +5 -1 lines
Diff to previous 1.15 (colored)

skip empty ranges in uvm_pmr_assertvalid;
ok oga@

Revision 1.15 / (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.14: +36 -23 lines
Diff to previous 1.14 (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.14 / (download) - annotate - [select for diffs], Wed Jun 23 09:36:03 2010 UTC (13 years, 11 months ago) by thib
Branch: MAIN
Changes since 1.13: +11 -8 lines
Diff to previous 1.13 (colored)

Fix a bug in uvm_pmr_get1page() which could cause us to bounce
between an allocating process failing and waking up the pagedaemon
and the pagedaemon (since everything was dandy).

Rework the do ... while ()  logic searching for pages of a certain
memtype in a pmr into a while () loop where we check if we've found
enough pages and break out of the pmr and check the memtype inside
the loop. This prevents us from doing an early return without enough
pages for the caller even though more pages exist.


comments and help from oga, style nit from miod.
OK miod@, oga@

Revision 1.13 / (download) - annotate - [select for diffs], Thu Jun 10 08:48:36 2010 UTC (14 years ago) by thib
Branch: MAIN
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored)

fix typos in comments: lineair -> linear.

Revision 1.12 / (download) - annotate - [select for diffs], Thu Jun 10 08:42:23 2010 UTC (14 years ago) by thib
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

the pagedaemon sleeps on uvm.pagedaemon not
uvm.pagedaemon_proc, do the wakeup on the
right ident.

this had been fixed, but the fix got backed
out during The Big Backout.

ok oga@

Revision 1.11 / (download) - annotate - [select for diffs], Fri Apr 23 20:42:22 2010 UTC (14 years, 1 month ago) by ariane
Branch: MAIN
Changes since 1.10: +5 -4 lines
Diff to previous 1.10 (colored)

Fix null-pointer dereference.

ok oga

Revision 1.10 / (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.9: +824 -254 lines
Diff to previous 1.9 (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.9, Tue Jun 16 16:42:41 2009 UTC (14 years, 11 months ago) by ariane
Branch: MAIN
Changes since 1.8: +1 -1 lines
FILE REMOVED

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

"i can't see any obvious problems" oga

Revision 1.8 / (download) - annotate - [select for diffs], Sun Jun 14 03:04:08 2009 UTC (15 years ago) by deraadt
Branch: MAIN
Changes since 1.7: +1 -3 lines
Diff to previous 1.7 (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.7 / (download) - annotate - [select for diffs], Sun Jun 14 02:20:23 2009 UTC (15 years ago) by deraadt
Branch: MAIN
Changes since 1.6: +16 -9 lines
Diff to previous 1.6 (colored)

back out the free vs dirty fix, because pmemrange will go soon too

Revision 1.6 / (download) - annotate - [select for diffs], Sun Jun 14 02:04:15 2009 UTC (15 years ago) by deraadt
Branch: MAIN
Changes since 1.5: +8 -26 lines
Diff to previous 1.5 (colored)

backout the assert diff in 1.5

Revision 1.5 / (download) - annotate - [select for diffs], Fri Jun 12 00:01:21 2009 UTC (15 years ago) by ariane
Branch: MAIN
Changes since 1.4: +27 -9 lines
Diff to previous 1.4 (colored)

Add asserts on free memory, double free and while here, fix 1 assert.
Also de-inline functions.

This diff is intended to ease debugging. Once the current bug is fixed,
proper inlining will be redone.

ok: oga

Revision 1.4 / (download) - annotate - [select for diffs], Wed Jun 10 20:36:40 2009 UTC (15 years ago) by ariane
Branch: MAIN
Changes since 1.3: +9 -16 lines
Diff to previous 1.3 (colored)

Fix: Clean and dirty pages had the memtype ids and the desparate case failed
to function properly in the fast-allocation path (should not have triggered).

ok: oga, deraadt

Revision 1.3 / (download) - annotate - [select for diffs], Sun Jun 7 02:01:54 2009 UTC (15 years ago) by oga
Branch: MAIN
Changes since 1.2: +3 -1 lines
Diff to previous 1.2 (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.2 / (download) - annotate - [select for diffs], Thu Jun 4 00:20:53 2009 UTC (15 years ago) by jsg
Branch: MAIN
Changes since 1.1: +1 -6 lines
Diff to previous 1.1 (colored)

remove redefinitions of static and __inline ariane
says were debugging leftovers.

ok ariane@

Revision 1.1 / (download) - annotate - [select for diffs], Mon Jun 1 17:42:33 2009 UTC (15 years ago) by ariane
Branch: MAIN

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@

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.