Commit Graph

173 Commits

Author SHA1 Message Date
uebayasi
af0ced746a Merge more indirect functions. Some comments. 2010-02-24 15:58:26 +00:00
uebayasi
f736e76fa5 uvm_fault_upper_lookup, uvm_fault_upper_neighbor: There is no point to call
pmap_update() without calling pmap_enter().

(Probably calling only once after loop (as done in uvm_fault_lower_lookup())
is enough.  If done so, other threads see entered neighbor pages as reflected
a little latter.)
2010-02-24 06:18:19 +00:00
uebayasi
efa838c11f Minor clean up. 2010-02-24 05:26:28 +00:00
uebayasi
a9659a6dfb Revert a thinko. 2010-02-24 05:00:55 +00:00
uebayasi
3bf5a87956 Slightly clean up uvm_fault() code path after pmap_enter(). Now tasks
needed for page cache are concentrated in own functions (uvm_fault_*_done()).
2010-02-24 04:32:58 +00:00
uebayasi
79440fb3fd Record if "promote" is done in UVMHIST. Do it for "upper" fault too. 2010-02-24 04:20:45 +00:00
uebayasi
b8168569e9 Merge some indirect "lower" fault handlers back. Prompted by rmind@. 2010-02-24 04:18:09 +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
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
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
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
25d5583c0d Clean up an internal flag usage. No functional changes. 2010-01-24 15:03:02 +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
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
uebayasi
55c6ab5c75 Consistently call amap / uobj layers as upper / lower, because UVM has only
those two layers by design.  Approved by Chuck Cranor some time ago.
2009-11-01 11:16:32 +00:00
ad
ae6c4143ce Move a couple of calls to pmap_update(). 2008-12-20 11:33:38 +00:00
ad
ecddde33a2 Update a comment. 2008-07-04 10:22:35 +00:00
ad
be04ac4896 Make rusage collection per-LWP and collate in the appropriate places.
cloned threads need a little bit more work but the locking needs to
be fixed first.
2008-03-27 19:06:51 +00:00