Commit Graph

1353 Commits

Author SHA1 Message Date
joerg d621e29eca Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.
2010-02-08 19:02:25 +00:00
mlelstv 3e39181b49 pgo_get needs the page array to be initialized. 2010-02-08 00:02:50 +00:00
mlelstv 5158187dbc Move assertion to make check more clear. 2010-02-08 00:01:39 +00:00
mlelstv 676d68d9ae Make UVMHIST build again. 2010-02-07 23:25:07 +00:00
mlelstv dfd86ea3a8 Use filesystem blocks to address filesystem objects. f_iosize just
happens to be the same for current filesystems.
2010-02-07 15:51:28 +00:00
uebayasi 2903e6d834 __inline -> inline 2010-02-06 12:10:59 +00:00
uebayasi 6f78b42add Make vm_physseg lookup routines take the target vm_physseg. This is for the
coming "managed" device segments.
2010-02-06 02:56:17 +00:00
uebayasi f0cafea3a4 vnode.h is not used here. 2010-02-05 03:49:11 +00:00
uebayasi 31973b36e6 Cosmetic. Shorten some long names. 2010-02-05 02:27:15 +00:00
uebayasi 2b1c626381 Fix !DIAGNOSTIC build. Reported by Geoff Wing. 2010-02-05 00:55:31 +00:00
uebayasi e1b26edd82 Reduce diff between upper/lower neighbor handlers. 2010-02-04 05:48:26 +00:00
uebayasi 58625d0ac1 Merge "obfuscating layers" for readability. Inline some functions.
Requested by rmind@.
2010-02-04 03:32:21 +00:00
uebayasi c0d0f35c5f Move uvm_fault_* static func decls in one place. 2010-02-04 03:19:08 +00:00
uebayasi d0c590668f A few assertions & comments. 2010-02-03 14:02:49 +00:00
uebayasi cfde757678 uvm_fault_lower_generic_io: Reduce diff from uvm_loanuobj(). 2010-02-03 12:40:39 +00:00
uebayasi cd14256881 uvm_fault_lower_generic_io: One missing mutex_exit(vmobjlock). Found while
comparing this function with uvm_loanuobj().  (Part of) these should be
merged.
2010-02-03 07:48:18 +00:00
uebayasi 5f0a89783a uobj->pgops->pgo_get doing PGO_SYNCIO returns a uobjpage whose uobj backpointer
refers to another "uobj" used to call pgo_get.  Revert the wrong assertion
I made.  My bad.

(This and pgo_get's possible ERESTART return value check is the only 2 behavioral
changes I made.)

Reported by drochner@, thanks.
2010-02-02 18:49:23 +00:00
uebayasi 0dceadd765 Don't pass an unnecessary reference to uvm_loanbreak_anon().
Requested by rmind@.
2010-02-02 17:40:43 +00:00
wiz 27b261aabe Missing 'if defined COMPAT13 or COMPAT50' in uvm_swap.c found by cppcheck
and reported by Henning Petersen in PR 42721.
2010-02-02 15:00:34 +00:00
uebayasi 5526267c10 Be consistent to decide if PMAP_WIRED or not. 2010-02-02 06:52:59 +00:00
uebayasi 19fbe1698d Move A->K loan break code to uvm_loan.c. 2010-02-02 06:06:02 +00:00
uebayasi be06afbe24 Indent. 2010-02-02 05:58:16 +00:00
uebayasi a79520c14e uvm_fault: Split "neighbor" fault and loan handling into functions. 2010-02-02 04:35:35 +00:00
uebayasi 49bcc1198b Sort struct uvm_faultctx members for better alignment. 2010-02-02 01:54:48 +00:00
uebayasi 689dab24ea Indent. 2010-02-01 16:12:36 +00:00
uebayasi d99dd23d72 More split. 2010-02-01 16:08:27 +00:00
uebayasi 49c8580e07 Fix build without DIAGNOSTIC. 2010-02-01 11:58:39 +00:00
uebayasi ef11535fc6 uvm_fault: Clarify when to wire what. 2010-02-01 10:22:40 +00:00
uebayasi 3e6fea088d uvm_fault_upper_lookup: This is totally my personal preference, but can't help
adding one goto to reduce one indent.
2010-02-01 09:18:41 +00:00
uebayasi c3f0715aa9 uvm_fault:
- Lower fault routines don't care the vm_anon array found in upper lookup.
  Don't pass the pointer down.
- The flag "shadowed" is known when we lookup upper layer.  Don't need to
  keep in the fault context struct.
2010-02-01 09:06:43 +00:00
uebayasi f7a6581cde Indent. 2010-02-01 08:23:13 +00:00
uebayasi 90da75f6f6 Rewrite uvm_fault() loop using while () than goto. 2010-02-01 08:19:17 +00:00
uebayasi 6ca4a2b7f1 Split uvm_fault() into 2 more functions, uvm_fault_check() and
uvm_fault_upper_lookup().  Omit unnecessary arguments passed around.
2010-02-01 08:16:32 +00:00
uebayasi 82f34a5f99 uvm_fault: Pack variables shared during fault / re-fault into a struct named
uvm_faultctx.  Unfortunately ~all of those values are overriden in various
ways.  Constification doesn't help much...
2010-02-01 06:56:22 +00:00
uebayasi 62e5fa15ec ERESTART is already negative. Give up negating error values to not override
the original values.  Pointed out by rmind@, thanks.

In the lower fault case, if (*pgo_get)() can return ERESTART and we should
re-fault for that remains a question.  The original code just returned the
error, so keep that behaviour for now.  In case (*pgo_get)() really returns
ERESTART, pass EIO to tell the uvm_fault caller that (*pgo_get)() failed.

(As far as I grep callers don't check if the return value is ERESTART or not.
So assuming (*pgo_get)() never returns ERESTART should be a safe bet.)
2010-02-01 05:48:19 +00:00
uebayasi 40b4d371a5 Ax uvm_fault_internal() & break it into functions. "Upper" fault and "lower"
fault routines are separated now.
2010-01-31 17:13:38 +00:00
uebayasi 2359fa84f6 uvm_fault_internal:
Move local variables around to isolate contexts.  Note that remaining variables
are global in that function, and some hold state across re-fault.

Slilently clean-up the "eoff" mess.

(Superfluous braces will go once things settle down.)
2010-01-31 09:20:31 +00:00
uebayasi fd3f38bda1 Indent. 2010-01-31 07:47:29 +00:00
uebayasi 3f944b46d0 uvm_fault_internal: In lower fault handling case, put another goto to clarify
that we don't care lower neighboring pages for the zero-fill object.
2010-01-31 07:46:03 +00:00
uebayasi 19311f603b uvm_fault_internal: Skip another long code segment (lower "neighbor" fault)
by a goto.
2010-01-31 07:37:24 +00:00
uebayasi 51af955674 uvm_fault_internal: Put a goto label "Case1" as well as "Case2". Clarify
that if the faulting page is shadowed, we don't care the lower layer at all.
2010-01-31 07:32:35 +00:00
uebayasi e93a6edc86 Correct previous; fix a miscalculation of offset-into-entry in MADV_SEQUENTIAL
case.  Pointed out by pooka@.
2010-01-31 01:40:12 +00:00
uebayasi 0ab71424a7 Calculate the offset from vm_map_entry's start to vm_page array's start once. 2010-01-30 15:13:25 +00:00
uebayasi 5620716c87 uvm_pageinsert, uvm_pageremove: Pass the uboj, to/from which a pg is
inserted/removed, as an argument, because looking up a back-reference from
pg is redundant.  No functional changes.
2010-01-27 03:56:33 +00:00
uebayasi 25d5583c0d Clean up an internal flag usage. No functional changes. 2010-01-24 15:03:02 +00:00
pooka c3183f3251 The VATTR_NULL/VREF/VHOLD/HOLDRELE() macros lost their will to live
years ago when the kernel was modified to not alter ABI based on
DIAGNOSTIC, and now just call the respective function interfaces
(in lowercase).  Plenty of mix'n match upper/lowercase has creeped
into the tree since then.  Nuke the macros and convert all callsites
to lowercase.

no functional change
2010-01-08 11:35:07 +00:00
rmind 1069745866 Replace few USER_TO_UAREA/UAREA_TO_USER uses, reduce sys/user.h inclusions. 2009-12-17 01:25:10 +00:00
matt 4a8d8a88f8 Use PRIxVADDR... (change a printf/panic -> panic) 2009-12-15 06:15:11 +00:00
matt 438b816270 Use PRIxVADDR ... 2009-12-14 21:19:47 +00:00
pooka faa8e1b3e3 Convert tsleep(&lbolt) to kpause(). Make ltsleep/mtsleep on lbolt
illegal.  I examined all places where lbolt is referenced to make
sure there were pointer aliases of it passed to tsleep, but put a
KASSERT in m/ltsleep() just to be sure.
2009-12-05 22:34:43 +00:00