summaryrefslogtreecommitdiffstats
path: root/sys/uvm/uvm_glue.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Hold a read lock on the map while doing the actual device I/O during inkettenis2019-01-101-24/+32
| | | | | | | | | | | physio(9) to prevent another thread from unmapping the memory and triggering an assertion or even corruption random physical memory pages. ok deraadt@ Should fix: Reported-by: syzbot+b8e7faf688f8c9d341b1@syzkaller.appspotmail.com Reported-by: syzbot+b6a9255faa0605669432@syzkaller.appspotmail.com
* Unifed PMAP_UAREA, unused since we stopped supporting ARM < v7.mpi2017-05-081-7/+1
| | | | ok kettenis@
* Unifdef KGDB.mpi2017-04-301-38/+1
| | | | | | It doesn't compile und hasn't been working during the last decade. ok kettenis@, deraadt@
* Convert most of the manual checks for CPU hogging to sched_pause().mpi2017-02-141-3/+2
| | | | | | | | The distinction between preempt() and yield() stays as it is usueful to know if a thread decided to yield by itself or if the kernel told him to go away. ok tedu@, guenther@
* Rename __sysctl syscall to just sysctl, as the userland wrapper is no longerguenther2015-09-131-3/+3
| | | | | | necessary ok deraadt@ jsing@
* don't drop the kernel lock everytime. on a busy system, this results intedu2014-12-151-3/+7
| | | | | | the reaper spending more than half its time in uvm_pause. we want the system to be interactive, but we want throughput too. this seems like a decent balance.
* Introduce a new sysctl to retrieve VM map entriesuebayasi2014-12-051-1/+16
| | | | | | | | | | | | | | | | This adds a new sysctl KERN_PROC_VMMAP, which returns an array of VM map entries of a specified process. This prevents debuggers from iterating vm_map_entry RB tree via kvm(3). The name KERN_PROC_VMMAP and struct kinfo_vmentry are chosen from the same function in FreeBSD. struct kinfo_vmentry is revised to reduce size, because OpenBSD does not keep track of filepaths. The semantic is also changed to return max buffer size as a hint, and start iteration at the specified base address. Much valuable input from deraadt@, guenther@, tedu@ OK tedu@ deraadt@
* Replace a plethora of historical protection options with justderaadt2014-11-161-5/+4
| | | | | | | 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
* Chuck Cranor rescinded clauses in his licensejsg2014-07-111-7/+2
| | | | | | | | | | | | | 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
* Move from struct proc to process the reference-count-holding pointersguenther2014-05-151-72/+52
| | | | | | | | | | to the process's vmspace and filedescs. struct proc continues to keep copies of the pointers, copying them on fork, clearing them on exit, and (for vmspace) refreshing on exec. Also, make uvm_swapout_threads() thread aware, eliminating p_swtime in kernel. particular testing by ajacoutot@ and sebastia@
* Fix whitespace fail in previous commitguenther2014-05-031-3/+3
|
* Move the u-area allocation and pmap-magic logic to its own functionguenther2014-05-031-8/+23
| | | | | | uvm_uarea_alloc() function name from NetBSD; arm testing by miod@
* compress code by turning four line comments into one line comments.tedu2014-04-131-3/+1
| | | | emphatic ok usual suspects, grudging ok miod
* add a uvm_yield function and use it in the reaper path to prevent thetedu2014-04-031-2/+11
| | | | | | | reaper from hogging the cpu. it will do the kernel lock twiddle trick to allow other CPUs a chance to run, and also checks if the reaper has been running for an entire timeslice and should be preempted. ok deraadt
* do not need machine/cpu.h directlyderaadt2013-03-311-3/+1
|
* Make rusage totals, itimers, and profile settings per-process insteadguenther2012-03-231-16/+2
| | | | | | | of per-rthread. Handling of per-thread tick and runtime counters inspired by how FreeBSD does it. ok kettenis@
* move uvm_pageratop from uvm_pager.c local to a general uvm functionoga2011-04-151-1/+18
| | | | | | | (uvm_atopg) and use it in uvm_km_doputpage to replace some handrolled code. Shrinks the kernel a trivial amount. ok beck@ and miod@ (who suggested i name it uvm_atopg not uvm_atop)
* In uvm_vslock_device(), if uvm_pglistalloc() fails, make sure to not passmiod2011-04-071-2/+2
| | | | an uninitialized variable to uvm_km_free().
* Two problems with vslock_device functions.art2011-04-011-7/+20
| | | | | | | | | | | | - Fix error handling so that we free stuff on error. - We use the mappings to keep track of which pages need to be freed so don't unmap before freeing (this is theoretically incorrect and will be fixed soon). This makes fsck happy on bigmem machines (it doesn't leak all dma:able memory anymore). beck@, drahn@, oga@ ok
* Don't bother trying to handle a uvm_pglistalloc failure when called withthib2010-07-021-7/+7
| | | | | | UVM_PLA_WAITOK as it will not fail; Rather assert that it didn't fail. ok tedu@, oga@
* nuke unused global and a comment.thib2010-07-021-9/+1
| | | | ok tedu@, oga@
* Add missing pmap_update. pointed out by matthew@art2010-07-021-1/+3
|
* Implement vs{,un}lock_device and use it for physio.art2010-07-011-4/+95
| | | | | | | | | Just like normal vs{,un}lock, but in case the pages we get are not dma accessible, we bounce them, if they are dma acessible, the functions behave exactly like normal vslock. The plan for the future is to have fault_wire allocate dma acessible pages so that we don't need to bounce (especially in cases where the same buffer is reused for physio over and over again), but for now, keep it as simple as possible.
* knf function decleration nit.thib2010-06-301-8/+3
|
* uvm_scheduler() sounds important, but ``while(1) tsleep()'' is kinda lameblambert2009-08-111-17/+1
| | | | | | | | | | inline the loop in the one place it exists, and remove it from uvm adjust a comment mentioning it accordingly originally inspired by a diff fixing a comment from oga@ ok art@ beck@ miod@ oga@
* While working on some stuff in uvm I've gotten REALLY sick of readingoga2009-03-201-18/+5
| | | | | | | K&R function declarations, so switch them all over to ansi-style, in accordance with the prophesy. "go for it" art@
* it is a good policy to clear the pointer after we free somethingderaadt2008-10-241-1/+2
|
* Dynamic buffer cache. Initial diff from mickey@, okay art@ beck@ toby@pedro2007-05-261-13/+1
| | | | deraadt@ dlg@.
* Instead of a silly loop with goto, just use while(1).art2007-05-181-4/+3
|
* Kernel stack can be swapped. This means that stuff that's on the stackmiod2006-11-291-199/+13
| | | | | | | | | | should never be referenced outside the context of the process to which this stack belongs unless we do the PHOLD/PRELE dance. Loads of code doesn't follow the rules here. Instead of trying to track down all offenders and fix this hairy situation, it makes much more sense to not swap kernel stacks. From art@, tested by many some time ago.
* Enable optional specific handling of the u-area in pmap via PMAP_UAREA ifmiod2006-05-251-1/+6
| | | | | defined; from NetBSD. Currently only used on xscale arm to use the mini data cache for u area mappings instead of the main data cache.
* In uvm_swapout(), protect "p->p_swtime = 0;" with SCHED_LOCK() as is alreadyaaron2005-11-011-2/+2
| | | | | done in uvm_swapin(). Looks like this was a mistake made while editing. No response from art@. deraadt@, miod@, pedro@ ok
* Protect the run queues with SCHED_LOCK, not just spl (ot nothing at all inart2005-05-311-6/+7
| | | | | | | one case fixed here). miod@ "appears to be harmless" markus@ ok
* sched work by niklas and art backed out; causes panicsderaadt2005-05-291-7/+6
|
* This patch is mortly art's work and was done *a year* ago. Art wants to thankniklas2005-05-251-6/+7
| | | | | | | | | | | | | | | | everyone for the prompt review and ok of this work ;-) Yeah, that includes me too, or maybe especially me. I am sorry. Change the sched_lock to a mutex. This fixes, among other things, the infamous "telnet localhost &" problem. The real bug in that case was that the sched_lock which is by design a non-recursive lock, was recursively acquired, and not enough releases made us hold the lock in the idle loop, blocking scheduling on the other processors. Some of the other processors would hold the biglock though, which made it impossible for cpu 0 to enter the kernel... A nice deadlock. Let me just say debugging this for days just to realize that it was all fixed in an old diff noone ever ok'd was somewhat of an anti-climax. This diff also changes splsched to be correct for all our architectures.
* sync of pmap_update() calls with NetBSD. pmap_update is defined away ondrahn2004-02-231-1/+2
| | | | all architectures but arm, where it is needed.
* Sync comments with NetBSD.grange2003-11-201-3/+3
| | | | ok millert@
* Check for round_page() overflow in uvm_vslock()/uvm_vsunlock().grange2003-11-201-3/+11
| | | | ok millert@ henning@ markus@ drahn@
* Avoid a race condition while swapping in a process.nordin2003-11-081-9/+22
| | | | | Tested by mickey@, henning@, ericj@, and beck@. ok mickey@
* Remove uvm_useracc(): misleading, gives a false sentiment of security, andmiod2003-08-101-28/+1
| | | | eventually not used anymore. Conforming to art@'s evil plans.
* check the uvm_fault_wire() for failure, just like other calls; art@ okmickey2003-01-291-4/+5
|
* fix the use of "cuz" in the tree; these are all in commentsjsyn2002-06-091-2/+2
| | | | noticed by aaron@, recommended by deraadt@
* First round of __P removal in sysmillert2002-03-141-3/+3
|
* UBC was a disaster. It worked very good when it worked, but on someart2001-12-191-24/+28
| | | | | | | | | 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.
* Yet another sync to NetBSD uvm.art2001-12-041-3/+3
| | | | | | 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.
* Sync in more uvm from NetBSD. Mostly just cosmetic stuff.art2001-11-281-19/+17
| | | | Contains also support for page coloring.
* more sync to netbsd. some bugfixes in uvm_km_kmemalloc, lots of fixes in uvm_loan.art2001-11-281-3/+2
|
* Sync in more uvm changes from NetBSD.art2001-11-281-11/+9
| | | | | This time we're getting rid of KERN_* and VM_PAGER_* error codes and use errnos instead.
* Move maxdmap and maxsmap to kern_resource.cart2001-11-101-5/+2
|
* Another sync of uvm to NetBSD. Just minor fiddling, no major changes.art2001-11-071-25/+29
|