Commit Graph

1298 Commits

Author SHA1 Message Date
pooka
fbd53556dc Wipe out the last vestiges of POOL_INIT with one swift stroke. In
most cases, use a proper constructor.  For proplib, give a local
equivalent of POOL_INIT for the kernel object implementation.  This
way the code structure can be preserved, and a local link set is
not hazardous anyway (unless proplib is split to several modules,
but that'll be the day).

tested by booting a kernel in qemu and compile-testing i386/ALL
2009-09-13 18:45:10 +00:00
rmind
34c783b631 uvmspace_unshare: #if 0-out this function. Q: perhaps remove?
AFAIK it was not used for 11 years.
2009-09-06 23:14:19 +00:00
rmind
924c9047ea - Re-enable direct I/O with emap for pipe.
- While not used, #ifdef KVA allocation in emap (so it wont burn the space).
2009-08-29 00:06:43 +00:00
thorpej
071708f29f Use PMAP_ENABLE_PMAP_KMPAGE to enable PMAP_KMPAGE. We still want the bit
defined in the MI space, not in an MD header.
2009-08-19 23:54:33 +00:00
thorpej
1ed65faa16 Rationalize the definition of PMAP_KMPAGE. 2009-08-19 14:58:48 +00:00
matt
01bf4c69be In uvm_kmapent_alloc, Make sure entry is initialized.
Spotted by msaitoh.
2009-08-19 04:53:20 +00:00
thorpej
b4e5923fa5 Move uvm_object-related DDB hooks into uvm_object.c. Put all of the
uvm_map-related DDB stuff in one spot in the file.
2009-08-18 19:16:09 +00:00
thorpej
0d30b9a815 Back-out accidental check-in. 2009-08-18 19:09:18 +00:00
thorpej
21d14bd56b Move uvm_page-related DDB hooks into uvm_page.c. 2009-08-18 19:08:39 +00:00
thorpej
97a2657a66 Add a real API for testing if a page is a managed page, and adjust callers
to stop relying on vm_physseg_find() for this purpose.
2009-08-18 18:06:53 +00:00
yamt
f97310f398 whitespace fixes. no functional changes. 2009-08-18 02:43:49 +00:00
yamt
9373b602f6 uvm_mmap: remove a dead conditional. 2009-08-18 02:41:31 +00:00
yamt
6f5397de19 assertions 2009-08-16 11:06:37 +00:00
matt
a15cb55d9e Fix KASSERT() failure reported by Geoff Wing. 2009-08-13 03:21:03 +00:00
matt
4efef68d70 Fix brain fart. physmem was int not long. 2009-08-11 16:27:08 +00:00
matt
6328246ec5 Add back declaration of physmem but use the existing type (long). 2009-08-11 16:07:24 +00:00
haad
ced21e5799 Remove physmem definition to uintptr_t from another patch. 2009-08-11 09:16:53 +00:00
haad
b760fc6e71 Add uvm_reclaim_hooks support for reclaiming kernel KVA space and memory.
This is used only by zfs where uvm_reclaim hook is added from arc cache.

Oked ad@.
2009-08-10 23:17:29 +00:00
matt
0ad7ebe8ea Revent change to printf. (why can't __func__ concat with other string?) 2009-08-10 16:50:18 +00:00
matt
e1bf8f4b35 Compare vaddr_t against 0, not NULL. 2009-08-10 16:49:30 +00:00
matt
8e96f9bb1a Only swapout uareas if VMSWAP_UAREA is defined (which is should be by default).
If it's not defined and PMAP_MAP_POOLPAGE is defined and USPACE == PAGE_SIZE,
then allocate/map USPACE via uvm_pagealloc/PMAP_MAP_POOLPAGE.

On platforms like MIPS with 16KB pages, this means that uareas (and hence lwp
kernel stacks) will be always be accessible since they will be KSEG0.
2009-08-09 22:19:09 +00:00
matt
3950714196 If PMAP_MAP_POOLPAGE is defined, use it to map kernel map entries. This
avoids TLB pollution on those platforms that define it.
2009-08-09 22:13:07 +00:00
matt
0dee8e59c9 Add [default] option to make UAREAs swappable. Disabling the option makes
them unswappable and therefore allocatable using KSEG/BAT/etc.
2009-08-09 21:58:03 +00:00
pooka
1252aada83 kill uvm_aio_biodone1(). only user was lfs and that uses nestiobuf now. 2009-08-05 14:11:32 +00:00
pooka
5bd015d57e add some advice symbols we'll eventually need 2009-08-05 14:10:33 +00:00
pooka
e0fc658a3c uvm_vnp_zerorange() logically and by implementation more a part of
ubc than uvm_vnode, so move it over.
2009-08-04 23:31:57 +00:00
pooka
c4e6a098a1 kernel opt polish: g/c unnecessary fs_nfs.h and opt_ddb.h 2009-08-04 23:03:01 +00:00
yamt
fac82a77c9 - don't reuse a variable for different purposes.
- KNF a bit.
2009-08-02 16:07:34 +00:00
yamt
010a609f17 - fix extend of unexistent mapping. the problem reported by
Nicolas Joly on current-users@.
- check our reserved entry a little more strictly.
- comments.
2009-08-02 16:03:47 +00:00
yamt
5e1c2c932d - uvm_map_extract: update map->size correctly for !UVM_EXTRACT_CONTIG.
- uvm_map_extract: panic on zero-sized entries.
- make uvm_map_replace static.
2009-08-01 16:35:51 +00:00
yamt
7d4ddb70a2 don't call uvm_map_check with map unlocked. 2009-08-01 15:36:07 +00:00
yamt
61a9b51f82 _uvm_tree_sanity: fix an assertion. 2009-08-01 15:32:02 +00:00
yamt
e4ef86317e _uvm_map_sanity: fix a race which causes "stale hint". 2009-08-01 15:30:33 +00:00
kiyohara
142809ac35 Globalize uvm_emap_size. It use to calculate size of kernel page table.
http://mail-index.netbsd.org/current-users/2009/07/13/msg009983.html
2009-07-20 03:51:42 +00:00
rmind
1be5c7a891 pmap_emap_sync: add an argument, and do not perform pmap_load() during
context switch (pmap_destroy() path seems to be unsafe), instead just
perform tlbflush().  Slightly inefficient, but good enough for now.
2009-07-19 15:17:29 +00:00
rmind
3cee4be877 - Fix rare crashe in the intr_lapic_tlb_bcast() handler: save and setup
%fs on i386, %gs on amd64 registers, before using them.  Otherwise, it
  might be invalid/garbage, eg. IPI can interrupt userspace.

- Explicitly initialize per-CPU emap generation number.

Thanks <drochner> for reporting and testing of patch.
2009-07-09 21:43:16 +00:00
rmind
5c68e5d0ee Ephemeral mapping (emap) implementation. Concept is based on the idea that
activity of other threads will perform the TLB flush for the processes using
emap as a side effect.  To track that, global and per-CPU generation numbers
are used.  This idea was suggested by Andrew Doran; various improvements to
it by me.  Notes:

- For now, zero-copy on pipe is not yet enabled.
- TCP socket code would likely need more work.
- Additional UVM loaning improvements are needed.

Proposed on <tech-kern>, silence there.
Quickly reviewed by <ad>.
2009-06-28 15:18:50 +00:00
mrg
162717ffd2 add a workaround for drm:
for device mmap()'s, if the D_NEGOFFSAFE flag is set, do not check
if the offset is negative.

this should go away with the test itself when all drivers are audited
and checked to not fail with negative offsets.
2009-06-20 19:24:27 +00:00
yamt
3685fcc8e8 change the order of members of vm_anon for better packing. 2009-06-14 21:36:03 +00:00
yamt
16babfa6fb on MADV_WILLNEED, start prefetching backing object's pages. 2009-06-10 01:55:33 +00:00
yamt
c87ccfd341 - add a function to perform explicit read-ahead.
- ra_startio: tweak locking a bit.
2009-06-10 01:54:08 +00:00
yamt
5ebfa691fe wrap long lines. 2009-05-30 04:26:16 +00:00
pooka
ec3ee0abf9 Include some debug print routines if DEBUGPRINT is defined. This
way they can be included without having to include DDB.
(arguably all print routines should be behind #ifdef DEBUGPRINT
and options DDB should define that macro, but I'll tackle that later)
2009-05-03 16:52:54 +00:00
cegger
e3735e2a6b use top-most bits for PMAP_MD_MASK instead something in the middle.
per request from christos@
2009-04-23 06:22:00 +00:00
cegger
1d89a182fb change pmap flags argument from int to u_int.
discussed with christos@ on source-changes-d@
2009-04-21 21:29:58 +00:00
cegger
c275296727 Introduce PMAP_MD_MASK. Reserves PMAP bits for use in MD code.
Presented on tech-kern@, port-i386@ and port-amd64@
ok ad@
2009-04-18 08:48:47 +00:00
rmind
523acc7d68 Avoid few #ifdef KSTACK_CHECK_MAGIC. 2009-04-16 00:17:19 +00:00
yamt
cccbca027b g/c uvm_aiobuf_pool. 2009-03-30 16:36:36 +00:00
ad
f51a17bccf kernel memory guard for DEBUG kernels, proposed on tech-kern.
See kmem_alloc(9) for details.
2009-03-29 10:51:53 +00:00
mrg
fcc023545e - add new RLIMIT_AS (aka RLIMIT_VMEM) resource that limits the total
address space available to processes.  this limit exists in most other
modern unix variants, and like most of them, our defaults are unlimited.
remove the old mmap / rlimit.datasize hack.

- adds the VMCMD_STACK flag to all the stack-creation vmcmd callers.
it is currently unused, but was added a few years ago.

- add a pair of new process size values to kinfo_proc2{}. one is the
total size of the process memory map, and the other is the total size
adjusted for unused stack space (since most processes have a lot of
this...)

- patch sh, and csh to notice RLIMIT_AS.  (in some cases, the alias
RLIMIT_VMEM was already present and used if availble.)

- patch ps, top and systat to notice the new k_vm_vsize member of
kinfo_proc2{}.

- update irix, svr4, svr4_32, linux and osf1 emulations to support
this information.  (freebsd could be done, but that it's best left
as part of the full-update of compat/freebsd.)


this addresses PR 7897.  it also gives correct memory usage values,
which have never been entirely correct (since mmap), and have been
very incorrect since jemalloc() was enabled.

tested on i386 and sparc64, build tested on several other platforms.

thanks to many folks for feedback and testing but most espcially
chuq and yamt for critical suggestions that lead to this patch not
having a special ugliness i wasn't happy with anyway :-)
2009-03-29 01:02:48 +00:00