- Adding prefaulting of fs0 to avoid page fault deadlocks.
- Fixed a bug that a vmo page_cache equivalence would simply drop a link to
an original vmo, even if the vmo could have more pages outside the page cache,
or if the vmo was not a shadow vmo.
- Fixed a bug with page allocator where recursion would corrupt global variables.
- Now going to fix or re-write a simpler page allocator that works.
Added a list of links for vm objects so they can follow
the links that point at them.
More succinct handling of the case where a vm object
is dropped. Now depending on the object's number of link
references and shadow references, upon a drop it could
either be merged, deleted or kept.
Added opener reference count for vm files. Now files
have opener count, objects have shadow and link count.
Link count is also meaningful for how many tasks have
mmap'ed that object.
When allocating a new area, the alignment calculation of new area
structure was wrong. Hopefully this is now fixed. The original function
with bad alignment was preserved.
When freeing a new area and merging it with adjacent areas, pointer
to previous area was mistakenly used instead of pointer to next.
modified: tasks/libmem/kmalloc/kmalloc.c
R/W shadow objects must be made read-only during a fork.
When searching for a writeable shadow object, it can only be the first
object on the vma object chain, therefore not traversing the object
chain and checking only the first object is sufficient.
serving mm0, if it page faults, system deadlocks because mm0 is waiting to be served by vfs.
FIX: To fix this, mm0 will need to fork itself and keep a separate thread solely for
page fault handling.
When copying file pages back and forth, we need both dst and src
offsets since the cursor offset and read/write buffer page offsets
are different. This is now fixed.
Also done some mods to close().
- Added logic to calculate which pages are in the file and which are new
for writing.
- Nearly finished the template for sys_write.
- Need to implement write_cache_pages().
- Need to distinguish dirty/clean pages and implement flushing dirty
pages back to vfs.
sys_timer accumulates timer ticks into seconds, minutes, hours and days.
It's left to the user to calculate from days into a date. It is not yet
known if the calculation is even roughly correct.
Reduced 2 kmem_reclaim/grant calls into one kmem_control call.
close() needs to flush dirty buffers.
pager needs to have read/write support properly implemented.
open() needs to record mode and access times.
The need for access times means we need rtc and time implementation.
Also need to add stat() access() etc.