Update of /cvsroot/linuxcompressed/linux/mm
In directory usw-pr-cvs1:/tmp/cvs-serv5957/mm
Modified Files:
memory.c vmscan.c
Log Message:
- Fixed compilation error in buffer.c when compiling it without compressed
cache.
- Fixed oops caused when running fillmem due to a null pointer
- Fixed major/minor faults for compressed cache. Now we have correct data
about when we actually had to perform IO to service a page fault.
- Improved support for clean pages. Now the clean page is compressed and
right away freed in shrink_cache().
- When a pte in do_no_page() has write access to the page, it's already set
as dirty. So, in the same way done in do_swap_page(), we already remove the
its fragment from compressed cache since it will need to be compressed again
anyway.
Index: memory.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/memory.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -r1.27 -r1.28
*** memory.c 28 Apr 2002 20:51:34 -0000 1.27
--- memory.c 2 May 2002 16:31:37 -0000 1.28
***************
*** 1135,1141 ****
if (!page) {
! comp_cache_fragment_t * fragment;
! if (find_comp_page(&swapper_space, entry.val, &fragment))
swapin_readahead(entry);
page = read_swap_cache_async(entry);
if (!page) {
--- 1135,1145 ----
if (!page) {
! comp_cache_fragment_t * fragment;
! /* perform readahead only if the page is on disk */
! if (find_comp_page(&swapper_space, entry.val, &fragment)) {
swapin_readahead(entry);
+ /* major fault */
+ ret = 2;
+ }
page = read_swap_cache_async(entry);
if (!page) {
***************
*** 1150,1156 ****
return retval;
}
-
- /* Had to read the page from swap area: Major fault */
- ret = 2;
}
--- 1154,1157 ----
***************
*** 1262,1265 ****
--- 1263,1267 ----
struct page * new_page;
pte_t entry;
+ int ret = 2; /* usually major fault */
if (!vma->vm_ops || !vma->vm_ops->nopage)
***************
*** 1306,1311 ****
flush_icache_page(vma, new_page);
entry = mk_pte(new_page, vma->vm_page_prot);
! if (write_access)
entry = pte_mkwrite(pte_mkdirty(entry));
set_pte(page_table, entry);
} else {
--- 1308,1317 ----
flush_icache_page(vma, new_page);
entry = mk_pte(new_page, vma->vm_page_prot);
! if (PageCompCache(new_page))
! ret = 1;
! if (write_access) {
entry = pte_mkwrite(pte_mkdirty(entry));
+ flush_comp_cache(new_page);
+ }
set_pte(page_table, entry);
} else {
***************
*** 1319,1323 ****
update_mmu_cache(vma, address, entry);
spin_unlock(&mm->page_table_lock);
! return 2; /* Major fault */
}
--- 1325,1329 ----
update_mmu_cache(vma, address, entry);
spin_unlock(&mm->page_table_lock);
! return ret;
}
Index: vmscan.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/vmscan.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** vmscan.c 28 Apr 2002 20:51:34 -0000 1.31
--- vmscan.c 2 May 2002 16:31:37 -0000 1.32
***************
*** 511,516 ****
/* compress it if it's a clean page that has not been
* compressed in a previous iteration */
! if (compress_clean_page(page, gfp_mask))
continue;
/* point of no return */
--- 511,520 ----
/* compress it if it's a clean page that has not been
* compressed in a previous iteration */
! if (compress_clean_page(page, gfp_mask)) {
! list_del(entry);
! list_add_tail(entry, &inactive_list);
! max_scan++;
continue;
+ }
/* point of no return */
|