Thread: [lc-checkins] CVS: linux/mm filemap.c,1.28,1.29 swap_state.c,1.28,1.29
Status: Beta
Brought to you by:
nitin_sf
|
From: Rodrigo S. de C. <rc...@us...> - 2002-06-13 20:19:05
|
Update of /cvsroot/linuxcompressed/linux/mm
In directory usw-pr-cvs1:/tmp/cvs-serv8112/mm
Modified Files:
filemap.c swap_state.c
Log Message:
- read_comp_cache() has an "access" parameter to know if it should
account that access or not. If it is to account it, it will move the
fragment to the back of LRU list. That implied that we had to add some
parameters to some functions in filemap.c. It's there for testing
purposes and might be removed.
- account all PageMappedCompCache pages and not only page->buffers in
buffers column in /proc/comp_cache_hist
- added code that will enable to store all page cache pages without
compressing them. It's disable by an "#if 0".
- added code that will remove the fragment from compressed cache
whenever accessed. Disable by an "#if 0" too.
- tried to make a more robust writeout system using priority idea
present in vmscan.c. Now we are not supposed to panic because we
couldn't free a swap buffer page.
- fixed a potential bug when trying to free buffers in
writeout_fragments(). The fragment wasn't removed from lru queue
before being submitted to IO.
- added code that will support write out of all fragments in a certain
page. Also disabled by an "#if 0".
Index: filemap.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/filemap.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -r1.28 -r1.29
*** filemap.c 11 Jun 2002 13:20:49 -0000 1.28
--- filemap.c 13 Jun 2002 20:18:31 -0000 1.29
***************
*** 749,754 ****
* and schedules an I/O to read in its contents from disk.
*/
! static int FASTCALL(page_cache_read(struct file * file, unsigned long offset));
! static int page_cache_read(struct file * file, unsigned long offset)
{
struct address_space *mapping = file->f_dentry->d_inode->i_mapping;
--- 749,754 ----
* and schedules an I/O to read in its contents from disk.
*/
! static int FASTCALL(page_cache_read(struct file * file, unsigned long offset, int access));
! static int page_cache_read(struct file * file, unsigned long offset, int access)
{
struct address_space *mapping = file->f_dentry->d_inode->i_mapping;
***************
*** 769,773 ****
int error = 0;
#ifdef CONFIG_COMP_PAGE_CACHE
! if (read_comp_cache(mapping, offset, page))
#endif
error = mapping->a_ops->readpage(file, page);
--- 769,773 ----
int error = 0;
#ifdef CONFIG_COMP_PAGE_CACHE
! if (read_comp_cache(mapping, offset, page, access))
#endif
error = mapping->a_ops->readpage(file, page);
***************
*** 796,800 ****
offset = CLUSTER_OFFSET(offset);
while ((pages-- > 0) && (offset < filesize)) {
! int error = page_cache_read(file, offset);
if (error < 0)
return error;
--- 796,800 ----
offset = CLUSTER_OFFSET(offset);
while ((pages-- > 0) && (offset < filesize)) {
! int error = page_cache_read(file, offset, 0);
if (error < 0)
return error;
***************
*** 1042,1046 ****
BUG();
! if (read_comp_cache(mapping, offset, cached_page)) {
UnlockPage(cached_page);
goto out;
--- 1042,1046 ----
BUG();
! if (read_comp_cache(mapping, offset, cached_page, 0)) {
UnlockPage(cached_page);
goto out;
***************
*** 1087,1091 ****
lru_cache_add(page);
#ifdef CONFIG_COMP_PAGE_CACHE
! if (!read_comp_cache(mapping, index, page)) {
if (TryLockPage(page))
BUG();
--- 1087,1091 ----
lru_cache_add(page);
#ifdef CONFIG_COMP_PAGE_CACHE
! if (!read_comp_cache(mapping, index, page, 0)) {
if (TryLockPage(page))
BUG();
***************
*** 1365,1369 ****
if ((raend + ahead) >= end_index)
break;
! if (page_cache_read(filp, raend + ahead) < 0)
break;
}
--- 1365,1369 ----
if ((raend + ahead) >= end_index)
break;
! if (page_cache_read(filp, raend + ahead, 0) < 0)
break;
}
***************
*** 1629,1633 ****
#ifdef CONFIG_COMP_PAGE_CACHE
! if (!read_comp_cache(mapping, index, page))
goto page_ok;
#endif
--- 1629,1633 ----
#ifdef CONFIG_COMP_PAGE_CACHE
! if (!read_comp_cache(mapping, index, page, 1))
goto page_ok;
#endif
***************
*** 1936,1940 ****
while (nr) {
! page_cache_read(file, index);
index++;
nr--;
--- 1936,1940 ----
while (nr) {
! page_cache_read(file, index, 0);
index++;
nr--;
***************
*** 2099,2103 ****
error = read_cluster_nonblocking(file, pgoff, size);
else
! error = page_cache_read(file, pgoff);
/*
--- 2099,2103 ----
error = read_cluster_nonblocking(file, pgoff, size);
else
! error = page_cache_read(file, pgoff, 1);
/*
***************
*** 2589,2593 ****
} else {
while ((start < end) && (start < size)) {
! error = page_cache_read(file, start);
start++;
if (error < 0)
--- 2589,2593 ----
} else {
while ((start < end) && (start < size)) {
! error = page_cache_read(file, start, 0);
start++;
if (error < 0)
***************
*** 2932,2936 ****
#ifdef CONFIG_COMP_PAGE_CACHE
! if (read_comp_cache(mapping, index, page))
#endif
err = filler(data, page);
--- 2932,2936 ----
#ifdef CONFIG_COMP_PAGE_CACHE
! if (read_comp_cache(mapping, index, page, 1))
#endif
err = filler(data, page);
Index: swap_state.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/swap_state.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -r1.28 -r1.29
*** swap_state.c 11 Jun 2002 13:20:49 -0000 1.28
--- swap_state.c 13 Jun 2002 20:18:31 -0000 1.29
***************
*** 230,234 ****
err = add_to_swap_cache(new_page, entry);
if (!err) {
! if (!read_comp_cache(&swapper_space, entry.val, new_page)) {
add_compressed_cache_miss();
return new_page;
--- 230,234 ----
err = add_to_swap_cache(new_page, entry);
if (!err) {
! if (!read_comp_cache(&swapper_space, entry.val, new_page, 1)) {
add_compressed_cache_miss();
return new_page;
|