linuxcompressed-checkins Mailing List for Linux Compressed Cache (Page 11)
Status: Beta
Brought to you by:
nitin_sf
You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(31) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(28) |
Feb
(50) |
Mar
(29) |
Apr
(6) |
May
(33) |
Jun
(36) |
Jul
(60) |
Aug
(7) |
Sep
(12) |
Oct
|
Nov
(13) |
Dec
(3) |
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(9) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
(13) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
|
Jun
(22) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Rodrigo S. de C. <rc...@us...> - 2002-03-01 14:30:57
|
Update of /cvsroot/linuxcompressed/linux/include/linux In directory usw-pr-cvs1:/tmp/cvs-serv19251/include/linux Modified Files: mm.h Log Message: - Fixed a bug that showed up when running dbench. When we dirty a clean page which has a compressed cache fragment, we have to invalidate this fragment, since it won't be the current data present in the memory. - mark_inode_dirty_pages() is called in get_comp_cache_page() to avoid possible memory corruption if an inode is synced when we are sleeping to get an entry in compressed cache. - and, of course, still some cleanups. Index: mm.h =================================================================== RCS file: /cvsroot/linuxcompressed/linux/include/linux/mm.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** mm.h 25 Feb 2002 19:34:40 -0000 1.14 --- mm.h 1 Mar 2002 14:30:52 -0000 1.15 *************** *** 306,309 **** --- 306,312 ---- extern void FASTCALL(set_page_dirty(struct page *)); + #ifdef CONFIG_COMP_CACHE + extern void FASTCALL(__set_page_dirty(struct page *)); + #endif /* |
|
From: Rodrigo S. de C. <rc...@us...> - 2002-03-01 14:30:56
|
Update of /cvsroot/linuxcompressed/linux/mm/comp_cache In directory usw-pr-cvs1:/tmp/cvs-serv19251/mm/comp_cache Modified Files: main.c swapin.c swapout.c Log Message: - Fixed a bug that showed up when running dbench. When we dirty a clean page which has a compressed cache fragment, we have to invalidate this fragment, since it won't be the current data present in the memory. - mark_inode_dirty_pages() is called in get_comp_cache_page() to avoid possible memory corruption if an inode is synced when we are sleeping to get an entry in compressed cache. - and, of course, still some cleanups. Index: main.c =================================================================== RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/main.c,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -r1.30 -r1.31 *** main.c 28 Feb 2002 19:05:05 -0000 1.30 --- main.c 1 Mar 2002 14:30:52 -0000 1.31 *************** *** 2,6 **** * linux/mm/comp_cache/main.c * ! * Time-stamp: <2002-02-28 15:29:05 rcastro> * * Linux Virtual Memory Compressed Cache --- 2,6 ---- * linux/mm/comp_cache/main.c * ! * Time-stamp: <2002-03-01 10:09:19 rcastro> * * Linux Virtual Memory Compressed Cache *************** *** 138,145 **** BUG(); invalidate_comp_cache(page->mapping, page->index); ! if (!PageTestandClearCompCache(page)) ! BUG(); ! if (PageDirty(page)) ! BUG(); } --- 138,142 ---- BUG(); invalidate_comp_cache(page->mapping, page->index); ! PageClearCompCache(page); } *************** *** 156,160 **** goto out_failed; ! set_page_dirty(page); ClearPageLaunder(page); goto out_failed; --- 153,157 ---- goto out_failed; ! __set_page_dirty(page); ClearPageLaunder(page); goto out_failed; Index: swapin.c =================================================================== RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapin.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -r1.26 -r1.27 *** swapin.c 28 Feb 2002 19:05:05 -0000 1.26 --- swapin.c 1 Mar 2002 14:30:52 -0000 1.27 *************** *** 2,6 **** * linux/mm/comp_cache/swapin.c * ! * Time-stamp: <2002-02-28 15:11:05 rcastro> * * Linux Virtual Memory Compressed Cache --- 2,6 ---- * linux/mm/comp_cache/swapin.c * ! * Time-stamp: <2002-03-01 10:09:12 rcastro> * * Linux Virtual Memory Compressed Cache *************** *** 51,55 **** BUG(); if (CompFragmentTestandClearDirty(fragment)) ! set_page_dirty(page); } --- 51,55 ---- BUG(); if (CompFragmentTestandClearDirty(fragment)) ! __set_page_dirty(page); } *************** *** 110,114 **** * not temporary swap buffers, for example */ if (!CompFragmentIO(fragment)) ! set_page_dirty(page); list_del(&fragment->mapping_list); list_add(&fragment->mapping_list, &fragment->mapping->clean_comp_pages); --- 110,114 ---- * not temporary swap buffers, for example */ if (!CompFragmentIO(fragment)) ! __set_page_dirty(page); list_del(&fragment->mapping_list); list_add(&fragment->mapping_list, &fragment->mapping->clean_comp_pages); Index: swapout.c =================================================================== RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapout.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -r1.32 -r1.33 *** swapout.c 28 Feb 2002 19:05:05 -0000 1.32 --- swapout.c 1 Mar 2002 14:30:52 -0000 1.33 *************** *** 2,6 **** * /mm/comp_cache/swapout.c * ! * Time-stamp: <2002-02-28 15:25:52 rcastro> * * Linux Virtual Memory Compressed Cache --- 2,6 ---- * /mm/comp_cache/swapout.c * ! * Time-stamp: <2002-03-01 10:45:51 rcastro> * * Linux Virtual Memory Compressed Cache *************** *** 410,413 **** --- 410,418 ---- CompFragmentSetDirty(fragment); list_add(&fragment->mapping_list, &fragment->mapping->dirty_comp_pages); + + /* mark the inode as having dirty pages since the inode might + * have been synced in the meanwhile (if we slept) */ + if (page->mapping->host) + mark_inode_dirty_pages(page->mapping->host); } else |
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-28 19:05:08
|
Update of /cvsroot/linuxcompressed/linux/mm/comp_cache
In directory usw-pr-cvs1:/tmp/cvs-serv1432/mm/comp_cache
Modified Files:
free.c main.c swapin.c swapout.c
Log Message:
- Some cleanups in mm/filemap.c
- Support for shared memory
Index: free.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/free.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** free.c 25 Feb 2002 19:34:41 -0000 1.24
--- free.c 28 Feb 2002 19:05:04 -0000 1.25
***************
*** 2,6 ****
* linux/mm/comp_cache/free.c
*
! * Time-stamp: <2002-02-25 09:04:00 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/free.c
*
! * Time-stamp: <2002-02-28 15:09:09 rcastro>
*
* Linux Virtual Memory Compressed Cache
Index: main.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/main.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -r1.29 -r1.30
*** main.c 27 Feb 2002 19:58:51 -0000 1.29
--- main.c 28 Feb 2002 19:05:05 -0000 1.30
***************
*** 2,6 ****
* linux/mm/comp_cache/main.c
*
! * Time-stamp: <2002-02-27 13:52:02 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/main.c
*
! * Time-stamp: <2002-02-28 15:29:05 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 86,89 ****
--- 86,101 ----
return ((comp_page_stats.comp_size <= PAGE_SIZE)?comp_page_stats.comp_size:PAGE_SIZE);
+ }
+
+ inline int
+ compress_dirty_page(struct page * page, int (*writepage)(struct page *), unsigned int gfp_mask)
+ {
+ int ret;
+
+ if (likely(!shmem_page(page)))
+ ret = compress_page(page, 1, gfp_mask);
+ else
+ ret = writepage(page);
+ return ret;
}
Index: swapin.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapin.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -r1.25 -r1.26
*** swapin.c 27 Feb 2002 19:58:51 -0000 1.25
--- swapin.c 28 Feb 2002 19:05:05 -0000 1.26
***************
*** 2,6 ****
* linux/mm/comp_cache/swapin.c
*
! * Time-stamp: <2002-02-27 16:33:10 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/swapin.c
*
! * Time-stamp: <2002-02-28 15:11:05 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 132,139 ****
goto check_vswap;
! if (TryLockPage(fragment->comp_page->page))
BUG();
!
! if (!page->pprev_hash)
BUG();
--- 132,138 ----
goto check_vswap;
! if (!PageLocked(page))
BUG();
! if (TryLockPage(fragment->comp_page->page))
BUG();
***************
*** 196,200 ****
wait_all_comp_pages(struct address_space * mapping)
{
- struct page **hash;
struct page * page;
--- 195,198 ----
Index: swapout.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapout.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** swapout.c 27 Feb 2002 19:58:51 -0000 1.31
--- swapout.c 28 Feb 2002 19:05:05 -0000 1.32
***************
*** 2,6 ****
* /mm/comp_cache/swapout.c
*
! * Time-stamp: <2002-02-27 16:27:01 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* /mm/comp_cache/swapout.c
*
! * Time-stamp: <2002-02-28 15:25:52 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 80,84 ****
/* it's not swapped out, so let' free it */
! CompFragmentClearIO(swp_buffer->fragment);
comp_cache_free(swp_buffer->fragment);
--- 80,84 ----
/* it's not swapped out, so let' free it */
! CompFragmentClearIO(swp_buffer->fragment);
comp_cache_free(swp_buffer->fragment);
***************
*** 151,155 ****
UnlockPage(fragment->comp_page->page);
-
return swp_buffer;
}
--- 151,154 ----
***************
*** 227,234 ****
BUG();
! writepage = swp_buffer->page->mapping->a_ops->writepage;
if (!writepage)
! BUG();
writepage(swp_buffer->page);
--- 226,233 ----
BUG();
! writepage = fragment->mapping->a_ops->writepage;
if (!writepage)
! BUG();
writepage(swp_buffer->page);
|
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-28 19:05:07
|
Update of /cvsroot/linuxcompressed/linux/mm
In directory usw-pr-cvs1:/tmp/cvs-serv1432/mm
Modified Files:
filemap.c shmem.c vmscan.c
Log Message:
- Some cleanups in mm/filemap.c
- Support for shared memory
Index: filemap.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/filemap.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** filemap.c 27 Feb 2002 19:58:51 -0000 1.17
--- filemap.c 28 Feb 2002 19:05:04 -0000 1.18
***************
*** 975,981 ****
}
else {
- comp_cache_fragment_t * fragment;
- struct page ** hash;
-
if (!cached_page) {
cached_page = page_cache_alloc(mapping);
--- 975,978 ----
***************
*** 983,1008 ****
}
! if (find_comp_page(mapping, offset, &fragment))
! goto out;
- hash = page_hash(mapping, offset);
-
- if (add_to_page_cache_unique(cached_page, mapping, offset, hash))
- goto repeat;
-
if (lookup_comp_cache(mapping, offset, cached_page)) {
- lru_cache_del(cached_page);
- remove_inode_page(cached_page);
- page_cache_release(cached_page);
-
UnlockPage(cached_page);
! goto repeat;
}
page = cached_page;
cached_page = NULL;
-
- if (TryLockPage(page))
- BUG();
}
out:
--- 980,994 ----
}
! if (TryLockPage(cached_page))
! BUG();
if (lookup_comp_cache(mapping, offset, cached_page)) {
UnlockPage(cached_page);
! goto out;
}
+ add_to_page_cache(cached_page, mapping, offset);
page = cached_page;
cached_page = NULL;
}
out:
Index: shmem.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/shmem.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** shmem.c 26 Feb 2002 20:59:01 -0000 1.17
--- shmem.c 28 Feb 2002 19:05:04 -0000 1.18
***************
*** 468,471 ****
--- 468,473 ----
}
+ invalidate_comp_cache(mapping, index);
+
*entry = swap;
info->swapped++;
***************
*** 477,480 ****
--- 479,487 ----
}
+ #ifdef CONFIG_COMP_CACHE
+ int shmem_page(struct page * page) {
+ return (page->mapping->a_ops == &shmem_aops);
+ }
+ #endif
/*
* shmem_getpage_locked - either get the page from swap or allocate a new one
Index: vmscan.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/vmscan.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -r1.29 -r1.30
*** vmscan.c 26 Feb 2002 20:59:01 -0000 1.29
--- vmscan.c 28 Feb 2002 19:05:04 -0000 1.30
***************
*** 416,424 ****
spin_unlock(&pagemap_lru_lock);
! #ifdef CONFIG_COMP_CACHE
! compress_page(page, 1, gfp_mask);
! #else
! writepage(page);
! #endif
page_cache_release(page);
--- 416,421 ----
spin_unlock(&pagemap_lru_lock);
! compress_dirty_page(page, writepage, gfp_mask);
!
page_cache_release(page);
|
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-28 19:05:07
|
Update of /cvsroot/linuxcompressed/linux/include/linux
In directory usw-pr-cvs1:/tmp/cvs-serv1432/include/linux
Modified Files:
comp_cache.h
Log Message:
- Some cleanups in mm/filemap.c
- Support for shared memory
Index: comp_cache.h
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/include/linux/comp_cache.h,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -r1.57 -r1.58
*** comp_cache.h 27 Feb 2002 19:58:51 -0000 1.57
--- comp_cache.h 28 Feb 2002 19:05:04 -0000 1.58
***************
*** 2,6 ****
* linux/mm/comp_cache.h
*
! * Time-stamp: <2002-02-27 16:31:20 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache.h
*
! * Time-stamp: <2002-02-28 15:21:24 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 15,18 ****
--- 15,19 ----
#include <linux/kernel.h>
+ #include <linux/compiler.h>
#include <linux/list.h>
#include <linux/spinlock.h>
***************
*** 94,97 ****
--- 95,100 ----
((struct swp_buffer *) kmem_cache_alloc(comp_cachep, SLAB_ATOMIC))
+ extern int shmem_page(struct page * page);
+
/* adaptivity.c */
#ifdef CONFIG_COMP_CACHE
***************
*** 313,319 ****
--- 316,324 ----
void comp_cache_init(void);
inline void init_comp_page(comp_cache_t **,struct page *);
+ inline int compress_dirty_page(struct page *, int (*writepage)(struct page *), unsigned int);
inline int compress_clean_page(struct page *, unsigned int);
#else
static inline void comp_cache_init(void) {};
+ static inline int compress_dirty_page(struct page * page, int (*writepage)(struct page *), unsigned int gfp_mask) { return writepage(page); }
static inline int compress_clean_page(struct page * page, unsigned int gfp_mask) { return 0; }
#endif
|
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-28 01:04:29
|
Update of /cvsroot/linuxcompressed/linux/fs In directory usw-pr-cvs1:/tmp/cvs-serv26862/fs Modified Files: inode.c Log Message: - Cleanups in comp_cache/main.c - Fix to make filemap_fdatawait() to wait for compressed pages being written out. Index: inode.c =================================================================== RCS file: /cvsroot/linuxcompressed/linux/fs/inode.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** inode.c 25 Feb 2002 19:34:40 -0000 1.2 --- inode.c 27 Feb 2002 19:58:51 -0000 1.3 *************** *** 103,111 **** INIT_LIST_HEAD(&inode->i_data.clean_pages); INIT_LIST_HEAD(&inode->i_data.dirty_pages); #ifdef CONFIG_COMP_CACHE INIT_LIST_HEAD(&inode->i_data.clean_comp_pages); INIT_LIST_HEAD(&inode->i_data.dirty_comp_pages); #endif - INIT_LIST_HEAD(&inode->i_data.locked_pages); INIT_LIST_HEAD(&inode->i_dentry); INIT_LIST_HEAD(&inode->i_dirty_buffers); --- 103,112 ---- INIT_LIST_HEAD(&inode->i_data.clean_pages); INIT_LIST_HEAD(&inode->i_data.dirty_pages); + INIT_LIST_HEAD(&inode->i_data.locked_pages); #ifdef CONFIG_COMP_CACHE INIT_LIST_HEAD(&inode->i_data.clean_comp_pages); INIT_LIST_HEAD(&inode->i_data.dirty_comp_pages); + INIT_LIST_HEAD(&inode->i_data.locked_comp_pages); #endif INIT_LIST_HEAD(&inode->i_dentry); INIT_LIST_HEAD(&inode->i_dirty_buffers); |
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-28 01:04:29
|
Update of /cvsroot/linuxcompressed/linux/mm In directory usw-pr-cvs1:/tmp/cvs-serv26862/mm Modified Files: filemap.c swap_state.c Log Message: - Cleanups in comp_cache/main.c - Fix to make filemap_fdatawait() to wait for compressed pages being written out. Index: filemap.c =================================================================== RCS file: /cvsroot/linuxcompressed/linux/mm/filemap.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** filemap.c 27 Feb 2002 14:16:52 -0000 1.16 --- filemap.c 27 Feb 2002 19:58:51 -0000 1.17 *************** *** 626,633 **** } spin_unlock(&pagecache_lock); - - /* In the case we sleep to get the locks above, some pages - * might get compressed. It may also happen to compress dirty - * pages when allocating new pages in the first loop. */ if (there_are_dirty_comp_pages(mapping)) goto try_again; --- 626,629 ---- *************** *** 646,649 **** --- 642,648 ---- int ret = 0; + try_again: + wait_all_comp_pages(mapping); + spin_lock(&pagecache_lock); *************** *** 668,671 **** --- 667,672 ---- } spin_unlock(&pagecache_lock); + if (there_are_locked_comp_pages(mapping)) + goto try_again; return ret; } Index: swap_state.c =================================================================== RCS file: /cvsroot/linuxcompressed/linux/mm/swap_state.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** swap_state.c 25 Feb 2002 19:34:41 -0000 1.23 --- swap_state.c 27 Feb 2002 19:58:51 -0000 1.24 *************** *** 42,50 **** LIST_HEAD_INIT(swapper_space.clean_pages), LIST_HEAD_INIT(swapper_space.dirty_pages), #ifdef CONFIG_COMP_CACHE LIST_HEAD_INIT(swapper_space.clean_comp_pages), LIST_HEAD_INIT(swapper_space.dirty_comp_pages), #endif - LIST_HEAD_INIT(swapper_space.locked_pages), 0, /* nrpages */ &swap_aops, --- 42,51 ---- LIST_HEAD_INIT(swapper_space.clean_pages), LIST_HEAD_INIT(swapper_space.dirty_pages), + LIST_HEAD_INIT(swapper_space.locked_pages), #ifdef CONFIG_COMP_CACHE LIST_HEAD_INIT(swapper_space.clean_comp_pages), LIST_HEAD_INIT(swapper_space.dirty_comp_pages), + LIST_HEAD_INIT(swapper_space.locked_comp_pages), #endif 0, /* nrpages */ &swap_aops, |
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-28 00:49:02
|
Update of /cvsroot/linuxcompressed/linux/mm/comp_cache
In directory usw-pr-cvs1:/tmp/cvs-serv26862/mm/comp_cache
Modified Files:
main.c swapin.c swapout.c
Log Message:
- Cleanups in comp_cache/main.c
- Fix to make filemap_fdatawait() to wait for compressed pages being written
out.
Index: main.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/main.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -r1.28 -r1.29
*** main.c 27 Feb 2002 14:16:52 -0000 1.28
--- main.c 27 Feb 2002 19:58:51 -0000 1.29
***************
*** 2,6 ****
* linux/mm/comp_cache/main.c
*
! * Time-stamp: <2002-02-26 19:44:33 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/main.c
*
! * Time-stamp: <2002-02-27 13:52:02 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 51,57 ****
int current_algorithm;
- static char buffer_compressed[MAX_COMPRESSED_SIZE];
- struct page * buffer_decompressed;
-
extern unsigned long num_physpages;
--- 51,54 ----
***************
*** 112,117 ****
comp_cache_t * comp_page;
comp_cache_fragment_t * fragment;
! unsigned short aux_comp_size, algorithm;
! static unsigned long current_compressed_page = 0;
if (!page)
--- 109,119 ----
comp_cache_t * comp_page;
comp_cache_fragment_t * fragment;
! unsigned short comp_size, algorithm;
!
! static struct page * current_compressed_page;
! static char buffer_compressed1[MAX_COMPRESSED_SIZE];
! static char buffer_compressed2[MAX_COMPRESSED_SIZE];
! unsigned long * buffer_compressed;
!
if (!page)
***************
*** 130,137 ****
}
! /* compress to a buffer */
! current_compressed_page = (unsigned long) page;
! aux_comp_size = compress(page_address(page), (unsigned long *) &buffer_compressed, &algorithm);
! comp_page = get_comp_cache_page(page, aux_comp_size, &fragment, dirty, gfp_mask);
/* if comp_page == NULL, get_comp_cache_page() gave up
--- 132,137 ----
}
! comp_size = compress(page_address(current_compressed_page = page), buffer_compressed = (unsigned long *) &buffer_compressed1, &algorithm);
! comp_page = get_comp_cache_page(page, comp_size, &fragment, dirty, gfp_mask);
/* if comp_page == NULL, get_comp_cache_page() gave up
***************
*** 149,181 ****
}
! /* TODO: add more buffers for compression. Only one may cause
! * many page to be compressed twice */
!
! if (not_compressed(fragment)) {
! memcpy(page_address(comp_page->page), page_address(page), PAGE_SIZE);
! goto out;
! }
!
! /* someone used the buffer while we slept to get a comp cache
! * entry. Let's compress it again and get a new comp_cache
! * entry, since swap cache page contents might have been
! * messed up and we can't check if that actually happened. */
! if (current_compressed_page != (unsigned long) page) {
! current_compressed_page = (unsigned long) page;
! compress(page_address(page), (unsigned long *) &buffer_compressed, &algorithm);
! }
set_fragment_algorithm(fragment, algorithm);
! if (fragment->offset + fragment->compressed_size > PAGE_SIZE)
! BUG();
!
! memcpy(page_address(comp_page->page) + fragment->offset, (unsigned long *) &buffer_compressed, fragment->compressed_size);
- out:
if (PageTestandSetCompCache(page))
BUG();
UnlockPage(comp_page->page);
-
out_failed:
UnlockPage(page);
--- 149,168 ----
}
! if (fragment->offset + fragment->compressed_size > PAGE_SIZE)
! BUG();
set_fragment_algorithm(fragment, algorithm);
! if (compressed(fragment)) {
! if (current_compressed_page != page)
! compress(page_address(page), buffer_compressed = (unsigned long *) &buffer_compressed2, &algorithm);
! memcpy(page_address(comp_page->page) + fragment->offset, buffer_compressed , fragment->compressed_size);
! } else
! memcpy(page_address(comp_page->page), page_address(page), PAGE_SIZE);
!
if (PageTestandSetCompCache(page))
BUG();
UnlockPage(comp_page->page);
out_failed:
UnlockPage(page);
***************
*** 275,283 ****
current_algorithm = WKDM_IDX;
-
- buffer_decompressed = alloc_page(GFP_KERNEL);
-
- if (!buffer_decompressed)
- panic("comp_cache_init(): cannot allocate page");
}
--- 262,265 ----
Index: swapin.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapin.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** swapin.c 27 Feb 2002 14:16:52 -0000 1.24
--- swapin.c 27 Feb 2002 19:58:51 -0000 1.25
***************
*** 2,6 ****
* linux/mm/comp_cache/swapin.c
*
! * Time-stamp: <2002-02-27 09:09:07 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/swapin.c
*
! * Time-stamp: <2002-02-27 16:33:10 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 109,113 ****
/* we want to set dirty only actually mapped pages,
* not temporary swap buffers, for example */
! if (!list_empty(&page->list))
set_page_dirty(page);
list_del(&fragment->mapping_list);
--- 109,113 ----
/* we want to set dirty only actually mapped pages,
* not temporary swap buffers, for example */
! if (!CompFragmentIO(fragment))
set_page_dirty(page);
list_del(&fragment->mapping_list);
***************
*** 191,194 ****
--- 191,209 ----
{
truncate_list_comp_pages(&mapping->clean_comp_pages, 0, 0);
+ }
+
+ void
+ wait_all_comp_pages(struct address_space * mapping)
+ {
+ struct page **hash;
+ struct page * page;
+
+ while (!list_empty(&mapping->locked_comp_pages)) {
+ page = list_entry(mapping->locked_comp_pages.next, struct page, list);
+
+ list_del_init(&page->list);
+
+ wait_on_page(page);
+ }
}
Index: swapout.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapout.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** swapout.c 27 Feb 2002 14:16:52 -0000 1.30
--- swapout.c 27 Feb 2002 19:58:51 -0000 1.31
***************
*** 2,6 ****
* /mm/comp_cache/swapout.c
*
! * Time-stamp: <2002-02-26 19:54:15 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* /mm/comp_cache/swapout.c
*
! * Time-stamp: <2002-02-27 16:27:01 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 24,31 ****
/**
! * - find_free_swp_buffer - gets a swap buffer page. If there's a
! * free buffer page, it will lock the page and return. Otherwise we
! * may sleep to get the lock.
! * - return value: pointer to the page which will be returned locked */
static struct swp_buffer *
find_free_swp_buffer(comp_cache_fragment_t * fragment)
--- 24,35 ----
/**
! * find_free_swp_buffer - gets a swap buffer page
! * @fragment: the fragment which will be decompressed to this buffer
! * page.
! *
! * If there's a free buffer page, it will lock the page and
! * return. Otherwise we may sleep to get the lock.
! *
! */
static struct swp_buffer *
find_free_swp_buffer(comp_cache_fragment_t * fragment)
***************
*** 36,39 ****
--- 40,46 ----
int wait;
+ if (!fragment)
+ BUG();
+
CompFragmentSetIO(fragment);
***************
*** 53,56 ****
--- 60,65 ----
}
+ list_del(&swp_buffer->page->list);
+
if (swp_buffer->page->buffers && !try_to_free_buffers(swp_buffer->page, GFP_KERNEL))
BUG();
***************
*** 111,115 ****
buffer_page->index = fragment->index;
! buffer_page->mapping = fragment->mapping;
return (swp_buffer);
--- 120,126 ----
buffer_page->index = fragment->index;
! buffer_page->mapping = fragment->mapping;
!
! list_add(&buffer_page->list, &fragment->mapping->locked_comp_pages);
return (swp_buffer);
|
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-28 00:37:45
|
Update of /cvsroot/linuxcompressed/linux/include/linux
In directory usw-pr-cvs1:/tmp/cvs-serv26862/include/linux
Modified Files:
comp_cache.h fs.h
Log Message:
- Cleanups in comp_cache/main.c
- Fix to make filemap_fdatawait() to wait for compressed pages being written
out.
Index: comp_cache.h
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/include/linux/comp_cache.h,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -r1.56 -r1.57
*** comp_cache.h 27 Feb 2002 14:16:52 -0000 1.56
--- comp_cache.h 27 Feb 2002 19:58:51 -0000 1.57
***************
*** 2,6 ****
* linux/mm/comp_cache.h
*
! * Time-stamp: <2002-02-26 19:25:16 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache.h
*
! * Time-stamp: <2002-02-27 16:31:20 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 292,297 ****
--- 292,299 ----
void invalidate_comp_pages(struct address_space *);
void truncate_comp_pages(struct address_space *, unsigned long, unsigned);
+ void wait_all_comp_pages(struct address_space *);
void lookup_all_comp_pages(struct address_space *);
#define there_are_dirty_comp_pages(mapping) (!list_empty(&(mapping)->dirty_comp_pages))
+ #define there_are_locked_comp_pages(mapping) (!list_empty(&(mapping)->locked_comp_pages))
#else
static inline int lookup_comp_cache(struct address_space * mapping, unsigned long offset, struct page * page) { return -ENOENT; }
***************
*** 300,305 ****
--- 302,309 ----
static inline void invalidate_comp_pages(struct address_space * mapping) { };
static inline void truncate_comp_pages(struct address_space * mapping, unsigned long start, unsigned partial) { };
+ static inline void wait_all_comp_pages(struct address_space * mapping) { };
static inline void lookup_all_comp_pages(struct address_space * mapping) { };
#define there_are_dirty_comp_pages(mapping) 0
+ #define there_are_locked_comp_pages(mapping) 0
#endif
Index: fs.h
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/include/linux/fs.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** fs.h 26 Feb 2002 20:59:01 -0000 1.3
--- fs.h 27 Feb 2002 19:58:51 -0000 1.4
***************
*** 398,406 ****
struct list_head clean_pages; /* list of clean pages */
struct list_head dirty_pages; /* list of dirty pages */
#ifdef CONFIG_COMP_CACHE
struct list_head clean_comp_pages; /* list of clean compressed pages */
struct list_head dirty_comp_pages; /* list of dirty compressed pages */
#endif
- struct list_head locked_pages; /* list of locked pages */
unsigned long nrpages; /* number of total pages */
struct address_space_operations *a_ops; /* methods */
--- 398,407 ----
struct list_head clean_pages; /* list of clean pages */
struct list_head dirty_pages; /* list of dirty pages */
+ struct list_head locked_pages; /* list of locked pages */
#ifdef CONFIG_COMP_CACHE
struct list_head clean_comp_pages; /* list of clean compressed pages */
struct list_head dirty_comp_pages; /* list of dirty compressed pages */
+ struct list_head locked_comp_pages; /* list of locked compressed pages */
#endif
unsigned long nrpages; /* number of total pages */
struct address_space_operations *a_ops; /* methods */
|
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-27 14:16:56
|
Update of /cvsroot/linuxcompressed/linux/mm/comp_cache
In directory usw-pr-cvs1:/tmp/cvs-serv23908/mm/comp_cache
Modified Files:
main.c swapin.c swapout.c
Log Message:
- Clean pages support in compressed cache is improved even more.
- Clean and dirty pages are only removed from the compressed cache
when writeout_fragments() is called or the program exits.
- removed an obsolete code for CONFIG_COMP_SWAP
- improved writeout_fragments(), which will try to free fragments even
if we can't perform IO. In this case, we will free only clean
fragments.
Index: main.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/main.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -r1.27 -r1.28
*** main.c 26 Feb 2002 20:59:01 -0000 1.27
--- main.c 27 Feb 2002 14:16:52 -0000 1.28
***************
*** 2,6 ****
* linux/mm/comp_cache/main.c
*
! * Time-stamp: <2002-02-26 13:37:55 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/main.c
*
! * Time-stamp: <2002-02-26 19:44:33 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 123,127 ****
if (!dirty)
BUG();
! invalidate_comp_page(page->mapping, page->index, page);
if (PageDirty(page))
BUG();
--- 123,129 ----
if (!dirty)
BUG();
! invalidate_comp_cache(page->mapping, page->index);
! if (!PageTestandClearCompCache(page))
! BUG();
if (PageDirty(page))
BUG();
Index: swapin.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapin.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** swapin.c 26 Feb 2002 16:01:10 -0000 1.23
--- swapin.c 27 Feb 2002 14:16:52 -0000 1.24
***************
*** 2,6 ****
* linux/mm/comp_cache/swapin.c
*
! * Time-stamp: <2002-02-26 11:42:51 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/swapin.c
*
! * Time-stamp: <2002-02-27 09:09:07 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 19,42 ****
void
! invalidate_comp_page(struct address_space *mapping, unsigned long offset, struct page * page) {
comp_cache_fragment_t * fragment;
int err = find_comp_page(mapping, offset, &fragment);
if (err) {
/* if the fragment has been written out, we may have
* CompCache flag, but no fragment in Comp Cache */
! if (page)
! PageClearCompCache(page);
return;
}
! if (page) {
! if (!PageTestandClearCompCache(page))
! BUG();
! if (CompFragmentDirty(fragment))
! set_page_dirty(page);
! }
!
! comp_cache_free(fragment);
}
--- 19,55 ----
void
! invalidate_comp_cache(struct address_space *mapping, unsigned long offset)
! {
comp_cache_fragment_t * fragment;
int err = find_comp_page(mapping, offset, &fragment);
+
+ if (err)
+ return;
+
+ comp_cache_free(fragment);
+ }
+ void
+ clear_comp_page(struct address_space *mapping, unsigned long offset, struct page * page)
+ {
+ comp_cache_fragment_t * fragment;
+ int err;
+
+ if (!PageCompCache(page))
+ return;
+
+ err = find_comp_page(mapping, offset, &fragment);
+
if (err) {
/* if the fragment has been written out, we may have
* CompCache flag, but no fragment in Comp Cache */
! PageClearCompCache(page);
return;
}
! if (!PageCompCache(page))
! BUG();
! if (CompFragmentTestandClearDirty(fragment))
! set_page_dirty(page);
}
***************
*** 102,105 ****
--- 115,119 ----
}
SetPageUptodate(page);
+ PageSetCompCache(page);
}
***************
*** 129,140 ****
compression_algorithms[current_algorithm].stats.pgccin++;
! /* NOTE: we have to make sure to free the fragment only when
! * the page fault has been serviced since we may shrink the
! * cache and move down the vswap entry */
! comp_cache_free_locked(fragment);
!
! PageClearCompCache(page);
! UnlockPage(page);
!
return 0;
--- 143,148 ----
compression_algorithms[current_algorithm].stats.pgccin++;
! UnlockPage(fragment->comp_page->page);
! UnlockPage(page);
return 0;
***************
*** 231,235 ****
UnlockPage(fragment->comp_page->page);
- PageSetCompCache(page);
page_cache_release(page);
UnlockPage(page);
--- 239,242 ----
Index: swapout.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapout.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -r1.29 -r1.30
*** swapout.c 26 Feb 2002 16:01:10 -0000 1.29
--- swapout.c 27 Feb 2002 14:16:52 -0000 1.30
***************
*** 2,6 ****
* /mm/comp_cache/swapout.c
*
! * Time-stamp: <2002-02-26 12:53:44 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* /mm/comp_cache/swapout.c
*
! * Time-stamp: <2002-02-26 19:54:15 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 151,155 ****
* we have a comp_page where we can store the new page */
static void
! writeout_fragments(void) {
int (*writepage)(struct page *);
struct list_head * fragment_lh, * next_fragment;
--- 151,155 ----
* we have a comp_page where we can store the new page */
static void
! writeout_fragments(unsigned int gfp_mask) {
int (*writepage)(struct page *);
struct list_head * fragment_lh, * next_fragment;
***************
*** 169,184 ****
page = fragment->comp_page->page;
! /* page locked? move it to the back of the list */
! if (TryLockPage(page)) {
! list_del(fragment_lh);
! list_add(fragment_lh, &lru_queue);
! maxscan++;
continue;
- }
if (!CompFragmentDirty(fragment)) {
comp_cache_free_locked(fragment);
continue;
}
swap_cache_page = 0;
--- 169,191 ----
page = fragment->comp_page->page;
! /* move it to the back of the list */
! list_del(fragment_lh);
! list_add(fragment_lh, &lru_queue);
!
! /* page locked */
! if (TryLockPage(page))
continue;
+ /* clean page, let's free it */
if (!CompFragmentDirty(fragment)) {
comp_cache_free_locked(fragment);
continue;
}
+
+ /* we can't perform IO, so we can't go on */
+ if (!(gfp_mask & __GFP_FS)) {
+ UnlockPage(page);
+ continue;
+ }
swap_cache_page = 0;
***************
*** 301,311 ****
}
! if (!(gfp_mask & __GFP_FS))
! goto failed;
!
! writeout_fragments();
}
- failed:
return NULL;
--- 308,314 ----
}
! writeout_fragments(gfp_mask);
}
return NULL;
|
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-27 14:16:56
|
Update of /cvsroot/linuxcompressed/linux/include/linux
In directory usw-pr-cvs1:/tmp/cvs-serv23908/include/linux
Modified Files:
comp_cache.h swap.h
Log Message:
- Clean pages support in compressed cache is improved even more.
- Clean and dirty pages are only removed from the compressed cache
when writeout_fragments() is called or the program exits.
- removed an obsolete code for CONFIG_COMP_SWAP
- improved writeout_fragments(), which will try to free fragments even
if we can't perform IO. In this case, we will free only clean
fragments.
Index: comp_cache.h
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/include/linux/comp_cache.h,v
retrieving revision 1.55
retrieving revision 1.56
diff -C2 -r1.55 -r1.56
*** comp_cache.h 26 Feb 2002 20:59:01 -0000 1.55
--- comp_cache.h 27 Feb 2002 14:16:52 -0000 1.56
***************
*** 2,6 ****
* linux/mm/comp_cache.h
*
! * Time-stamp: <2002-02-26 13:48:02 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache.h
*
! * Time-stamp: <2002-02-26 19:25:16 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 288,292 ****
#ifdef CONFIG_COMP_CACHE
int lookup_comp_cache(struct address_space *, unsigned long, struct page *);
! void invalidate_comp_page(struct address_space *, unsigned long, struct page *);
void invalidate_comp_pages(struct address_space *);
void truncate_comp_pages(struct address_space *, unsigned long, unsigned);
--- 288,293 ----
#ifdef CONFIG_COMP_CACHE
int lookup_comp_cache(struct address_space *, unsigned long, struct page *);
! void invalidate_comp_cache(struct address_space *, unsigned long);
! void clear_comp_page(struct address_space *, unsigned long, struct page *);
void invalidate_comp_pages(struct address_space *);
void truncate_comp_pages(struct address_space *, unsigned long, unsigned);
***************
*** 295,299 ****
#else
static inline int lookup_comp_cache(struct address_space * mapping, unsigned long offset, struct page * page) { return -ENOENT; }
! static inline void invalidate_comp_page(struct address_space * mapping, unsigned long offset, struct page * page) { };
static inline void invalidate_comp_pages(struct address_space * mapping) { };
static inline void truncate_comp_pages(struct address_space * mapping, unsigned long start, unsigned partial) { };
--- 296,301 ----
#else
static inline int lookup_comp_cache(struct address_space * mapping, unsigned long offset, struct page * page) { return -ENOENT; }
! static inline void invalidate_comp_cache(struct address_space * mapping, unsigned long offset) { };
! static inline void clear_comp_page(struct address_space * mapping, unsigned long offset, struct page * page) { };
static inline void invalidate_comp_pages(struct address_space * mapping) { };
static inline void truncate_comp_pages(struct address_space * mapping, unsigned long start, unsigned partial) { };
Index: swap.h
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/include/linux/swap.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** swap.h 13 Dec 2001 19:12:57 -0000 1.13
--- swap.h 27 Feb 2002 14:16:52 -0000 1.14
***************
*** 79,85 ****
struct vfsmount *swap_vfsmnt;
unsigned short * swap_map;
- #ifdef CONFIG_COMP_SWAP
- unsigned short * swap_comp;
- #endif
unsigned int lowest_bit;
unsigned int highest_bit;
--- 79,82 ----
|
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-27 14:16:56
|
Update of /cvsroot/linuxcompressed/linux/mm
In directory usw-pr-cvs1:/tmp/cvs-serv23908/mm
Modified Files:
filemap.c memory.c swapfile.c
Log Message:
- Clean pages support in compressed cache is improved even more.
- Clean and dirty pages are only removed from the compressed cache
when writeout_fragments() is called or the program exits.
- removed an obsolete code for CONFIG_COMP_SWAP
- improved writeout_fragments(), which will try to free fragments even
if we can't perform IO. In this case, we will free only clean
fragments.
Index: filemap.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/filemap.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** filemap.c 26 Feb 2002 20:59:01 -0000 1.15
--- filemap.c 27 Feb 2002 14:16:52 -0000 1.16
***************
*** 755,759 ****
spin_unlock(&pagecache_lock);
if (page) {
! invalidate_comp_page(mapping, offset, page);
return 0;
}
--- 755,759 ----
spin_unlock(&pagecache_lock);
if (page) {
! clear_comp_page(mapping, offset, page);
return 0;
}
***************
*** 916,920 ****
if (page) {
page_cache_get(page);
! invalidate_comp_page(mapping, offset, page);
}
spin_unlock(&pagecache_lock);
--- 916,920 ----
if (page) {
page_cache_get(page);
! clear_comp_page(mapping, offset, page);
}
spin_unlock(&pagecache_lock);
***************
*** 971,975 ****
}
}
! invalidate_comp_page(mapping, offset, page);
}
else {
--- 971,975 ----
}
}
! clear_comp_page(mapping, offset, page);
}
else {
***************
*** 1459,1463 ****
found_page:
page_cache_get(page);
! invalidate_comp_page(mapping, index, page);
spin_unlock(&pagecache_lock);
--- 1459,1463 ----
found_page:
page_cache_get(page);
! clear_comp_page(mapping, index, page);
spin_unlock(&pagecache_lock);
Index: memory.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/memory.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** memory.c 26 Feb 2002 20:59:01 -0000 1.23
--- memory.c 27 Feb 2002 14:16:52 -0000 1.24
***************
*** 1192,1196 ****
remove_pte_vswap(page_table);
! invalidate_comp_page(page->mapping, page->index, page);
/* The page isn't present yet, go ahead with the fault. */
--- 1192,1196 ----
remove_pte_vswap(page_table);
! clear_comp_page(page->mapping, page->index, page);
/* The page isn't present yet, go ahead with the fault. */
Index: swapfile.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/swapfile.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -r1.27 -r1.28
*** swapfile.c 26 Feb 2002 20:59:01 -0000 1.27
--- swapfile.c 27 Feb 2002 14:16:52 -0000 1.28
***************
*** 215,219 ****
if (!count) {
entry = SWP_ENTRY(p - swap_info, offset);
! invalidate_comp_page(&swapper_space, entry.val, NULL);
if (offset < p->lowest_bit)
p->lowest_bit = offset;
--- 215,219 ----
if (!count) {
entry = SWP_ENTRY(p - swap_info, offset);
! invalidate_comp_cache(&swapper_space, entry.val);
if (offset < p->lowest_bit)
p->lowest_bit = offset;
|
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-26 20:59:07
|
Update of /cvsroot/linuxcompressed/linux/include/linux
In directory usw-pr-cvs1:/tmp/cvs-serv20377/include/linux
Modified Files:
comp_cache.h fs.h
Log Message:
- Update to 2.4.18
- Some minor changes to make the code compile when CONFIG_COMP_CACHE is
disabled
Index: comp_cache.h
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/include/linux/comp_cache.h,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -r1.54 -r1.55
*** comp_cache.h 26 Feb 2002 16:01:10 -0000 1.54
--- comp_cache.h 26 Feb 2002 20:59:01 -0000 1.55
***************
*** 2,6 ****
* linux/mm/comp_cache.h
*
! * Time-stamp: <2002-02-25 17:18:28 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache.h
*
! * Time-stamp: <2002-02-26 13:48:02 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 292,310 ****
void truncate_comp_pages(struct address_space *, unsigned long, unsigned);
void lookup_all_comp_pages(struct address_space *);
#else
! static inline int lookup_comp_cache(swp_entry_t entry) { return 0; }
static inline void invalidate_comp_page(struct address_space * mapping, unsigned long offset, struct page * page) { };
static inline void invalidate_comp_pages(struct address_space * mapping) { };
static inline void truncate_comp_pages(struct address_space * mapping, unsigned long start, unsigned partial) { };
static inline void lookup_all_comp_pages(struct address_space * mapping) { };
#endif
/* main.c */
#ifdef CONFIG_COMP_CACHE
! int compress_page(struct page *, int, unsigned int);
void comp_cache_init(void);
inline void init_comp_page(comp_cache_t **,struct page *);
#else
static inline void comp_cache_init(void) {};
#endif
--- 292,314 ----
void truncate_comp_pages(struct address_space *, unsigned long, unsigned);
void lookup_all_comp_pages(struct address_space *);
+ #define there_are_dirty_comp_pages(mapping) (!list_empty(&(mapping)->dirty_comp_pages))
#else
! static inline int lookup_comp_cache(struct address_space * mapping, unsigned long offset, struct page * page) { return -ENOENT; }
static inline void invalidate_comp_page(struct address_space * mapping, unsigned long offset, struct page * page) { };
static inline void invalidate_comp_pages(struct address_space * mapping) { };
static inline void truncate_comp_pages(struct address_space * mapping, unsigned long start, unsigned partial) { };
static inline void lookup_all_comp_pages(struct address_space * mapping) { };
+ #define there_are_dirty_comp_pages(mapping) 0
#endif
/* main.c */
#ifdef CONFIG_COMP_CACHE
! int compress_page(struct page *, int, unsigned int);
void comp_cache_init(void);
inline void init_comp_page(comp_cache_t **,struct page *);
+ inline int compress_clean_page(struct page *, unsigned int);
#else
static inline void comp_cache_init(void) {};
+ static inline int compress_clean_page(struct page * page, unsigned int gfp_mask) { return 0; }
#endif
***************
*** 366,375 ****
static inline void comp_cache_swp_duplicate(swp_entry_t entry) {};
! static inline int comp_cache_swp_free_generic(swp_entry_t entry, int free_fragment) { return 0; }
! static inline int comp_cache_swp_count(swp_entry_t entry) { return 0; }
static inline int comp_cache_available_space(void) { return 0; }
! static inline swp_entry_t get_virtual_swap_page(struct page * page, unsigned short count) { return ((swp_entry_t) { 0 }); }
static inline void remap_vswap_ptes(swp_entry_t entry, struct page * page) {};
--- 370,379 ----
static inline void comp_cache_swp_duplicate(swp_entry_t entry) {};
! static inline int comp_cache_swp_free(swp_entry_t entry) { return 0; }
! static inline int comp_cache_swp_count(swp_entry_t entry) { return 0; }
static inline int comp_cache_available_space(void) { return 0; }
! static inline swp_entry_t get_virtual_swap_page(void) { return (swp_entry_t) { 0 }; }
static inline void remap_vswap_ptes(swp_entry_t entry, struct page * page) {};
***************
*** 431,437 ****
/* aux.c */
unsigned long long big_division(unsigned long long, unsigned long long);
- inline int find_comp_page(struct address_space *, unsigned long, comp_cache_fragment_t **);
- comp_cache_t * find_and_lock_comp_page(swp_entry_t, comp_cache_fragment_t **);
inline void check_all_fragments(comp_cache_t *);
--- 435,439 ----
***************
*** 487,492 ****
--- 489,496 ----
#ifdef CONFIG_COMP_CACHE
inline int comp_cache_free_space(void);
+ inline int find_comp_page(struct address_space *, unsigned long, comp_cache_fragment_t **);
#else
static inline int comp_cache_free_space(void) { return 0; }
+ static inline int find_comp_page(struct address_space * mapping, unsigned long offset, comp_cache_fragment_t ** fragment) { return -ENOENT; }
#endif
Index: fs.h
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/include/linux/fs.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** fs.h 25 Feb 2002 19:34:40 -0000 1.2
--- fs.h 26 Feb 2002 20:59:01 -0000 1.3
***************
*** 109,112 ****
--- 109,113 ----
#define MS_NODIRATIME 2048 /* Do not update directory access times */
#define MS_BIND 4096
+ #define MS_MOVE 8192
#define MS_REC 16384
#define MS_VERBOSE 32768
***************
*** 1217,1222 ****
extern int fsync_inode_data_buffers(struct inode *);
extern int inode_has_buffers(struct inode *);
! extern void filemap_fdatasync(struct address_space *);
! extern void filemap_fdatawait(struct address_space *);
extern void sync_supers(kdev_t);
extern int bmap(struct inode *, int);
--- 1218,1223 ----
extern int fsync_inode_data_buffers(struct inode *);
extern int inode_has_buffers(struct inode *);
! extern int filemap_fdatasync(struct address_space *);
! extern int filemap_fdatawait(struct address_space *);
extern void sync_supers(kdev_t);
extern int bmap(struct inode *, int);
***************
*** 1370,1373 ****
--- 1371,1386 ----
extern int set_blocksize(kdev_t, int);
extern struct buffer_head * bread(kdev_t, int, int);
+ static inline struct buffer_head * sb_bread(struct super_block *sb, int block)
+ {
+ return bread(sb->s_dev, block, sb->s_blocksize);
+ }
+ static inline struct buffer_head * sb_getblk(struct super_block *sb, int block)
+ {
+ return getblk(sb->s_dev, block, sb->s_blocksize);
+ }
+ static inline struct buffer_head * sb_get_hash_table(struct super_block *sb, int block)
+ {
+ return get_hash_table(sb->s_dev, block, sb->s_blocksize);
+ }
extern void wakeup_bdflush(void);
extern void put_unused_buffer_head(struct buffer_head * bh);
***************
*** 1389,1392 ****
--- 1402,1406 ----
extern int cont_prepare_write(struct page*, unsigned, unsigned, get_block_t*,
unsigned long *);
+ extern int generic_cont_expand(struct inode *inode, loff_t size) ;
extern int block_commit_write(struct page *page, unsigned from, unsigned to);
extern int block_sync_page(struct page *);
***************
*** 1396,1401 ****
int block_truncate_page(struct address_space *, loff_t, get_block_t *);
extern int generic_direct_IO(int, struct inode *, struct kiobuf *, unsigned long, int, get_block_t *);
- extern int waitfor_one_page(struct page*);
extern int generic_file_mmap(struct file *, struct vm_area_struct *);
extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
--- 1410,1416 ----
int block_truncate_page(struct address_space *, loff_t, get_block_t *);
extern int generic_direct_IO(int, struct inode *, struct kiobuf *, unsigned long, int, get_block_t *);
+ extern int waitfor_one_page(struct page *);
+ extern int writeout_one_page(struct page *);
extern int generic_file_mmap(struct file *, struct vm_area_struct *);
extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size);
|
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-26 20:59:07
|
Update of /cvsroot/linuxcompressed/linux/Documentation
In directory usw-pr-cvs1:/tmp/cvs-serv20377/Documentation
Modified Files:
Configure.help
Log Message:
- Update to 2.4.18
- Some minor changes to make the code compile when CONFIG_COMP_CACHE is
disabled
Index: Configure.help
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/Documentation/Configure.help,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** Configure.help 26 Feb 2002 16:07:31 -0000 1.4
--- Configure.help 26 Feb 2002 20:59:01 -0000 1.5
***************
*** 2467,2470 ****
--- 2467,2478 ----
<file:Documentation/modules.txt>. If unsure, say `N'.
+ AH/ESP match support
+ CONFIG_IP_NF_MATCH_AH_ESP
+ These two match extensions (`ah' and `esp') allow you to match a
+ range of SPIs inside AH or ESP headers of IPSec packets.
+
+ If you want to compile it as a module, say M here and read
+ Documentation/modules.txt. If unsure, say `N'.
+
TOS match support
CONFIG_IP_NF_MATCH_TOS
***************
*** 2634,2637 ****
--- 2642,2658 ----
<file:Documentation/modules.txt>. If unsure, say `N'.
+ ULOG target support
+ CONFIG_IP_NF_TARGET_ULOG
+ This option adds a `ULOG' target, which allows you to create rules in
+ any iptables table. The packet is passed to a userspace logging
+ daemon using netlink multicast sockets; unlike the LOG target
+ which can only be viewed through syslog.
+
+ The apropriate userspace logging daemon (ulogd) may be obtained from
+ http://www.gnumonks.org/projects/ulogd
+
+ If you want to compile it as a module, say M here and read
+ Documentation/modules.txt. If unsure, say `N'.
+
LOG target support
CONFIG_IP_NF_TARGET_LOG
***************
*** 2690,2693 ****
--- 2711,2731 ----
<file:Documentation/modules.txt>. If unsure, say `N'.
+ IPV6 queue handler (EXPERIMENTAL)
+ CONFIG_IP6_NF_QUEUE
+
+ This option adds a queue handler to the kernel for IPv6
+ packets which lets us to receive the filtered packets
+ with QUEUE target using libiptc as we can do with
+ the IPv4 now.
+
+ (C) Fernando Anton 2001
+ IPv64 Project - Work based in IPv64 draft by Arturo Azcorra.
+ Universidad Carlos III de Madrid
+ Universidad Politecnica de Alcala de Henares
+ email: fa...@it...
+
+ If you want to compile it as a module, say M here and read
+ Documentation/modules.txt. If unsure, say `N'.
+
Owner match support
CONFIG_IP6_NF_MATCH_OWNER
***************
*** 3226,3229 ****
--- 3264,3277 ----
use GLX or DRI. If unsure, say N.
+ Intel 460GX support
+ CONFIG_AGP_I460
+ This option gives you AGP support for the Intel 460GX chipset. This
+ chipset, the first to support Intel Itanium processors, is new and
+ this option is correspondingly a little experimental.
+
+ If you don't have a 460GX based machine (such as BigSur) with an AGP
+ slot then this option isn't going to do you much good. If you're
+ dying to do Direct Rendering on IA-64, this is what you're looking for.
+
Intel I810/I815 DC100/I810e support
CONFIG_AGP_I810
***************
*** 3834,3837 ****
--- 3882,3886 ----
- "K6" for the AMD K6, K6-II and K6-III (aka K6-3D).
- "Athlon" for the AMD K7 family (Athlon/Duron/Thunderbird).
+ - "Elan" for the AMD Elan family (Elan SC400/SC410).
- "Crusoe" for the Transmeta Crusoe series.
- "Winchip-C6" for original IDT Winchip.
***************
*** 4090,4093 ****
--- 4139,4155 ----
module, say M here and read <file:Documentation/modules.txt>.
+ Trident Blade/Image support
+ CONFIG_FB_TRIDENT
+ This driver is supposed to support graphics boards with the
+ Trident CyberXXXX/Image/CyberBlade chips mostly found in laptops
+ but also on some motherboards.Read <file:Documentation/fb/tridentfb.txt>
+
+ Say Y if you have such a graphics board.
+
+ The driver is also available as a module ( = code which can be
+ inserted and removed from the running kernel whenever you want). The
+ module will be called rivafb.o. If you want to compile it as a
+ module, say M here and read <file:Documentation/modules.txt>.
+
ATI Mach64 display support
CONFIG_FB_ATY
***************
*** 4371,4379 ****
Matrox unified accelerated driver
CONFIG_FB_MATROX
! Say Y here if you have a Matrox Millennium, Matrox Millennium II,
! Matrox Mystique, Matrox Mystique 220, Matrox Productiva G100, Matrox
! Mystique G200, Matrox Millennium G200, Matrox Marvel G200 video,
! Matrox G400 or G450 card in your box. At this time, support for the
! G100 is untested and support for G450 is highly experimental.
This driver is also available as a module ( = code which can be
--- 4433,4439 ----
Matrox unified accelerated driver
CONFIG_FB_MATROX
! Say Y here if you have a Matrox Millennium, Millennium II, Mystique,
! Mystique 220, Productiva G100, Mystique G200, Millennium G200,
! Marvel G200 video, G400, G450, or G550 card in your box.
This driver is also available as a module ( = code which can be
***************
*** 4402,4411 ****
different from 8.
! Matrox G100/G200/G400/G450 support
CONFIG_FB_MATROX_G100
! Say Y here if you have a Matrox G100, G200, G400 or G450 based
! video card. If you select "Advanced lowlevel driver options", you
! should check 8 bpp packed pixel, 16 bpp packed pixel, 24 bpp packed
! pixel and 32 bpp packed pixel. You can also use font widths
different from 8.
--- 4462,4471 ----
different from 8.
! Matrox G100/G200/G400/G450/G550 support
CONFIG_FB_MATROX_G100
! Say Y here if you have a Matrox G100, G200, G400, G450, or G550
! based video card. If you select "Advanced lowlevel driver options",
! you should check 8 bpp packed pixel, 16 bpp packed pixel, 24 bpp
! packed pixel and 32 bpp packed pixel. You can also use font widths
different from 8.
***************
*** 4415,4418 ****
--- 4475,4481 ----
support" here in the framebuffer section.
+ If you need support for G450 or G550 secondary head, say Y to
+ "Matrox G450/G550 second head support" below.
+
Matrox I2C support
CONFIG_FB_MATROX_I2C
***************
*** 4461,4465 ****
CONFIG_FB_MATROX_G450
Say Y or M here if you want to use a secondary head (meaning two
! monitors in parallel) on G450.
If you compile it as module, two modules are created,
--- 4524,4528 ----
CONFIG_FB_MATROX_G450
Say Y or M here if you want to use a secondary head (meaning two
! monitors in parallel) on G450 or G550.
If you compile it as module, two modules are created,
***************
*** 4473,4476 ****
--- 4536,4542 ----
start in 640x480 resolution and you must use fbset to change it.
+ Note on most G550 cards the analog output is the secondary head,
+ so you will need to say Y here to use it.
+
Also do not forget that second head supports only 16 and 32 bpp
packed pixels, so it is a good idea to compile them into the kernel
***************
*** 10819,10822 ****
--- 10885,10897 ----
<http://www.scyld.com/network/natsemi.html>.
+ NatSemi workaround for high errors
+ CONFIG_NATSEMI_CABLE_MAGIC
+ Some systems see lots of errors with NatSemi ethernet controllers
+ on certain cables. If you are seeing lots of errors, try turning
+ this option on. Some boards have incorrect values for supporting
+ resistors that can cause this change to break. If you turn this
+ option on and your network suddenly stops working, turn this
+ option off.
+
SK_G16 support
CONFIG_SK_G16
***************
*** 12929,12932 ****
--- 13004,13018 ----
module, say M here and read <file:Documentation/modules.txt>.
+ USB Compaq iPAQ Driver
+ CONFIG_USB_SERIAL_IPAQ
+ Say Y here if you want to connect to your Compaq iPAQ running
+ Windows CE 3.0 using a USB autosync cable. For information on using
+ the driver, read <file:Documentation/usb/usb-serial.txt>.
+
+ This code is also available as a module ( = code which can be
+ inserted in and removed from the running kernel whenever you want).
+ The module will be called ipaq.o. If you want to compile it as a
+ module, say M here and read <file:Documentation/modules.txt>.
+
USB IR Dongle Serial Driver
CONFIG_USB_SERIAL_IR
***************
*** 13138,13141 ****
--- 13224,13243 ----
as a module, say M here and read <file:Documentation/modules.txt>.
+ USB PalmConnect (and other KL5KUSB105-based) Single Port Serial Driver
+ CONFIG_USB_SERIAL_KLSI
+ Say Y here if you want to use a KL5KUSB105 - based single port
+ serial adapter. The most widely known -- and currently the only
+ tested -- device in this category is the PalmConnect USB Serial
+ adapter sold by Palm Inc. for use with their Palm III and Palm V
+ series PDAs.
+
+ Please read <file:Documentation/usb/usb-serial.txt> for more
+ information.
+
+ This code is also available as a module ( = code which can be
+ inserted in and removed from the running kernel whenever you want).
+ The module will be called kl5kusb105.o. If you want to compile it as
+ a module, say M here and read <file:Documentation/modules.txt>.
+
USB Serial Converter verbose debug
CONFIG_USB_SERIAL_DEBUG
***************
*** 13244,13247 ****
--- 13346,13397 ----
module, say M here and read <file:Documentation/modules.txt>.
+ USB SE401 Camera support
+ CONFIG_USB_SE401
+ Say Y here if you want to connect this type of camera to your
+ computer's USB port. See <file:Documentation/usb/se401.txt> for more
+ information and for a list of supported cameras.
+
+ This driver uses the Video For Linux API. You must say Y or M to
+ "Video For Linux" (under Multimedia Devices) to use this driver.
+ Information on this API and pointers to "v4l" programs may be found
+ on the WWW at <http://roadrunner.swansea.uk.linux.org/v4l.shtml>.
+
+ This code is also available as a module ( = code which can be
+ inserted in and removed from the running kernel whenever you want).
+ The module will be called se401.o. If you want to compile it as a
+ module, say M here and read <file:Documentation/modules.txt>.
+
+ USB STV680 (Pencam) Camera support
+ CONFIG_USB_STV680
+ Say Y here if you want to connect this type of camera to your
+ computer's USB port. This includes the Pencam line of cameras.
+ See <file:Documentation/usb/stv680.txt> for more information and for
+ a list of supported cameras.
+
+ This driver uses the Video For Linux API. You must say Y or M to
+ "Video For Linux" (under Multimedia Devices) to use this driver.
+ Information on this API and pointers to "v4l" programs may be found
+ on the WWW at <http://roadrunner.swansea.uk.linux.org/v4l.shtml>.
+
+ This code is also available as a module ( = code which can be
+ inserted in and removed from the running kernel whenever you want).
+ The module will be called stv680.o. If you want to compile it as a
+ module, say M here and read <file:Documentation/modules.txt>.
+
+ Vicam
+ CONFIG_USB_VICAM
+ Say Y here if you have 3com homeconnect camera (vicam).
+
+ This driver uses the Video For Linux API. You must say Y or M to
+ "Video For Linux" (under Multimedia Devices) to use this driver.
+ Information on this API and pointers to "v4l" programs may be found
+ on the WWW at <http://roadrunner.swansea.uk.linux.org/v4l.shtml>.
+
+ This code is also available as a module ( = code which can be
+ inserted in and removed from the running kernel whenever you want).
+ The module will be called vicam.o. If you want to compile it as a
+ module, say M here and read <file:Documentation/modules.txt>.
+
+
Pegasus/Pegasus II based USB-Ethernet device support
CONFIG_USB_PEGASUS
***************
*** 14833,14836 ****
--- 14983,14998 ----
partition table format used by SGI machines.
+ Intel EFI GUID partition support
+ CONFIG_EFI_PARTITION
+ Say Y here if you would like to use hard disks under Linux which
+ were partitioned using EFI GPT. Presently only useful on the
+ IA-64 platform.
+
+ /dev/guid support (EXPERIMENTAL)
+ CONFIG_DEVFS_GUID
+ Say Y here if you would like to access disks and partitions by
+ their Globally Unique Identifiers (GUIDs) which will appear as
+ symbolic links in /dev/guid.
+
Ultrix partition table support
CONFIG_ULTRIX_PARTITION
***************
*** 15107,15111 ****
big5, cp437, cp737, cp775, cp850, cp852, cp855, cp857, cp860, cp861,
cp862, cp863, cp864, cp865, cp866, cp869, cp874, cp932, cp936,
! cp949, cp950, cp1251, cp1255, euc-jp, euc-kr, gb2312, iso8859-1,
iso8859-2, iso8859-3, iso8859-4, iso8859-5, iso8859-6, iso8859-7,
iso8859-8, iso8859-9, iso8859-13, iso8859-14, iso8859-15,
--- 15269,15273 ----
big5, cp437, cp737, cp775, cp850, cp852, cp855, cp857, cp860, cp861,
cp862, cp863, cp864, cp865, cp866, cp869, cp874, cp932, cp936,
! cp949, cp950, cp1250, cp1251, cp1255, euc-jp, euc-kr, gb2312, iso8859-1,
iso8859-2, iso8859-3, iso8859-4, iso8859-5, iso8859-6, iso8859-7,
iso8859-8, iso8859-9, iso8859-13, iso8859-14, iso8859-15,
***************
*** 15347,15350 ****
--- 15509,15522 ----
Chinese(Big5).
+ Central European (Codepage 1250)
+ CONFIG_NLS_CODEPAGE_1250
+ If you want to display filenames with native language characters
+ from the Microsoft FAT file system family or from JOLIET CDROMs
+ correctly on the screen, you need to include the appropriate
+ input/output character sets. Say Y here for the Windows CP-1250
+ character set, which works for most Latin-written Slavic and Central
+ European languages: Czech, German, Hungarian, Polish, Rumanian, Croatian,
+ Slovak, Slovene.
+
NLS ISO 8859-1 (Latin 1; Western European Languages)
CONFIG_NLS_ISO8859_1
***************
*** 15617,15627 ****
Support for PMU-based PowerMacs
CONFIG_ADB_PMU
! On the PowerBook 3400 and 2400, the PMU is a 6805 microprocessor
! core whose primary function is to control battery charging and
! system power. The PMU also controls the ADB (Apple Desktop Bus)
! which connects to the keyboard and mouse, as well as the
! non-volatile RAM and the RTC (real time clock) chip. Say Y to
! enable support for this device; you should do so if your machine
! is one of these PowerBooks.
Include MacIO ADB driver
--- 15789,15796 ----
Support for PMU-based PowerMacs
CONFIG_ADB_PMU
! This provides support for PMU based Power Macintosh systems. This
! includes all PowerBooks and all AGP-based machines.
!
! If unsure say Y.
Include MacIO ADB driver
***************
*** 17046,17065 ****
sending the processor to sleep and saving power.
- USB SE401 Camera support
- CONFIG_USB_SE401
- Say Y here if you want to connect this type of camera to your
- computer's USB port. See <file:Documentation/usb/se401.txt> for more
- information and for a list of supported cameras.
-
- This driver uses the Video For Linux API. You must say Y or M to
- "Video For Linux" (under Multimedia Devices) to use this driver.
- Information on this API and pointers to "v4l" programs may be found
- on the WWW at <http://roadrunner.swansea.uk.linux.org/v4l.shtml>.
-
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called se401.o. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
-
ACPI support
CONFIG_ACPI
--- 17215,17218 ----
***************
*** 20430,20434 ****
PowerMac DMA sound support
! CONFIG_DMASOUND_AWACS
If you want to use the internal audio of your PowerMac in Linux,
answer Y to this question. This will provide a Sun-like /dev/audio,
--- 20583,20587 ----
PowerMac DMA sound support
! CONFIG_DMASOUND_PMAC
If you want to use the internal audio of your PowerMac in Linux,
answer Y to this question. This will provide a Sun-like /dev/audio,
***************
*** 20690,20693 ****
--- 20843,20854 ----
sound hardware for more power savings.
+ APM emulation
+ CONFIG_PMAC_APM_EMU
+ This driver provides an emulated /dev/apm_bios and /proc/apm. The
+ first one is mostly intended for XFree to sleep & wakeup properly,
+ the second ones provides some battery informations to allow existing
+ APM utilities to work. It provides less useful informations than
+ tools specifically designed for PowerBooks or /proc/pmu/battery_x
+
Backlight control for LCD screens
CONFIG_PMAC_BACKLIGHT
***************
*** 20768,20772 ****
URL: <http://www.tz-mikroelektronik.de/ServiceModule/index.html>
! HERMES:
Hermes-Pro ISDN/LAN router with integrated 8 x hub
Manufacturer: Multidata Gesellschaft für Datentechnik und Informatik
--- 20929,20933 ----
URL: <http://www.tz-mikroelektronik.de/ServiceModule/index.html>
! HERMES_PRO:
Hermes-Pro ISDN/LAN router with integrated 8 x hub
Manufacturer: Multidata Gesellschaft für Datentechnik und Informatik
***************
*** 21636,21657 ****
device, you have to merge a bootsector specific to the device
into the first bytes of the kernel. You will have to select the
! IPL device.
! # Choice: s390_ipl
! IPL from a S/390 tape unit
CONFIG_IPL_TAPE
Select this option if you want to IPL the image from a Tape.
IPL from a virtual card reader emulated by VM/ESA
! CONFIG_IPL_RDR_VM
! Select this option if you are running under VM/ESA and want
to IPL the image from the emulated card reader.
- IPL from a real card reader
- CONFIG_IPL_RDR
- Select this option if you want to IPL the image from a real
- card reader. Maybe you still got one and want to try. We didn't
- test.
-
Support for DASD hard disks
CONFIG_DASD
--- 21797,21812 ----
device, you have to merge a bootsector specific to the device
into the first bytes of the kernel. You will have to select the
! IPL device on another question, that pops up, when you select
! CONFIG_IPL.
! IPL from a /390 tape unit
CONFIG_IPL_TAPE
Select this option if you want to IPL the image from a Tape.
IPL from a virtual card reader emulated by VM/ESA
! CONFIG_IPL_VM
! Select this option if you are running under VM/ESA and want
to IPL the image from the emulated card reader.
Support for DASD hard disks
CONFIG_DASD
***************
*** 23649,23653 ****
HP-simulator For the HP simulator
(<http://software.hp.com/ia64linux/>).
! SN1-simulator For the SGI SN1 simulator.
DIG-compliant For DIG ("Developer's Interface Guide") compliant
system.
--- 23804,23809 ----
HP-simulator For the HP simulator
(<http://software.hp.com/ia64linux/>).
! SN1 For SGI SN1 Platforms.
! SN2 For SGI SN2 Platforms.
DIG-compliant For DIG ("Developer's Interface Guide") compliant
system.
***************
*** 23655,23658 ****
--- 23811,23824 ----
If you don't know what to do, choose "generic".
+ CONFIG_IA64_SGI_SN_SIM
+ Build a kernel that runs on both the SGI simulator AND on hardware.
+ There is a very slight performance penalty on hardware for including this
+ option.
+
+ CONFIG_IA64_SGI_SN_DEBUG
+ This enables addition debug code that helps isolate
+ platform/kernel bugs. There is a small but measurable performance
+ degradation when this option is enabled.
+
# Choice: pagesize
Kernel page size
***************
*** 23672,23722 ****
If you don't know what to do, choose 8KB.
- Enable Itanium A-step specific code
- CONFIG_ITANIUM_ASTEP_SPECIFIC
- Select this option to build a kernel for an Itanium prototype system
- with an A-step CPU. You have an A-step CPU if the "revision" field
- in /proc/cpuinfo is 0.
-
Enable Itanium B-step specific code
CONFIG_ITANIUM_BSTEP_SPECIFIC
Select this option to build a kernel for an Itanium prototype system
! with a B-step CPU. You have a B-step CPU if the "revision" field in
! /proc/cpuinfo has a value in the range from 1 to 4.
!
! Enable Itanium B0-step specific code
! CONFIG_ITANIUM_B0_SPECIFIC
! Select this option to build a kernel for an Itanium prototype system
! with a B0-step CPU. You have a B0-step CPU if the "revision" field
! in /proc/cpuinfo is 1.
!
! Enable Itanium C-step specific code
! CONFIG_ITANIUM_CSTEP_SPECIFIC
! Select this option to build a kernel for an Itanium prototype system
! with a C-step CPU. You have a C-step CPU if the "revision" field in
! /proc/cpuinfo is in the range of 5 to 8.
!
! Enable Itanium B1-step specific code
! CONFIG_ITANIUM_B1_SPECIFIC
! Select this option to build a kernel for an Itanium prototype system
! with a B1-step CPU. You have a B1-step CPU if the "revision" field
! in /proc/cpuinfo is 2.
!
! Enable Itanium B2-step specific code
! CONFIG_ITANIUM_B2_SPECIFIC
! Select this option to build a kernel for an Itanium prototype system
! with a B2-step CPU. You have a B2-step CPU if the "revision" field
! in /proc/cpuinfo is 3.
!
! Enable Itanium C0-step specific code
! CONFIG_ITANIUM_C0_SPECIFIC
! Select this option to build a kernel for an Itanium prototype system
! with a C0-step CPU. You have a C0-step CPU if the "revision" field
! in /proc/cpuinfo is 5.
!
! Force interrupt redirection
! CONFIG_IA64_HAVE_IRQREDIR
! Select this option if you know that your system has the ability to
! redirect interrupts to different CPUs. Select N here if you're
! unsure.
Enable IA-64 Machine Check Abort
--- 23838,23848 ----
If you don't know what to do, choose 8KB.
Enable Itanium B-step specific code
CONFIG_ITANIUM_BSTEP_SPECIFIC
Select this option to build a kernel for an Itanium prototype system
! with a B-step CPU. Only B3 step CPUs are supported. You have a B3-step
! CPU if the "revision" field in /proc/cpuinfo is equal to 4. If the
! "revision" field shows a number bigger than 4, you do not have to turn
! on this option.
Enable IA-64 Machine Check Abort
***************
*** 23787,23790 ****
--- 23913,23925 ----
support" (CONFIG_PROC_FS) is enabled, too.
+ /proc/efi/vars support
+ CONFIG_EFI_VARS
+ If you say Y here, you are able to get EFI (Extensible Firmware
+ Interface) variable information in /proc/efi/vars. You may read,
+ write, create, and destroy EFI variables through this interface.
+
+ To use this option, you have to check that the "/proc file system
+ support" (CONFIG_PROC_FS) is enabled, too.
+
Kernel support for IA-32 emulation
CONFIG_IA32_SUPPORT
***************
*** 24257,24260 ****
--- 24392,24405 ----
would like kernel messages to be formatted into GDB $O packets so
that GDB prints them as program output, say 'Y'.
+
+ 802.1Q VLAN Support
+ CONFIG_VLAN_8021Q
+ Select this and you will be able to create 802.1Q VLAN interfaces on your
+ ethernet interfaces. 802.1Q VLAN supports almost everything a regular
+ ethernet interface does, including firewalling, bridging, and of course
+ IP traffic. You will need the 'vconfig' tool from the VLAN project in
+ order to effectively use VLANs. See the VLAN web page for more
+ information: http://www.candelatech.com/~greear/vlan.html If unsure,
+ you can safely say 'N'.
#
|
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-26 20:59:07
|
Update of /cvsroot/linuxcompressed/linux/mm/comp_cache
In directory usw-pr-cvs1:/tmp/cvs-serv20377/mm/comp_cache
Modified Files:
main.c
Log Message:
- Update to 2.4.18
- Some minor changes to make the code compile when CONFIG_COMP_CACHE is
disabled
Index: main.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/main.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -r1.26 -r1.27
*** main.c 25 Feb 2002 19:34:41 -0000 1.26
--- main.c 26 Feb 2002 20:59:01 -0000 1.27
***************
*** 2,6 ****
* linux/mm/comp_cache/main.c
*
! * Time-stamp: <2002-02-25 15:23:44 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/main.c
*
! * Time-stamp: <2002-02-26 13:37:55 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 90,93 ****
--- 90,109 ----
return ((comp_page_stats.comp_size <= PAGE_SIZE)?comp_page_stats.comp_size:PAGE_SIZE);
}
+
+ inline int
+ compress_clean_page(struct page * page, unsigned int gfp_mask)
+ {
+ if (PageCompCache(page))
+ return 0;
+
+ page_cache_get(page);
+ spin_unlock(&pagecache_lock);
+
+ compress_page(page, 0, gfp_mask);
+ page_cache_release(page);
+
+ spin_lock(&pagemap_lru_lock);
+ return 1;
+ }
int
|
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-26 20:59:06
|
Update of /cvsroot/linuxcompressed/linux/arch/i386
In directory usw-pr-cvs1:/tmp/cvs-serv20377/arch/i386
Modified Files:
config.in
Log Message:
- Update to 2.4.18
- Some minor changes to make the code compile when CONFIG_COMP_CACHE is
disabled
Index: config.in
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/arch/i386/config.in,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** config.in 23 Feb 2002 18:24:10 -0000 1.15
--- config.in 26 Feb 2002 20:59:01 -0000 1.16
***************
*** 38,41 ****
--- 38,42 ----
K6/K6-II/K6-III CONFIG_MK6 \
Athlon/Duron/K7 CONFIG_MK7 \
+ Elan CONFIG_MELAN \
Crusoe CONFIG_MCRUSOE \
Winchip-C6 CONFIG_MWINCHIPC6 \
***************
*** 127,130 ****
--- 128,136 ----
define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
fi
+ if [ "$CONFIG_MELAN" = "y" ]; then
+ define_int CONFIG_X86_L1_CACHE_SHIFT 4
+ define_bool CONFIG_X86_USE_STRING_486 y
+ define_bool CONFIG_X86_ALIGNMENT_16 y
+ fi
if [ "$CONFIG_MCYRIXIII" = "y" ]; then
define_int CONFIG_X86_L1_CACHE_SHIFT 5
***************
*** 142,145 ****
--- 148,152 ----
define_bool CONFIG_X86_ALIGNMENT_16 y
define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+ define_bool CONFIG_X86_OOSTORE y
fi
if [ "$CONFIG_MWINCHIP2" = "y" ]; then
***************
*** 148,151 ****
--- 155,159 ----
define_bool CONFIG_X86_TSC y
define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+ define_bool CONFIG_X86_OOSTORE y
fi
if [ "$CONFIG_MWINCHIP3D" = "y" ]; then
***************
*** 154,157 ****
--- 162,166 ----
define_bool CONFIG_X86_TSC y
define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
+ define_bool CONFIG_X86_OOSTORE y
fi
tristate 'Toshiba Laptop support' CONFIG_TOSHIBA
|
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-26 20:59:06
|
Update of /cvsroot/linuxcompressed/linux In directory usw-pr-cvs1:/tmp/cvs-serv20377 Modified Files: MAINTAINERS Log Message: - Update to 2.4.18 - Some minor changes to make the code compile when CONFIG_COMP_CACHE is disabled Index: MAINTAINERS =================================================================== RCS file: /cvsroot/linuxcompressed/linux/MAINTAINERS,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** MAINTAINERS 2 Jan 2002 16:59:05 -0000 1.1 --- MAINTAINERS 26 Feb 2002 20:59:01 -0000 1.2 *************** *** 590,594 **** FREEVXFS FILESYSTEM P: Christoph Hellwig ! M: hc...@ca... W: ftp://ftp.openlinux.org/pub/people/hch/vxfs S: Maintained --- 590,594 ---- FREEVXFS FILESYSTEM P: Christoph Hellwig ! M: hc...@in... W: ftp://ftp.openlinux.org/pub/people/hch/vxfs S: Maintained *************** *** 1030,1033 **** --- 1030,1038 ---- S: Maintained + NATSEMI ETHERNET DRIVER (DP8381x) + P: Tim Hockin + M: th...@ho... + S: Maintained + NCP FILESYSTEM P: Petr Vandrovec *************** *** 1053,1059 **** P: Harald Welte M: la...@gn... ! W: http://netfilter.samba.org ! W: http://netfilter.kernelnotes.org ! W: http://netfilter.filewatcher.org L: net...@li... S: Supported --- 1058,1065 ---- P: Harald Welte M: la...@gn... ! P: Jozsef Kadlecsik ! M: ka...@bl... ! W: http://www.netfilter.org/ ! W: http://www.iptables.org/ L: net...@li... S: Supported *************** *** 1153,1158 **** OPL3-SA2, SA3, and SAx DRIVER ! P: Scott Murray ! M: sc...@sp... L: lin...@vg... S: Maintained --- 1159,1164 ---- OPL3-SA2, SA3, and SAx DRIVER ! P: Zwane Mwaikambo ! M: zw...@co... L: lin...@vg... S: Maintained *************** *** 1180,1186 **** PERSONALITY HANDLING P: Christoph Hellwig ! M: hc...@ca... L: lin...@li... ! S: Supported PCI ID DATABASE --- 1186,1192 ---- PERSONALITY HANDLING P: Christoph Hellwig ! M: hc...@in... L: lin...@li... ! S: Maintained PCI ID DATABASE *************** *** 1263,1266 **** --- 1269,1278 ---- S: Maintained + RADEON FRAMEBUFFER DISPLAY DRIVER + P: Ani Joshi + M: aj...@sh... + L: lin...@li... + S: Maintained + RAGE128 FRAMEBUFFER DISPLAY DRIVER P: Ani Joshi *************** *** 1470,1474 **** SYSV FILESYSTEM P: Christoph Hellwig ! M: hc...@ca... S: Maintained --- 1482,1486 ---- SYSV FILESYSTEM P: Christoph Hellwig ! M: hc...@in... S: Maintained *************** *** 1614,1618 **** USB OV511 DRIVER P: Mark McClelland ! M: mwm@i.am L: lin...@li... L: lin...@li... --- 1626,1630 ---- USB OV511 DRIVER P: Mark McClelland ! M: mmc...@bi... L: lin...@li... L: lin...@li... |
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-26 20:59:06
|
Update of /cvsroot/linuxcompressed/linux/mm
In directory usw-pr-cvs1:/tmp/cvs-serv20377/mm
Modified Files:
filemap.c memory.c mmap.c page_alloc.c shmem.c swapfile.c
vmscan.c
Log Message:
- Update to 2.4.18
- Some minor changes to make the code compile when CONFIG_COMP_CACHE is
disabled
Index: filemap.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/filemap.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** filemap.c 26 Feb 2002 16:01:10 -0000 1.14
--- filemap.c 26 Feb 2002 20:59:01 -0000 1.15
***************
*** 471,475 ****
spin_unlock(&pagecache_lock);
! if (!list_empty(&mapping->dirty_comp_pages))
goto try_again;
--- 471,475 ----
spin_unlock(&pagecache_lock);
! if (there_are_dirty_comp_pages(mapping))
goto try_again;
***************
*** 496,534 ****
}
- /*
- * By the time this is called, the page is locked and
- * we don't have to worry about any races any more.
- *
- * Start the IO..
- */
- static int writeout_one_page(struct page *page)
- {
- struct buffer_head *bh, *head = page->buffers;
-
- bh = head;
- do {
- if (buffer_locked(bh) || !buffer_dirty(bh) || !buffer_uptodate(bh))
- continue;
-
- bh->b_flushtime = jiffies;
- ll_rw_block(WRITE, 1, &bh);
- } while ((bh = bh->b_this_page) != head);
- return 0;
- }
-
- int waitfor_one_page(struct page *page)
- {
- int error = 0;
- struct buffer_head *bh, *head = page->buffers;
-
- bh = head;
- do {
- wait_on_buffer(bh);
- if (buffer_req(bh) && !buffer_uptodate(bh))
- error = -EIO;
- } while ((bh = bh->b_this_page) != head);
- return error;
- }
-
static int do_buffer_fdatasync(struct list_head *head, unsigned long start, unsigned long end, int (*fn)(struct page *))
{
--- 496,499 ----
***************
*** 624,629 ****
*
*/
! void filemap_fdatasync(struct address_space * mapping)
{
int (*writepage)(struct page *) = mapping->a_ops->writepage;
--- 589,595 ----
*
*/
! int filemap_fdatasync(struct address_space * mapping)
{
+ int ret = 0;
int (*writepage)(struct page *) = mapping->a_ops->writepage;
***************
*** 648,653 ****
if (PageDirty(page)) {
ClearPageDirty(page);
! writepage(page);
} else
UnlockPage(page);
--- 614,622 ----
if (PageDirty(page)) {
+ int err;
ClearPageDirty(page);
! err = writepage(page);
! if (err && !ret)
! ret = err;
} else
UnlockPage(page);
***************
*** 661,666 ****
* might get compressed. It may also happen to compress dirty
* pages when allocating new pages in the first loop. */
! if (!list_empty(&mapping->dirty_comp_pages))
goto try_again;
}
--- 630,636 ----
* might get compressed. It may also happen to compress dirty
* pages when allocating new pages in the first loop. */
! if (there_are_dirty_comp_pages(mapping))
goto try_again;
+ return ret;
}
***************
*** 672,677 ****
*
*/
! void filemap_fdatawait(struct address_space * mapping)
{
spin_lock(&pagecache_lock);
--- 642,649 ----
*
*/
! int filemap_fdatawait(struct address_space * mapping)
{
+ int ret = 0;
+
spin_lock(&pagecache_lock);
***************
*** 689,692 ****
--- 661,666 ----
___wait_on_page(page);
+ if (PageError(page))
+ ret = -EIO;
page_cache_release(page);
***************
*** 694,697 ****
--- 668,672 ----
}
spin_unlock(&pagecache_lock);
+ return ret;
}
***************
*** 1064,1068 ****
if (!page) {
struct page *newpage = alloc_page(gfp_mask);
- page = NULL;
if (newpage) {
spin_lock(&pagecache_lock);
--- 1039,1042 ----
***************
*** 1651,1660 ****
/*
! * Flush to disk exlusively the _data_, metadata must remains
* completly asynchronous or performance will go to /dev/null.
*/
! filemap_fdatasync(mapping);
! retval = fsync_inode_data_buffers(inode);
! filemap_fdatawait(mapping);
if (retval < 0)
goto out_free;
--- 1625,1636 ----
/*
! * Flush to disk exclusively the _data_, metadata must remain
* completly asynchronous or performance will go to /dev/null.
*/
! retval = filemap_fdatasync(mapping);
! if (retval == 0)
! retval = fsync_inode_data_buffers(inode);
! if (retval == 0)
! retval = filemap_fdatawait(mapping);
if (retval < 0)
goto out_free;
***************
*** 2273,2296 ****
*/
static int msync_interval(struct vm_area_struct * vma,
unsigned long start, unsigned long end, int flags)
{
struct file * file = vma->vm_file;
if (file && (vma->vm_flags & VM_SHARED)) {
! int error;
! error = filemap_sync(vma, start, end-start, flags);
! if (!error && (flags & MS_SYNC)) {
struct inode * inode = file->f_dentry->d_inode;
down(&inode->i_sem);
! filemap_fdatasync(inode->i_mapping);
! if (file->f_op && file->f_op->fsync)
! error = file->f_op->fsync(file, file->f_dentry, 1);
! filemap_fdatawait(inode->i_mapping);
up(&inode->i_sem);
}
- return error;
}
! return 0;
}
--- 2249,2291 ----
*/
+ /*
+ * MS_SYNC syncs the entire file - including mappings.
+ *
+ * MS_ASYNC initiates writeout of just the dirty mapped data.
+ * This provides no guarantee of file integrity - things like indirect
+ * blocks may not have started writeout. MS_ASYNC is primarily useful
+ * where the application knows that it has finished with the data and
+ * wishes to intelligently schedule its own I/O traffic.
+ */
static int msync_interval(struct vm_area_struct * vma,
unsigned long start, unsigned long end, int flags)
{
+ int ret = 0;
struct file * file = vma->vm_file;
+
if (file && (vma->vm_flags & VM_SHARED)) {
! ret = filemap_sync(vma, start, end-start, flags);
! if (!ret && (flags & (MS_SYNC|MS_ASYNC))) {
struct inode * inode = file->f_dentry->d_inode;
+
down(&inode->i_sem);
! ret = filemap_fdatasync(inode->i_mapping);
! if (flags & MS_SYNC) {
! int err;
!
! if (file->f_op && file->f_op->fsync) {
! err = file->f_op->fsync(file, file->f_dentry, 1);
! if (err && !ret)
! ret = err;
! }
! err = filemap_fdatawait(inode->i_mapping);
! if (err && !ret)
! ret = err;
! }
up(&inode->i_sem);
}
}
! return ret;
}
***************
*** 3150,3154 ****
status = mapping->a_ops->prepare_write(file, page, offset, offset+bytes);
if (status)
! goto unlock;
page_fault = __copy_from_user(kaddr+offset, buf, bytes);
flush_dcache_page(page);
--- 3145,3149 ----
status = mapping->a_ops->prepare_write(file, page, offset, offset+bytes);
if (status)
! goto sync_failure;
page_fault = __copy_from_user(kaddr+offset, buf, bytes);
flush_dcache_page(page);
***************
*** 3175,3178 ****
--- 3170,3174 ----
break;
} while (count);
+ done:
*ppos = pos;
***************
*** 3196,3199 ****
--- 3192,3207 ----
status = -EFAULT;
goto unlock;
+
+ sync_failure:
+ /*
+ * If blocksize < pagesize, prepare_write() may have instantiated a
+ * few blocks outside i_size. Trim these off again.
+ */
+ kunmap(page);
+ UnlockPage(page);
+ page_cache_release(page);
+ if (pos + bytes > inode->i_size)
+ vmtruncate(inode, inode->i_size);
+ goto done;
o_direct:
Index: memory.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/memory.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** memory.c 25 Feb 2002 19:34:41 -0000 1.22
--- memory.c 26 Feb 2002 20:59:01 -0000 1.23
***************
*** 180,184 ****
unsigned long address = vma->vm_start;
unsigned long end = vma->vm_end;
! unsigned long cow = (vma->vm_flags & (VM_SHARED | VM_WRITE)) == VM_WRITE;
src_pgd = pgd_offset(src, address)-1;
--- 180,184 ----
unsigned long address = vma->vm_start;
unsigned long end = vma->vm_end;
! unsigned long cow = (vma->vm_flags & (VM_SHARED | VM_MAYWRITE)) == VM_MAYWRITE;
src_pgd = pgd_offset(src, address)-1;
***************
*** 249,253 ****
/* If it's a COW mapping, write protect it both in the parent and the child */
! if (cow) {
ptep_set_wrprotect(src_pte);
pte = *src_pte;
--- 249,253 ----
/* If it's a COW mapping, write protect it both in the parent and the child */
! if (cow && pte_write(pte)) {
ptep_set_wrprotect(src_pte);
pte = *src_pte;
***************
*** 447,454 ****
}
int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start,
int len, int write, int force, struct page **pages, struct vm_area_struct **vmas)
{
! int i = 0;
do {
--- 447,470 ----
}
+ /*
+ * Please read Documentation/cachetlb.txt before using this function,
+ * accessing foreign memory spaces can cause cache coherency problems.
+ *
+ * Accessing a VM_IO area is even more dangerous, therefore the function
+ * fails if pages is != NULL and a VM_IO area is found.
+ */
int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start,
int len, int write, int force, struct page **pages, struct vm_area_struct **vmas)
{
! int i;
! unsigned int flags;
!
! /*
! * Require read or write permissions.
! * If 'force' is set, we only require the "MAY" flags.
! */
! flags = write ? (VM_WRITE | VM_MAYWRITE) : (VM_READ | VM_MAYREAD);
! flags &= force ? (VM_MAYREAD | VM_MAYWRITE) : (VM_READ | VM_WRITE);
! i = 0;
do {
***************
*** 457,467 ****
vma = find_extend_vma(mm, start);
! if ( !vma ||
! (!force &&
! ((write && (!(vma->vm_flags & VM_WRITE))) ||
! (!write && (!(vma->vm_flags & VM_READ))) ) )) {
! if (i) return i;
! return -EFAULT;
! }
spin_lock(&mm->page_table_lock);
--- 473,478 ----
vma = find_extend_vma(mm, start);
! if ( !vma || (pages && vma->vm_flags & VM_IO) || !(flags & vma->vm_flags) )
! return i ? : -EFAULT;
spin_lock(&mm->page_table_lock);
***************
*** 491,496 ****
* depending on the type of the found page
*/
! if (pages[i])
! page_cache_get(pages[i]);
}
if (vmas)
--- 502,508 ----
* depending on the type of the found page
*/
! if (!pages[i])
! goto bad_page;
! page_cache_get(pages[i]);
}
if (vmas)
***************
*** 502,506 ****
--- 514,530 ----
spin_unlock(&mm->page_table_lock);
} while(len);
+ out:
return i;
+
+ /*
+ * We found an invalid page in the VMA. Release all we have
+ * so far and fail.
+ */
+ bad_page:
+ spin_unlock(&mm->page_table_lock);
+ while (i--)
+ page_cache_release(pages[i]);
+ i = -EFAULT;
+ goto out;
}
Index: mmap.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/mmap.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** mmap.c 14 Jan 2002 12:05:08 -0000 1.6
--- mmap.c 26 Feb 2002 20:59:01 -0000 1.7
***************
*** 625,629 ****
if (flags & MAP_FIXED) {
if (addr > TASK_SIZE - len)
! return -EINVAL;
if (addr & ~PAGE_MASK)
return -EINVAL;
--- 625,629 ----
if (flags & MAP_FIXED) {
if (addr > TASK_SIZE - len)
! return -ENOMEM;
if (addr & ~PAGE_MASK)
return -EINVAL;
Index: page_alloc.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/page_alloc.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** page_alloc.c 23 Feb 2002 18:24:11 -0000 1.15
--- page_alloc.c 26 Feb 2002 20:59:01 -0000 1.16
***************
*** 71,74 ****
--- 71,80 ----
zone_t *zone;
+ /* Yes, think what happens when other parts of the kernel take
+ * a reference to a page in order to pin it for io. -ben
+ */
+ if (PageLRU(page))
+ lru_cache_del(page);
+
if (page->buffers)
BUG();
***************
*** 425,437 ****
}
return 0;
- }
-
- void page_cache_release(struct page *page)
- {
- if (!PageReserved(page) && put_page_testzero(page)) {
- if (PageLRU(page))
- lru_cache_del(page);
- __free_pages_ok(page, 0);
- }
}
--- 431,434 ----
Index: shmem.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/shmem.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** shmem.c 25 Feb 2002 19:34:41 -0000 1.16
--- shmem.c 26 Feb 2002 20:59:01 -0000 1.17
***************
*** 754,757 ****
--- 754,762 ----
int err;
+ if ((ssize_t) count < 0)
+ return -EINVAL;
+
+ if (!access_ok(VERIFY_READ, buf, count))
+ return -EFAULT;
down(&inode->i_sem);
Index: swapfile.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/swapfile.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -r1.26 -r1.27
*** swapfile.c 23 Feb 2002 18:24:11 -0000 1.26
--- swapfile.c 26 Feb 2002 20:59:01 -0000 1.27
***************
*** 383,387 ****
page_cache_get(page);
/* Only cache user (+us), or swap space full? Free it! */
! if (page_count(page) == 2 || vm_swap_full()) {
delete_from_swap_cache(page);
SetPageDirty(page);
--- 383,387 ----
page_cache_get(page);
/* Only cache user (+us), or swap space full? Free it! */
! if (page_count(page) - !!page->buffers == 2 || vm_swap_full()) {
delete_from_swap_cache(page);
SetPageDirty(page);
Index: vmscan.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/vmscan.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -r1.28 -r1.29
*** vmscan.c 25 Feb 2002 19:34:41 -0000 1.28
--- vmscan.c 26 Feb 2002 20:59:01 -0000 1.29
***************
*** 509,526 ****
/* compress it if it's a clean page that has not been
! * compressed in a previous iteration and it has once
! * been mapped (and so decompressed if we are using
! * compressed swap) */
! if (!PageCompCache(page)) {
! page_cache_get(page);
! spin_unlock(&pagecache_lock);
!
! compress_page(page, 0, gfp_mask);
! page_cache_release(page);
!
! spin_lock(&pagemap_lru_lock);
continue;
! }
!
/* point of no return */
if (likely(!PageSwapCache(page))) {
--- 509,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 */
if (likely(!PageSwapCache(page))) {
***************
*** 563,567 ****
spin_lock(&pagemap_lru_lock);
entry = active_list.prev;
! while (nr_pages-- && entry != &active_list) {
struct page * page;
--- 553,557 ----
spin_lock(&pagemap_lru_lock);
entry = active_list.prev;
! while (nr_pages && entry != &active_list) {
struct page * page;
***************
*** 573,576 ****
--- 563,568 ----
continue;
}
+
+ nr_pages--;
del_page_from_active_list(page);
|
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-26 16:07:34
|
Update of /cvsroot/linuxcompressed/linux/Documentation
In directory usw-pr-cvs1:/tmp/cvs-serv26512/Documentation
Modified Files:
Configure.help
Log Message:
Removed obsolete help for CONFIG_COMP_SWAP
Index: Configure.help
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/Documentation/Configure.help,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** Configure.help 16 Jan 2002 16:30:11 -0000 1.3
--- Configure.help 26 Feb 2002 16:07:31 -0000 1.4
***************
*** 388,399 ****
If unsure, say N here.
- Swap Out in Compressed Format (Null Padding)
- CONFIG_COMP_SWAP
- If you want to swap out the pages from compressed cache without
- decompressing them, say Y here. There's no swap space gain, but you
- delay decompression until it's actually needed (swap in).
-
- If unsure, say N here.
-
Maximum Compressed Cache Size (Memory Pages)
CONFIG_COMP_CACHE_SIZE
--- 388,391 ----
|
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-26 16:01:15
|
Update of /cvsroot/linuxcompressed/linux/mm/comp_cache
In directory usw-pr-cvs1:/tmp/cvs-serv24168/mm/comp_cache
Modified Files:
swapin.c swapout.c
Log Message:
- Fixed annoying bug in the do_generic_file_read(). Wrong variable was sent
as parameter to lookup_comp_cache() which would not find or return the wrong
page.
- Fixed bug in truncate_inode_pages() to correctly truncate compressed
pages.
- Minor fixes regarding setting and clearing CompCache bit.
Index: swapin.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapin.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** swapin.c 25 Feb 2002 19:34:41 -0000 1.22
--- swapin.c 26 Feb 2002 16:01:10 -0000 1.23
***************
*** 2,6 ****
* linux/mm/comp_cache/swapin.c
*
! * Time-stamp: <2002-02-25 15:25:38 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/swapin.c
*
! * Time-stamp: <2002-02-26 11:42:51 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 23,34 ****
int err = find_comp_page(mapping, offset, &fragment);
! if (page)
! PageClearCompCache(page);
!
! if (err)
return;
! if (page && CompFragmentDirty(fragment))
! set_page_dirty(page);
comp_cache_free(fragment);
--- 23,40 ----
int err = find_comp_page(mapping, offset, &fragment);
! if (err) {
! /* if the fragment has been written out, we may have
! * CompCache flag, but no fragment in Comp Cache */
! if (page)
! PageClearCompCache(page);
return;
+ }
! if (page) {
! if (!PageTestandClearCompCache(page))
! BUG();
! if (CompFragmentDirty(fragment))
! set_page_dirty(page);
! }
comp_cache_free(fragment);
***************
*** 96,100 ****
}
SetPageUptodate(page);
- PageSetCompCache(page);
}
--- 102,105 ----
***************
*** 129,132 ****
--- 134,138 ----
comp_cache_free_locked(fragment);
+ PageClearCompCache(page);
UnlockPage(page);
***************
*** 174,177 ****
--- 180,189 ----
void
+ invalidate_comp_pages(struct address_space * mapping)
+ {
+ truncate_list_comp_pages(&mapping->clean_comp_pages, 0, 0);
+ }
+
+ void
lookup_all_comp_pages(struct address_space * mapping)
{
***************
*** 213,217 ****
decompress_fragment(fragment, page);
!
if (!PageDirty(page))
BUG();
--- 225,229 ----
decompress_fragment(fragment, page);
!
if (!PageDirty(page))
BUG();
***************
*** 219,222 ****
--- 231,235 ----
UnlockPage(fragment->comp_page->page);
+ PageSetCompCache(page);
page_cache_release(page);
UnlockPage(page);
Index: swapout.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapout.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -r1.28 -r1.29
*** swapout.c 25 Feb 2002 19:34:41 -0000 1.28
--- swapout.c 26 Feb 2002 16:01:10 -0000 1.29
***************
*** 2,6 ****
* /mm/comp_cache/swapout.c
*
! * Time-stamp: <2002-02-25 16:12:13 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* /mm/comp_cache/swapout.c
*
! * Time-stamp: <2002-02-26 12:53:44 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 351,355 ****
if (!find_comp_page(page->mapping, page->index, &fout)) {
! printk("found %p (index %08lx dirty %d sc %d) new %p (index %08lx dirty %d sc %d)\n", fout, fout->index, CompFragmentDirty(fout)?1:0, PageSwapCache(fragment)?1:0, fragment, fragment->index, CompFragmentDirty(fragment)?1:0, PageSwapCache(fragment)?1:0);
BUG();
}
--- 351,355 ----
if (!find_comp_page(page->mapping, page->index, &fout)) {
! printk("found %p (index %08lx dirty %d sc %d) new %p (index %08lx dirty %d sc %d)\n", fout, fout->index, CompFragmentDirty(fout)?1:0, PageSwapCache(fragment)?1:0, fragment, fragment->index, dirty?1:0, PageSwapCache(fragment)?1:0);
BUG();
}
|
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-26 16:01:14
|
Update of /cvsroot/linuxcompressed/linux/include/linux
In directory usw-pr-cvs1:/tmp/cvs-serv24168/include/linux
Modified Files:
comp_cache.h
Log Message:
- Fixed annoying bug in the do_generic_file_read(). Wrong variable was sent
as parameter to lookup_comp_cache() which would not find or return the wrong
page.
- Fixed bug in truncate_inode_pages() to correctly truncate compressed
pages.
- Minor fixes regarding setting and clearing CompCache bit.
Index: comp_cache.h
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/include/linux/comp_cache.h,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -r1.53 -r1.54
*** comp_cache.h 25 Feb 2002 19:34:40 -0000 1.53
--- comp_cache.h 26 Feb 2002 16:01:10 -0000 1.54
***************
*** 2,6 ****
* linux/mm/comp_cache.h
*
! * Time-stamp: <2002-02-25 09:43:46 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache.h
*
! * Time-stamp: <2002-02-25 17:18:28 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 289,292 ****
--- 289,293 ----
int lookup_comp_cache(struct address_space *, unsigned long, struct page *);
void invalidate_comp_page(struct address_space *, unsigned long, struct page *);
+ void invalidate_comp_pages(struct address_space *);
void truncate_comp_pages(struct address_space *, unsigned long, unsigned);
void lookup_all_comp_pages(struct address_space *);
***************
*** 294,297 ****
--- 295,299 ----
static inline int lookup_comp_cache(swp_entry_t entry) { return 0; }
static inline void invalidate_comp_page(struct address_space * mapping, unsigned long offset, struct page * page) { };
+ static inline void invalidate_comp_pages(struct address_space * mapping) { };
static inline void truncate_comp_pages(struct address_space * mapping, unsigned long start, unsigned partial) { };
static inline void lookup_all_comp_pages(struct address_space * mapping) { };
|
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-26 16:01:14
|
Update of /cvsroot/linuxcompressed/linux/mm
In directory usw-pr-cvs1:/tmp/cvs-serv24168/mm
Modified Files:
filemap.c
Log Message:
- Fixed annoying bug in the do_generic_file_read(). Wrong variable was sent
as parameter to lookup_comp_cache() which would not find or return the wrong
page.
- Fixed bug in truncate_inode_pages() to correctly truncate compressed
pages.
- Minor fixes regarding setting and clearing CompCache bit.
Index: filemap.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/filemap.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** filemap.c 25 Feb 2002 19:34:40 -0000 1.13
--- filemap.c 26 Feb 2002 16:01:10 -0000 1.14
***************
*** 207,210 ****
--- 207,212 ----
struct page * page;
+ invalidate_comp_pages(inode->i_mapping);
+
head = &inode->i_mapping->clean_pages;
***************
*** 355,360 ****
int unlocked;
- truncate_comp_pages(mapping, start, partial);
-
spin_lock(&pagecache_lock);
do {
--- 357,360 ----
***************
*** 365,368 ****
--- 365,370 ----
/* Traversed all three lists without dropping the lock */
spin_unlock(&pagecache_lock);
+
+ truncate_comp_pages(mapping, start, partial);
}
***************
*** 913,918 ****
spin_lock(&pagecache_lock);
page = __find_page_nolock(mapping, offset, *hash);
! if (page)
set_page_dirty(page);
spin_unlock(&pagecache_lock);
return page;
--- 915,922 ----
spin_lock(&pagecache_lock);
page = __find_page_nolock(mapping, offset, *hash);
! if (page) {
set_page_dirty(page);
+ PageSetCompCache(page);
+ }
spin_unlock(&pagecache_lock);
return page;
***************
*** 1602,1609 ****
cached_page = NULL;
! if (!lookup_comp_cache(mapping, offset, page)) {
! spin_lock(&pagecache_lock);
! goto found_page;
! }
goto readpage;
}
--- 1606,1611 ----
cached_page = NULL;
! if (!lookup_comp_cache(mapping, index, page))
! goto page_ok;
goto readpage;
}
|
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-25 19:34:44
|
Update of /cvsroot/linuxcompressed/linux/mm/comp_cache
In directory usw-pr-cvs1:/tmp/cvs-serv26754/mm/comp_cache
Modified Files:
aux.c free.c main.c swapin.c swapout.c vswap.c
Log Message:
This version fixes some bugs regarding the clean pages support. And
fixes many other bugs with the page cache support, besides code
cleanups. The improvement done in this version is the replacement of
the slab cache by Rik van Riel's rmap allocation for pte lists.
- now address space have two lists for compressed pages: dirty and
clean lists.
- some static inline functions that were in comp_cache.h have been
moved to the c file that uses it.
- all vswap functions that are often called are now compiled with
FASTCALL option.
- all vswap functions have been documented and cleaned up.
- since our pte_list struct is smaller than the minimum size needed
for slab cache, slab cache has been replaced by Rik's allocation,
that's pretty simple.
- failed fragment allocations are handled now.
- shared memory _broken_ support removed, since it was broken and only
bothering us.
Index: aux.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/aux.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** aux.c 23 Feb 2002 19:19:27 -0000 1.19
--- aux.c 25 Feb 2002 19:34:41 -0000 1.20
***************
*** 2,6 ****
* linux/mm/comp_cache/aux.c
*
! * Time-stamp: <2002-02-23 16:13:24 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/aux.c
*
! * Time-stamp: <2002-02-25 09:36:23 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 200,204 ****
*fragment = NULL;
! if (list_empty(&mapping->comp_pages))
goto not_found;
--- 200,204 ----
*fragment = NULL;
! if (list_empty(&mapping->clean_comp_pages) && list_empty(&mapping->dirty_comp_pages))
goto not_found;
Index: free.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/free.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** free.c 23 Feb 2002 18:24:11 -0000 1.23
--- free.c 25 Feb 2002 19:34:41 -0000 1.24
***************
*** 2,6 ****
* linux/mm/comp_cache/free.c
*
! * Time-stamp: <2002-02-23 12:03:56 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/free.c
*
! * Time-stamp: <2002-02-25 09:04:00 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 186,190 ****
unsigned long address;
struct vm_area_struct * vma;
! pte_t pte;
struct vswap_address * vswap;
struct list_head * vswap_lh;
--- 186,190 ----
unsigned long address;
struct vm_area_struct * vma;
! pte_t pte, * ptep;
struct vswap_address * vswap;
struct list_head * vswap_lh;
***************
*** 248,252 ****
BUG();
! comp_cache_swp_free_generic(old_entry, 0);
page_cache_release(swap_cache_page);
UnlockPage(swap_cache_page);
--- 248,252 ----
BUG();
! comp_cache_swp_free(old_entry);
page_cache_release(swap_cache_page);
UnlockPage(swap_cache_page);
***************
*** 259,264 ****
next_pte_list = pte_list->next;
! mm = ptep_to_mm(pte_list->ptep);
! address = ptep_to_address(pte_list->ptep);
vma = find_vma(mm, address);
--- 259,266 ----
next_pte_list = pte_list->next;
! ptep = pte_list->ptep;
!
! mm = ptep_to_mm(ptep);
! address = ptep_to_address(ptep);
vma = find_vma(mm, address);
***************
*** 268,281 ****
if (!vma)
goto next;
-
- remove_pte_vswap(pte_list->ptep);
! pte = ptep_get_and_clear(pte_list->ptep);
flush_tlb_page(vma, address);
flush_cache_page(vma, address);
! set_pte(pte_list->ptep, swp_entry_to_pte(entry));
!
! comp_cache_swp_free_generic(old_entry, 0);
next:
--- 270,283 ----
if (!vma)
goto next;
! remove_pte_vswap(ptep);
!
! pte = ptep_get_and_clear(ptep);
flush_tlb_page(vma, address);
flush_cache_page(vma, address);
! set_pte(ptep, swp_entry_to_pte(entry));
!
! comp_cache_swp_free(old_entry);
next:
Index: main.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/main.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -r1.25 -r1.26
*** main.c 23 Feb 2002 18:24:11 -0000 1.25
--- main.c 25 Feb 2002 19:34:41 -0000 1.26
***************
*** 2,6 ****
* linux/mm/comp_cache/main.c
*
! * Time-stamp: <2002-02-23 15:09:18 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/main.c
*
! * Time-stamp: <2002-02-25 15:23:44 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 57,60 ****
--- 57,93 ----
extern comp_cache_t * get_comp_cache_page(struct page *, unsigned short, comp_cache_fragment_t **, int, unsigned int);
+ extern void comp_cache_update_comp_stats(unsigned short, stats_page_t *);
+
+ static inline void
+ set_fragment_algorithm(comp_cache_fragment_t * fragment, unsigned short algorithm)
+ {
+ switch(algorithm) {
+ case WKDM_IDX:
+ CompFragmentSetWKdm(fragment);
+ break;
+ case WK4X4_IDX:
+ CompFragmentSetWK4x4(fragment);
+ break;
+ default:
+ BUG();
+ }
+ }
+
+ static inline int
+ compress(void * from, void * to, unsigned short * algorithm)
+ {
+ stats_page_t comp_page_stats;
+
+ START_ZEN_TIME(comp_page_stats.myTimer);
+ comp_page_stats.comp_size = compression_algorithms[current_algorithm].comp(from, to, PAGE_SIZE/4, (void *)(&comp_data));
+ STOP_ZEN_TIME(comp_page_stats.myTimer, comp_page_stats.comp_cycles);
+
+ /* update some statistics */
+ comp_cache_update_comp_stats(current_algorithm, &comp_page_stats);
+
+ *algorithm = current_algorithm;
+
+ return ((comp_page_stats.comp_size <= PAGE_SIZE)?comp_page_stats.comp_size:PAGE_SIZE);
+ }
int
***************
*** 70,79 ****
if (!PageLocked(page))
BUG();
/* compress to a buffer */
current_compressed_page = (unsigned long) page;
-
aux_comp_size = compress(page_address(page), (unsigned long *) &buffer_compressed, &algorithm);
-
comp_page = get_comp_cache_page(page, aux_comp_size, &fragment, dirty, gfp_mask);
--- 103,118 ----
if (!PageLocked(page))
BUG();
+
+ if (PageCompCache(page)) {
+ if (!dirty)
+ BUG();
+ invalidate_comp_page(page->mapping, page->index, page);
+ if (PageDirty(page))
+ BUG();
+ }
/* compress to a buffer */
current_compressed_page = (unsigned long) page;
aux_comp_size = compress(page_address(page), (unsigned long *) &buffer_compressed, &algorithm);
comp_page = get_comp_cache_page(page, aux_comp_size, &fragment, dirty, gfp_mask);
***************
*** 85,94 ****
if (!comp_page) {
if (!dirty)
! return 0;
set_page_dirty(page);
! page->flags &= ~(1 >> PG_launder);
! UnlockPage(page);
! return 0;
}
--- 124,132 ----
if (!comp_page) {
if (!dirty)
! goto out_failed;
set_page_dirty(page);
! ClearPageLaunder(page);
! goto out_failed;
}
***************
*** 96,101 ****
* many page to be compressed twice */
! if (not_compressed(fragment))
! goto no_compress;
/* someone used the buffer while we slept to get a comp cache
--- 134,141 ----
* many page to be compressed twice */
! if (not_compressed(fragment)) {
! memcpy(page_address(comp_page->page), page_address(page), PAGE_SIZE);
! goto out;
! }
/* someone used the buffer while we slept to get a comp cache
***************
*** 116,137 ****
out:
! if (!comp_page->page)
! BUG();
!
UnlockPage(comp_page->page);
!
! PageSetCompCache(page);
UnlockPage(page);
return 0;
-
- no_compress:
- if (fragment->compressed_size != PAGE_SIZE)
- BUG();
-
- if (fragment->offset != 0)
- BUG();
-
- memcpy(page_address(comp_page->page), page_address(page), PAGE_SIZE);
- goto out;
}
--- 156,166 ----
out:
! if (PageTestandSetCompCache(page))
! BUG();
UnlockPage(comp_page->page);
!
! out_failed:
UnlockPage(page);
return 0;
}
Index: swapin.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapin.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** swapin.c 23 Feb 2002 18:24:11 -0000 1.21
--- swapin.c 25 Feb 2002 19:34:41 -0000 1.22
***************
*** 2,6 ****
* linux/mm/comp_cache/swapin.c
*
! * Time-stamp: <2002-02-23 11:46:08 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/swapin.c
*
! * Time-stamp: <2002-02-25 15:25:38 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 19,50 ****
void
- decompress_fragment(comp_cache_fragment_t * fragment, struct page * uncompressed_page)
- {
- comp_cache_t * comp_page = fragment->comp_page;
-
- if (!comp_page || !comp_page->page)
- BUG();
- if (!PageLocked(comp_page->page))
- BUG();
- if (!PageLocked(uncompressed_page))
- BUG();
-
- if (not_compressed(fragment))
- goto only_copy;
-
- decompress(fragment_algorithm(fragment), page_address(comp_page->page) + fragment->offset, page_address(uncompressed_page));
-
- return;
-
- only_copy:
- memcpy(page_address(uncompressed_page), page_address(comp_page->page), PAGE_SIZE);
- }
-
- void
invalidate_comp_page(struct address_space *mapping, unsigned long offset, struct page * page) {
comp_cache_fragment_t * fragment;
int err = find_comp_page(mapping, offset, &fragment);
! if (page && PageCompCache(page))
PageClearCompCache(page);
--- 19,27 ----
void
invalidate_comp_page(struct address_space *mapping, unsigned long offset, struct page * page) {
comp_cache_fragment_t * fragment;
int err = find_comp_page(mapping, offset, &fragment);
! if (page)
PageClearCompCache(page);
***************
*** 58,67 ****
}
! /**
! */
! int
! lookup_comp_cache(struct address_space *mapping, unsigned long offset, struct page * page)
{
comp_cache_t * comp_page;
comp_cache_fragment_t * fragment;
swp_entry_t entry;
--- 35,105 ----
}
! extern void comp_cache_update_decomp_stats(unsigned short, stats_page_t *);
!
! static void
! decompress(comp_cache_fragment_t * fragment, struct page * page)
! {
! stats_page_t comp_page_stats;
! unsigned int algorithm = -1;
! void * from, * to;
!
! if (CompFragmentWKdm(fragment)) {
! algorithm = WKDM_IDX;
! goto actually_decomp;
! }
! if (CompFragmentWK4x4(fragment)) {
! algorithm = WK4X4_IDX;
! goto actually_decomp;
! }
!
! BUG();
!
! actually_decomp:
! from = page_address(fragment->comp_page->page) + fragment->offset;
! to = page_address(page);
!
! START_ZEN_TIME(comp_page_stats.myTimer);
! compression_algorithms[algorithm].decomp(from, to, PAGE_SIZE/4, (void *)(&comp_data));
! STOP_ZEN_TIME(comp_page_stats.myTimer, comp_page_stats.decomp_cycles);
!
! /* update some statistics */
! comp_cache_update_decomp_stats(algorithm, &comp_page_stats);
! }
!
! void
! decompress_fragment(comp_cache_fragment_t * fragment, struct page * page)
{
comp_cache_t * comp_page;
+
+ if (!fragment)
+ BUG();
+ comp_page = fragment->comp_page;
+ if (!comp_page->page)
+ BUG();
+ if (!PageLocked(page))
+ BUG();
+ if (!PageLocked(comp_page->page))
+ BUG();
+
+ if (compressed(fragment))
+ decompress(fragment, page);
+ else
+ memcpy(page_address(page), page_address(comp_page->page), PAGE_SIZE);
+
+ if (CompFragmentTestandClearDirty(fragment)) {
+ /* we want to set dirty only actually mapped pages,
+ * not temporary swap buffers, for example */
+ if (!list_empty(&page->list))
+ set_page_dirty(page);
+ list_del(&fragment->mapping_list);
+ list_add(&fragment->mapping_list, &fragment->mapping->clean_comp_pages);
+ }
+ SetPageUptodate(page);
+ PageSetCompCache(page);
+ }
+
+ inline int
+ lookup_comp_cache(struct address_space *mapping, unsigned long offset, struct page * page)
+ {
comp_cache_fragment_t * fragment;
swp_entry_t entry;
***************
*** 69,73 ****
err = find_comp_page(mapping, offset, &fragment);
!
/* it will happen with vswap address only if the vswap address
* had a real address assigned */
--- 107,111 ----
err = find_comp_page(mapping, offset, &fragment);
!
/* it will happen with vswap address only if the vswap address
* had a real address assigned */
***************
*** 75,117 ****
goto check_vswap;
! comp_page = fragment->comp_page;
!
! /* sanity check */
! if (!comp_page->page)
! BUG();
! if (!PageLocked(page))
BUG();
! if (TryLockPage(comp_page->page))
BUG();
decompress_fragment(fragment, page);
!
! if (CompFragmentDirty(fragment))
! set_page_dirty(page);
! SetPageUptodate(page);
!
! comp_cache_update_faultin_stats();
/* NOTE: we have to make sure to free the fragment only when
* the page fault has been serviced since we may shrink the
* cache and move down the vswap entry */
! comp_cache_free_locked(fragment);
UnlockPage(page);
-
- return 0;
check_vswap:
if (mapping != &swapper_space)
goto out;
!
entry.val = offset;
if (!vswap_address(entry))
goto out;
!
if (vswap_address[SWP_OFFSET(entry)]->real_entry.val)
err = -EEXIST;
!
out:
return err;
--- 113,147 ----
goto check_vswap;
! if (TryLockPage(fragment->comp_page->page))
BUG();
! if (!page->pprev_hash)
BUG();
decompress_fragment(fragment, page);
!
! /* update fault in stats */
! compression_algorithms[current_algorithm].stats.pgccin++;
/* NOTE: we have to make sure to free the fragment only when
* the page fault has been serviced since we may shrink the
* cache and move down the vswap entry */
! comp_cache_free_locked(fragment);
UnlockPage(page);
+ return 0;
+
check_vswap:
if (mapping != &swapper_space)
goto out;
!
entry.val = offset;
if (!vswap_address(entry))
goto out;
!
if (vswap_address[SWP_OFFSET(entry)]->real_entry.val)
err = -EEXIST;
!
out:
return err;
***************
*** 120,133 ****
extern struct page * find_and_dirty_page(struct address_space *mapping, unsigned long offset, struct page **hash);
! void
! truncate_comp_pages(struct address_space * mapping, unsigned long start, unsigned partial)
{
struct list_head * fragment_lh, * tmp_lh;
comp_cache_fragment_t * fragment;
! if (list_empty(&mapping->comp_pages))
! return;
!
! list_for_each_safe(fragment_lh, tmp_lh, &mapping->comp_pages) {
fragment = list_entry(fragment_lh, comp_cache_fragment_t, mapping_list);
--- 150,160 ----
extern struct page * find_and_dirty_page(struct address_space *mapping, unsigned long offset, struct page **hash);
! static void
! truncate_list_comp_pages(struct list_head * list, unsigned long start, unsigned partial)
{
struct list_head * fragment_lh, * tmp_lh;
comp_cache_fragment_t * fragment;
! list_for_each_safe(fragment_lh, tmp_lh, list) {
fragment = list_entry(fragment_lh, comp_cache_fragment_t, mapping_list);
***************
*** 140,143 ****
--- 167,177 ----
void
+ truncate_comp_pages(struct address_space * mapping, unsigned long start, unsigned partial)
+ {
+ truncate_list_comp_pages(&mapping->clean_comp_pages, start, partial);
+ truncate_list_comp_pages(&mapping->dirty_comp_pages, start, partial);
+ }
+
+ void
lookup_all_comp_pages(struct address_space * mapping)
{
***************
*** 146,150 ****
comp_cache_fragment_t * fragment;
! if (list_empty(&mapping->comp_pages))
return;
--- 180,184 ----
comp_cache_fragment_t * fragment;
! if (list_empty(&mapping->dirty_comp_pages))
return;
***************
*** 155,284 ****
try_again:
! if (list_empty(&mapping->comp_pages)) {
page_cache_release(page);
return;
}
! fragment = list_entry(mapping->comp_pages.next, comp_cache_fragment_t, mapping_list);
hash = page_hash(mapping, fragment->index);
if (add_to_page_cache_unique(page, mapping, fragment->index, hash)) {
! if (CompFragmentDirty(fragment) && !find_and_dirty_page(mapping, fragment->index, hash))
BUG();
! comp_cache_free(fragment);
goto try_again;
}
-
- if (lookup_comp_cache(mapping, fragment->index, page))
- BUG();
-
- page_cache_release(page);
- goto alloc_page;
- }
-
- /* WARNING: this function is BROKEN. Have to FIX it ASAP. Rodrigo. */
- struct page *
- shmem_lookup_comp_cache(swp_entry_t * entry, struct address_space * mapping, unsigned long idx)
- {
- struct page * page, * aux_page = NULL, * new_page = NULL;
- comp_cache_t * comp_page = NULL;
- comp_cache_fragment_t * fragment = NULL;
- unsigned long offset;
-
- offset = SWP_OFFSET(*entry);
-
- /* it might have been compressed but not yet freed */
- page = __find_get_page(&swapper_space, entry->val, page_hash(&swapper_space, entry->val));
-
- if (page)
- goto found_swap_cache;
-
- goto try_comp_cache;
-
- try_page_cache:
- comp_page = NULL;
-
- page = __find_get_page(mapping, idx, page_hash(mapping, idx));
-
- if (page)
- goto found_swap_cache;
! /* fall through */
! try_comp_cache:
! comp_page = find_comp_page(&swapper_space, entry->val, &fragment);
!
! if (!comp_page) {
! if (new_page) {
! page_cache_release(new_page);
! wait_on_page(aux_page);
! }
!
! goto out;
! }
!
! if (!comp_page->page)
! BUG();
!
! if (TryLockPage(comp_page->page))
! BUG();
!
! if (!new_page) {
! aux_page = comp_page->page;
! UnlockPage(comp_page->page);
!
! new_page = alloc_page(GFP_HIGHUSER);
!
! goto try_page_cache;
! }
!
! if (TryLockPage(new_page))
BUG();
- page = new_page;
decompress_fragment(fragment, page);
-
- comp_cache_update_faultin_stats();
! if (add_to_swap_cache(page, *entry))
BUG();
- set_page_dirty(page);
! DEBUG_CHECK_COUNT;
! /* NOTE: we have to make sure to free the fragment only when
! * the page fault has been serviced since we may shrink the
! * cache and move down the vswap entry. If that happens,
! * recall that in do_swap_page we will notice that the pte has
! * changed and will back out the fault */
! comp_cache_free_locked(fragment);
!
UnlockPage(page);
! goto out;
!
! found_swap_cache:
! if (!comp_page)
! comp_page = find_comp_page(&swapper_space, entry->val, &fragment);
!
! if (comp_page) {
! comp_cache_free(fragment);
!
! /* if the page has been added to comp cache, it was
! * dirty and had its dirty bit cleared when it was
! * compressed (ie, written). Well, if it's still
! * present in swap cache and in comp cache too, it
! * means that it has not yet been swapped out. So I
! * gotta set the page dirty bit back to make it to be
! * compressed if needed. */
! set_page_dirty(page);
! }
!
! if (new_page)
! page_cache_release(new_page);
!
! out:
! if (comp_page && PageLocked(comp_page->page))
! BUG();
!
! return page;
}
--- 189,225 ----
try_again:
! if (list_empty(&mapping->dirty_comp_pages)) {
page_cache_release(page);
return;
}
! fragment = list_entry(mapping->dirty_comp_pages.next, comp_cache_fragment_t, mapping_list);
hash = page_hash(mapping, fragment->index);
+
+ if (!CompFragmentDirty(fragment))
+ BUG();
if (add_to_page_cache_unique(page, mapping, fragment->index, hash)) {
! if (!find_and_dirty_page(mapping, fragment->index, hash))
BUG();
! CompFragmentClearDirty(fragment);
! list_del(&fragment->mapping_list);
! list_add(&fragment->mapping_list, &fragment->mapping->clean_comp_pages);
goto try_again;
}
! if (TryLockPage(fragment->comp_page->page))
BUG();
decompress_fragment(fragment, page);
! if (!PageDirty(page))
BUG();
! UnlockPage(fragment->comp_page->page);
! page_cache_release(page);
UnlockPage(page);
! goto alloc_page;
}
Index: swapout.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/swapout.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -r1.27 -r1.28
*** swapout.c 23 Feb 2002 18:24:11 -0000 1.27
--- swapout.c 25 Feb 2002 19:34:41 -0000 1.28
***************
*** 2,6 ****
* /mm/comp_cache/swapout.c
*
! * Time-stamp: <2002-02-23 14:52:16 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* /mm/comp_cache/swapout.c
*
! * Time-stamp: <2002-02-25 16:12:13 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 108,116 ****
list_add_tail(swp_buffer_lh, &swp_used_buffer_head);
- buffer_page->index = fragment->index;
- buffer_page->mapping = fragment->mapping;
-
swp_buffer->fragment = fragment;
return (swp_buffer);
}
--- 108,116 ----
list_add_tail(swp_buffer_lh, &swp_used_buffer_head);
swp_buffer->fragment = fragment;
+ buffer_page->index = fragment->index;
+ buffer_page->mapping = fragment->mapping;
+
return (swp_buffer);
}
***************
*** 118,122 ****
extern void decompress_fragment(comp_cache_fragment_t *, struct page *);
! static inline struct swp_buffer * decompress_to_swp_buffer(comp_cache_fragment_t * fragment) {
struct page * buffer_page;
struct swp_buffer * swp_buffer;
--- 118,123 ----
extern void decompress_fragment(comp_cache_fragment_t *, struct page *);
! static struct swp_buffer *
! decompress_to_swp_buffer(comp_cache_fragment_t * fragment) {
struct page * buffer_page;
struct swp_buffer * swp_buffer;
***************
*** 132,142 ****
if (!buffer_page)
BUG();
-
if (TryLockPage(fragment->comp_page->page))
BUG();
decompress_fragment(fragment, buffer_page);
UnlockPage(fragment->comp_page->page);
return swp_buffer;
}
--- 133,144 ----
if (!buffer_page)
BUG();
if (TryLockPage(fragment->comp_page->page))
BUG();
decompress_fragment(fragment, buffer_page);
+ buffer_page->flags &= (1 << PG_locked);
UnlockPage(fragment->comp_page->page);
+
return swp_buffer;
}
***************
*** 222,228 ****
extern void add_fragment_vswap(comp_cache_fragment_t *);
! /* get_comp_cache_page(page, compressed_size, fragment_out, gfp_mask)
! * - gets a Compressed Cache entry, freeing one if necessary. This is
! * done writing out the data the chosen (to be freed) entry stores.
*
* return value: pointer to the comp cache entry to be used. The comp
--- 224,231 ----
extern void add_fragment_vswap(comp_cache_fragment_t *);
! /***
! * get_comp_cache_page - gets a Compressed Cache entry, freeing one if
! * necessary. This is done writing out the data the chosen (to be
! * freed) entry stores.
*
* return value: pointer to the comp cache entry to be used. The comp
***************
*** 322,344 ****
BUG();
! check_references:
! /* it has been faulted in by some process(es), so we should
! * not compress this page. In vanilla kernel, we will handle
! * the case where page_count > 2 but there is no buffers to be
! * cleaned. In ac series, we will handle cases where there are
! * any references to this page but us and swap cache (and
! * buffers if we have pending buffers to be cleaned).
! *
! * ac:
! * if ((page_count(page) - !!page->buffers) > 2) {
! *
! * linus:
! * if (!page->buffers && page_count(page) > 2) {
! * */
! if (mapped(page)) {
! add_comp_page_to_hash_table(comp_page);
! UnlockPage(comp_page->page);
! return NULL;
! }
if (!comp_page->free_space)
--- 325,332 ----
BUG();
! check_references:
! /* 2 = us + page cache */
! if (page_count(page) - !!page->buffers != 2)
! goto out_failed;
if (!comp_page->free_space)
***************
*** 347,350 ****
--- 335,342 ----
/* allocate the new fragment */
fragment = alloc_fragment();
+
+ if (!fragment)
+ goto out_failed;
+
fragment->index = page->index;
fragment->mapping = page->mapping;
***************
*** 354,360 ****
fragment->comp_page = comp_page;
- if (dirty)
- CompFragmentSetDirty(fragment);
-
#if 0
{
--- 346,349 ----
***************
*** 372,377 ****
comp_page->free_offset += compressed_size;
- page->mapping->nrpages++;
-
last_page_size[last_page] = compressed_size;
last_page = (last_page++)%NUM_MEAN_PAGES;
--- 361,364 ----
***************
*** 407,414 ****
out:
! /* only real swap adressed fragments are added to lru queue */
add_fragment_to_hash_table(fragment);
add_fragment_to_lru_queue(fragment);
- list_add(&(fragment->mapping_list), &fragment->mapping->comp_pages);
if (comp_page->free_space < 0)
--- 394,407 ----
out:
! if (dirty) {
! CompFragmentSetDirty(fragment);
! list_add(&fragment->mapping_list, &fragment->mapping->dirty_comp_pages);
! }
! else
! list_add(&fragment->mapping_list, &fragment->mapping->clean_comp_pages);
! page->mapping->nrpages++;
!
add_fragment_to_hash_table(fragment);
add_fragment_to_lru_queue(fragment);
if (comp_page->free_space < 0)
***************
*** 423,426 ****
--- 416,424 ----
return comp_page;
+
+ out_failed:
+ add_comp_page_to_hash_table(comp_page);
+ UnlockPage(comp_page->page);
+ return NULL;
}
***************
*** 445,448 ****
--- 443,447 ----
list_add(&(swp_buffer->list), &swp_free_buffer_head);
+ INIT_LIST_HEAD(&buffer_page->list);
}
}
Index: vswap.c
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/mm/comp_cache/vswap.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** vswap.c 23 Feb 2002 18:24:11 -0000 1.24
--- vswap.c 25 Feb 2002 19:34:41 -0000 1.25
***************
*** 2,6 ****
* linux/mm/comp_cache/vswap.c
*
! * Time-stamp: <2002-02-22 11:09:07 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache/vswap.c
*
! * Time-stamp: <2002-02-25 13:49:32 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 27,30 ****
--- 27,32 ----
struct list_head vswap_address_used_head;
+ static struct pte_list * pte_list_freelist = NULL;
+
/* comp_cache_freeable_space = this is the estimated freeable space in
* the compressed cache, ie, the space in compressed cache minus the
***************
*** 49,57 ****
unsigned short last_page = 0;
- static kmem_cache_t * pte_cachep;
-
- #define alloc_pte_list() \
- ((struct pte_list *) kmem_cache_alloc(pte_cachep, SLAB_ATOMIC))
-
static inline int
comp_cache_mean_size(void) {
--- 51,54 ----
***************
*** 69,75 ****
}
! /* comp_cache_available_vswap(void) - this function checks to see if
! * we have any available vswap entry and also if we can assign any
! * vswap entry. */
int
comp_cache_available_vswap(void) {
--- 66,73 ----
}
! /***
! * comp_cache_available_vswap - this function returns 1 if we have any
! * available vswap entry and also if we can assign any vswap entry.
! */
int
comp_cache_available_vswap(void) {
***************
*** 100,103 ****
--- 98,105 ----
}
+ /***
+ * comp_cache_available_space - broader function which will check also
+ * if we have virtual swap entries to be compressed.
+ */
inline int
comp_cache_available_space(void) {
***************
*** 105,109 ****
return 1;
! /* we can still compress all these entries */
if (vswap_num_reserved_entries > 0)
return 1;
--- 107,111 ----
return 1;
! /* can we still compress all these entries? */
if (vswap_num_reserved_entries > 0)
return 1;
***************
*** 112,120 ****
}
! /* remap_vswap_ptes(entry, page): remap all ptes that are set to a
! * virtual swap entry which has already been assigned to this _entry_
! * real address, ie vswap->real_entry.val == entry.val, to the
! * page. This is much useful in swapoff process. It's called from
! * try_to_unuse():swapfile.c */
void
remap_vswap_ptes(swp_entry_t entry, struct page * page) {
--- 114,130 ----
}
! /***
! * remap_vswap_ptes - remap all pending ptes (ptes set to a virtual
! * swap entry which has already been given a real entry) to a page in
! * memory.
! * @entry: virtual swap entry that will have all its ptes remapped
! * @page: page to which all the ptes are going to be set.
! *
! * This function will map all the ptes still set to this virtual swap
! * entry because we couldn't set them when assigning a real entry to
! * this vswap. It may be called from try_to_unuse():swapfile.c in
! * swapoff process
! *
! */
void
remap_vswap_ptes(swp_entry_t entry, struct page * page) {
***************
*** 156,160 ****
++vma->vm_mm->rss;
! comp_cache_swp_free_generic(old_entry, 0);
next:
--- 166,170 ----
++vma->vm_mm->rss;
! comp_cache_swp_free(old_entry);
next:
***************
*** 164,169 ****
}
swp_entry_t
! get_virtual_swap_page(struct page * page, unsigned short count)
{
swp_entry_t entry;
--- 174,190 ----
}
+ /**
+ * get_virtual_swap_page - returns a vswap entry, if available, and
+ * initializes it.
+ *
+ * This function checks if we have available virtual swap space. If we
+ * do, it removes a virtual swap entry from the free list, zeroing the
+ * data struct, but the count, which will be set to 1. Updates the
+ * control variables: number of used entries and number of reserved
+ * entries.
+ *
+ */
swp_entry_t
! get_virtual_swap_page(void)
{
swp_entry_t entry;
***************
*** 192,196 ****
BUG();
! vswap_address[offset]->count = count;
vswap_address[offset]->pte_list = NULL;
vswap_address[offset]->swap_cache_page = NULL;
--- 213,217 ----
BUG();
! vswap_address[offset]->count = 1;
vswap_address[offset]->pte_list = NULL;
vswap_address[offset]->swap_cache_page = NULL;
***************
*** 209,213 ****
}
!
void
comp_cache_swp_duplicate(swp_entry_t entry)
--- 230,239 ----
}
! /**
! * comp_cache_swp_duplicate - swap_duplicate for virtual swap
! * addresses.
! * @entry: the virtual swap entry which will have its count
! * incremented
! */
void
comp_cache_swp_duplicate(swp_entry_t entry)
***************
*** 229,234 ****
}
int
! comp_cache_swp_free_generic(swp_entry_t entry, int free_fragment)
{
unsigned long offset = SWP_OFFSET(entry);
--- 255,273 ----
}
+ /**
+ * comp_cache_swp_free - swap_free for virtual swap addresses.
+ * @entry: the virtual swap entry which will have its count
+ * decremented and possibly the vswap entry freed.
+ *
+ * This function will decrement the vswap entry counter. If we have
+ * had a real swap address assigned, we will call swap_free() for it,
+ * since we hold a reference to the real address for every pending
+ * pte. If we get to count == 0, the entry will have its struct
+ * initalized and be added to the free list. In the case we have a
+ * fragment (recall that fragments don't hold references on swap
+ * addresses), we will free it too.
+ */
int
! comp_cache_swp_free(swp_entry_t entry)
{
unsigned long offset = SWP_OFFSET(entry);
***************
*** 285,295 ****
BUG();
- /* we won't free the fragment when assigning a real address to
- * a virtual addressed fragment in comp_cache_release() */
- if (!free_fragment) {
- list_del_init(&vswap->list);
- goto add_to_free_list;
- }
-
/* NOTE: that should be checked out after we updated the
* vswap, since it may shrink the cache */
--- 324,327 ----
***************
*** 313,316 ****
--- 345,354 ----
}
+ /**
+ * comp_cache_swp_count - swap_count for virtual swap addresses.
+ * @entry: virtual swap entry that will be returned its counter.
+ *
+ * This function returns the counter for the vswap entry parameter.
+ */
int
comp_cache_swp_count(swp_entry_t entry)
***************
*** 327,336 ****
}
! /* remove_fragment_vswap(fragment) - this function tells the vswap
! * entry that it does not have a fragment any longer.
*
! * That means that we are going to set the fragment variable to
! * VSWAP_RESERVED, remove the vswap entry from the used list and
! * update control variables */
inline void
remove_fragment_vswap(comp_cache_fragment_t * fragment)
--- 365,383 ----
}
! /***
! * remove_fragment_vswap - this function tells the vswap entry that it
! * doesn't have a compressed fragment any longer.
! * @fragment: fragment which will removed from the vswap entry struct.
! *
! * Based on the fragment->index, this function sets the fragment field
! * of vswap struct to the VSWAP_RESERVED, removes the vswap entry from
! * the used list and update some control variables: the number of
! * reserved entries (entries w/o fragment) and also the freeable
! * space. Once the fragment is removed, this vswap entry will be taken
! * as reserved, since it is used but doesn't have a compressed
! * fragment. The number of reserved entries will be used to know if we
! * can or not give away new vswap entries.
*
! */
inline void
remove_fragment_vswap(comp_cache_fragment_t * fragment)
***************
*** 362,371 ****
}
! /* add_fragment_vswap(fragment) - this function tells the vswap entry
! * that it has a compressed fragment.
*
! * That means that we are going to set the fragment variable to the
! * fragment address, add the vswap entry to the used list and update
! * control variables */
inline void
add_fragment_vswap(comp_cache_fragment_t * fragment)
--- 409,424 ----
}
! /***
! * add_fragment_vswap - this function tells the vswap entry that it
! * has a compressed fragment.
! * @fragment: fragment which will added to the vswap entry struct.
! *
! * Based on the fragment->index, this function sets the fragment field
! * of vswap struct to the fragment address, adds the vswap entry to
! * the used list and update some control variables: the number of
! * reserved entries (entries w/o fragment) and also the freeable space
! * (since this fragment does not have backing storage).
*
! */
inline void
add_fragment_vswap(comp_cache_fragment_t * fragment)
***************
*** 397,417 ****
}
! inline void
! pte_list_free(struct pte_list * pte_list, struct pte_list * prev_pte_list, unsigned long offset) {
! if (!prev_pte_list) {
vswap_address[offset]->pte_list = pte_list->next;
! goto out;
! }
! prev_pte_list->next = pte_list->next;
! out:
! kmem_cache_free(pte_cachep, (pte_list));
}
! /* this function is mostly based on page_remove_pmap from reverse
! * mapping patch by Rik van Riel */
! inline void
! remove_pte_vswap(pte_t * ptep)
{
struct pte_list * pte_list, * prev_pte_list = NULL;
--- 450,542 ----
}
! /**
! * pte_list_free - free pte_list structure
! * @pte_list: pte_list struct to free
! * @prev_pte_list: previous pte_list on the list (may be NULL)
! * @page: page this pte_list hangs off (may be NULL)
! *
! * This function unlinks pte_list from the singly linked list it
! * may be on and adds the pte_list to the free list. May also be
! * called for new pte_list structures which aren't on any list yet.
! * Caller needs to hold the pagemap_lru_list.
! *
! * (adapted from Rik van Riel's rmap patch)
! */
! static inline void
! pte_list_free(struct pte_list * pte_list, struct pte_list * prev_pte_list, unsigned long offset)
! {
! if (prev_pte_list)
! prev_pte_list->next = pte_list->next;
! else
vswap_address[offset]->pte_list = pte_list->next;
!
! pte_list->ptep = NULL;
! pte_list->next = pte_list_freelist;
! pte_list_freelist = pte_list;
! }
! /**
! * alloc_new_pte_lists - convert a free page to pte_list structures
! *
! * Grabs a free page and converts it to pte_list structures. We really
! * should pre-allocate these earlier in the pagefault path or come up
! * with some other trick.
! *
! * Note that we cannot use the slab cache because the pte_list structure
! * is way smaller than the minimum size of a slab cache allocation.
! */
! static void alloc_new_pte_lists(void)
! {
! struct pte_list * pte_list = (void *) get_zeroed_page(GFP_ATOMIC);
! int i = PAGE_SIZE / sizeof(struct pte_list);
! if (pte_list) {
! for (; i-- > 0; pte_list++) {
! pte_list->ptep = NULL;
! pte_list->next = pte_list_freelist;
! pte_list_freelist = pte_list;
! }
! } else
! panic("Fix pte_list allocation, you lazy bastard!\n");
}
! /**
! * pte_list_alloc - allocate a pte_list struct
! *
! * Returns a pointer to a fresh pte_list structure. Allocates new
! * pte_list structures as required.
! * Caller needs to hold the pagemap_lru_lock.
! *
! * (adapted from Rik van Riel's rmap patch)
! */
! static inline struct pte_list * pte_list_alloc(void)
! {
! struct pte_list * pte_list;
!
! /* Allocate new pte_list structs as needed. */
! if (!pte_list_freelist)
! alloc_new_pte_lists();
!
! /* Grab the first pte_list from the freelist. */
! pte_list = pte_list_freelist;
! pte_list_freelist = pte_list->next;
! pte_list->next = NULL;
!
! return pte_list;
! }
!
!
! /**
! * remove_pte_vswap - remove a pte from a vswap entry
! * @ptep: pointer to the pte to be removed
! *
! * This function searchs for the pte in the pte_list from its vswap
! * address entry, freeing it. Returns for null, present and real swap
! * adressed ptes.
! *
! * (adapted from Rik van Riel's rmap patch)
! */
! void FASTCALL(remove_pte_vswap(pte_t *));
! void remove_pte_vswap(pte_t * ptep)
{
struct pte_list * pte_list, * prev_pte_list = NULL;
***************
*** 449,454 ****
}
! inline void
! add_swap_cache_page_vswap(struct page * page, swp_entry_t entry)
{
unsigned long offset;
--- 574,620 ----
}
! /**
! * add_pte_vswap - add a pte to a vswap entry pte list
! * @ptep: pointer to the pte to be added
! * @entry: vswap entry to whose list will be added the ptep
! *
! * This function allocates a new pte_list struct, adding to the
! * corresponding virtual swap entry struct. Returns null for real swap
! * entries.
! *
! * (adapted from Rik van Riel's rmap patch)
! */
! void FASTCALL(add_pte_vswap(pte_t *, swp_entry_t));
! void add_pte_vswap(pte_t * ptep, swp_entry_t entry) {
! unsigned long offset;
! struct pte_list * pte_list;
!
! if (!vswap_address(entry))
! return;
!
! offset = SWP_OFFSET(entry);
!
! pte_list = pte_list_alloc();
! pte_list->next = vswap_address[offset]->pte_list;
! pte_list->ptep = ptep;
!
! vswap_address[offset]->pte_list = pte_list;
! }
!
!
!
! /**
! * add_swap_cache_page_vswap - adds the swap cache page to the
! * corresponding vswap entry.
! * @page: page to be added to the struct
! * @entry: vswap address
! *
! * This function adds the virtual swap address entry struct to the
! * page passed as parameter. It's useful to avoid looking for the page
! * whenever some change to the vswap adress is needed.
! *
! */
! void FASTCALL(add_swap_cache_page_vswap(struct page *, swp_entry_t));
! void add_swap_cache_page_vswap(struct page * page, swp_entry_t entry)
{
unsigned long offset;
***************
*** 465,470 ****
}
! inline void
! del_swap_cache_page_vswap(struct page * page)
{
unsigned long offset;
--- 631,648 ----
}
!
! /**
! * del_swap_cache_page_vswap - deletes the swap cache page from the
! * corresponding vswap entry.
! * @page: page to be deleted to the struct
! *
! * This function removes the page from the corresponding virtual swap
! * address entry (we can get the entry from page->index). It will be
! * called when removing a page from swap cache or before assigning a
! * real entry.
! *
! */
! void FASTCALL(del_swap_cache_page_vswap(struct page *));
! void del_swap_cache_page_vswap(struct page * page)
{
unsigned long offset;
***************
*** 484,504 ****
}
! inline void
! add_pte_vswap(pte_t * ptep, swp_entry_t entry) {
! unsigned long offset;
! struct pte_list * tmp_pte_list;
!
! if (!vswap_address(entry))
! return;
!
! offset = SWP_OFFSET(entry);
!
! tmp_pte_list = alloc_pte_list();
! tmp_pte_list->next = vswap_address[offset]->pte_list;
! tmp_pte_list->ptep = ptep;
!
! vswap_address[offset]->pte_list = tmp_pte_list;
! }
!
void
vswap_alloc_and_init(struct vswap_address ** vswap_address, int offset) {
--- 662,676 ----
}
! /**
! * vswap_alloc_and_init - allocates a new virtual swap entry and inits
! * it.
! * @vswap_address: main virtual swap array of pointers to
! * vswap_address structs.
! * @offset: offset within the vswap_address.
! *
! * This function allocates a new virtual swap entry and initializes
! * its struct, adding it to the list of free vswap entries.
! *
! */
void
vswap_alloc_and_init(struct vswap_address ** vswap_address, int offset) {
***************
*** 543,548 ****
last_page_size = (unsigned short *) vmalloc(NUM_MEAN_PAGES * sizeof(unsigned short));
-
- pte_cachep = kmem_cache_create("pte_cache", sizeof(struct pte_list), 0, SLAB_HWCACHE_ALIGN, NULL, NULL);
for (i = 0; i < NUM_MEAN_PAGES; i++)
--- 715,718 ----
|
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-25 19:34:43
|
Update of /cvsroot/linuxcompressed/linux/include/linux
In directory usw-pr-cvs1:/tmp/cvs-serv26754/include/linux
Modified Files:
comp_cache.h fs.h mm.h
Log Message:
This version fixes some bugs regarding the clean pages support. And
fixes many other bugs with the page cache support, besides code
cleanups. The improvement done in this version is the replacement of
the slab cache by Rik van Riel's rmap allocation for pte lists.
- now address space have two lists for compressed pages: dirty and
clean lists.
- some static inline functions that were in comp_cache.h have been
moved to the c file that uses it.
- all vswap functions that are often called are now compiled with
FASTCALL option.
- all vswap functions have been documented and cleaned up.
- since our pte_list struct is smaller than the minimum size needed
for slab cache, slab cache has been replaced by Rik's allocation,
that's pretty simple.
- failed fragment allocations are handled now.
- shared memory _broken_ support removed, since it was broken and only
bothering us.
Index: comp_cache.h
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/include/linux/comp_cache.h,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -r1.52 -r1.53
*** comp_cache.h 23 Feb 2002 18:24:10 -0000 1.52
--- comp_cache.h 25 Feb 2002 19:34:40 -0000 1.53
***************
*** 2,6 ****
* linux/mm/comp_cache.h
*
! * Time-stamp: <2002-02-23 14:36:13 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache.h
*
! * Time-stamp: <2002-02-25 09:43:46 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 285,367 ****
extern int current_algorithm;
- extern inline int
- fragment_algorithm(comp_cache_fragment_t * fragment)
- {
- if (CompFragmentWKdm(fragment))
- return WKDM_IDX;
-
- if (CompFragmentWK4x4(fragment))
- return WK4X4_IDX;
-
- return -1;
- }
-
- extern void comp_cache_update_comp_stats(unsigned short, stats_page_t *);
-
- static inline int compress(void * from, void * to, unsigned short * algorithm) {
- stats_page_t comp_page_stats;
-
- START_ZEN_TIME(comp_page_stats.myTimer);
- comp_page_stats.comp_size = compression_algorithms[current_algorithm].comp(from, to, PAGE_SIZE/4, (void *)(&comp_data));
- STOP_ZEN_TIME(comp_page_stats.myTimer, comp_page_stats.comp_cycles);
-
- /* update some statistics */
- comp_cache_update_comp_stats(current_algorithm, &comp_page_stats);
-
- *algorithm = current_algorithm;
-
- return ((comp_page_stats.comp_size <= PAGE_SIZE)?comp_page_stats.comp_size:PAGE_SIZE);
- }
-
- extern void comp_cache_update_decomp_stats(unsigned short, stats_page_t *);
-
- static inline void decompress(unsigned short algorithm, void * from, void * to) {
- stats_page_t comp_page_stats;
-
- START_ZEN_TIME(comp_page_stats.myTimer);
- compression_algorithms[algorithm].decomp(from, to, PAGE_SIZE/4, (void *)(&comp_data));
- STOP_ZEN_TIME(comp_page_stats.myTimer, comp_page_stats.decomp_cycles);
-
- /* update some statistics */
- comp_cache_update_decomp_stats(algorithm, &comp_page_stats);
- }
-
- static inline void comp_cache_update_faultin_stats(void) {
- compression_algorithms[current_algorithm].stats.pgccin++;
- }
-
- static inline void
- set_fragment_algorithm(comp_cache_fragment_t * fragment, unsigned short algorithm)
- {
- switch(algorithm) {
- case WKDM_IDX:
- CompFragmentSetWKdm(fragment);
- break;
- case WK4X4_IDX:
- CompFragmentSetWK4x4(fragment);
- break;
- default:
- BUG();
- }
- }
-
/* swapin.c */
#ifdef CONFIG_COMP_CACHE
! int lookup_comp_cache(struct address_space *, unsigned long, struct page *);
! struct page * shmem_lookup_comp_cache(swp_entry_t *, struct address_space *, unsigned long);
void invalidate_comp_page(struct address_space *, unsigned long, struct page *);
void truncate_comp_pages(struct address_space *, unsigned long, unsigned);
void lookup_all_comp_pages(struct address_space *);
- static inline int mapping_has_comp_pages(struct address_space * mapping) { return !list_empty(&mapping->comp_pages); }
-
#else
! static inline int lookup_comp_cache(swp_entry_t) { return 0; }
! static inline struct page * shmem_lookup_comp_cache(swp_entry_t *, struct address_space *, unsigned long)
! {
! return find_get_page(&swapper_space, entry->val);
! }
static inline void invalidate_comp_page(struct address_space * mapping, unsigned long offset, struct page * page) { };
- static inline int mapping_has_comp_pages(struct address_space * mapping) { return 0; }
-
static inline void truncate_comp_pages(struct address_space * mapping, unsigned long start, unsigned partial) { };
static inline void lookup_all_comp_pages(struct address_space * mapping) { };
--- 285,297 ----
extern int current_algorithm;
/* swapin.c */
#ifdef CONFIG_COMP_CACHE
! int lookup_comp_cache(struct address_space *, unsigned long, struct page *);
void invalidate_comp_page(struct address_space *, unsigned long, struct page *);
void truncate_comp_pages(struct address_space *, unsigned long, unsigned);
void lookup_all_comp_pages(struct address_space *);
#else
! static inline int lookup_comp_cache(swp_entry_t entry) { return 0; }
static inline void invalidate_comp_page(struct address_space * mapping, unsigned long offset, struct page * page) { };
static inline void truncate_comp_pages(struct address_space * mapping, unsigned long start, unsigned partial) { };
static inline void lookup_all_comp_pages(struct address_space * mapping) { };
***************
*** 411,430 ****
#define reserved(offset) (vswap_address[offset]->fragment == VSWAP_RESERVED)
- #define comp_cache_swp_free(swp_entry) comp_cache_swp_free_generic(swp_entry, 1)
-
void comp_cache_swp_duplicate(swp_entry_t);
! int comp_cache_swp_free_generic(swp_entry_t, int);
! int comp_cache_swp_count(swp_entry_t);
inline int comp_cache_available_space(void);
! swp_entry_t get_virtual_swap_page(struct page *, unsigned short);
void remap_vswap_ptes(swp_entry_t, struct page *);
!
! inline void add_pte_vswap(pte_t *, swp_entry_t);
! inline void remove_pte_vswap(pte_t *);
! inline void add_swap_cache_page_vswap(struct page *, swp_entry_t);
! inline void del_swap_cache_page_vswap(struct page *);
void vswap_alloc_and_init(struct vswap_address **, int);
--- 341,357 ----
#define reserved(offset) (vswap_address[offset]->fragment == VSWAP_RESERVED)
void comp_cache_swp_duplicate(swp_entry_t);
! int comp_cache_swp_free(swp_entry_t);
! int comp_cache_swp_count(swp_entry_t);
inline int comp_cache_available_space(void);
! swp_entry_t get_virtual_swap_page(void);
void remap_vswap_ptes(swp_entry_t, struct page *);
! extern void FASTCALL(add_pte_vswap(pte_t *, swp_entry_t));
! extern void FASTCALL(remove_pte_vswap(pte_t *));
! extern void FASTCALL(add_swap_cache_page_vswap(struct page *, swp_entry_t));
! extern void FASTCALL(del_swap_cache_page_vswap(struct page *));
void vswap_alloc_and_init(struct vswap_address **, int);
***************
*** 436,441 ****
#define vswap_address(entry) (0)
- #define comp_cache_swp_free(swp_entry) comp_cache_swp_free_generic(swp_entry, 1)
-
static inline void comp_cache_swp_duplicate(swp_entry_t entry) {};
static inline int comp_cache_swp_free_generic(swp_entry_t entry, int free_fragment) { return 0; }
--- 363,366 ----
***************
*** 454,459 ****
/* free.c */
- inline void comp_cache_free(comp_cache_fragment_t *);
void comp_cache_free_locked(comp_cache_fragment_t *);
#ifdef CONFIG_COMP_CACHE
--- 379,384 ----
/* free.c */
void comp_cache_free_locked(comp_cache_fragment_t *);
+ inline void comp_cache_free(comp_cache_fragment_t *);
#ifdef CONFIG_COMP_CACHE
Index: fs.h
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/include/linux/fs.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** fs.h 21 Feb 2002 15:14:11 -0000 1.1
--- fs.h 25 Feb 2002 19:34:40 -0000 1.2
***************
*** 398,402 ****
struct list_head dirty_pages; /* list of dirty pages */
#ifdef CONFIG_COMP_CACHE
! struct list_head comp_pages; /* list of compressed pages */
#endif
struct list_head locked_pages; /* list of locked pages */
--- 398,403 ----
struct list_head dirty_pages; /* list of dirty pages */
#ifdef CONFIG_COMP_CACHE
! struct list_head clean_comp_pages; /* list of clean compressed pages */
! struct list_head dirty_comp_pages; /* list of dirty compressed pages */
#endif
struct list_head locked_pages; /* list of locked pages */
Index: mm.h
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/include/linux/mm.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** mm.h 23 Feb 2002 18:24:10 -0000 1.13
--- mm.h 25 Feb 2002 19:34:40 -0000 1.14
***************
*** 303,306 ****
--- 303,307 ----
#define PageLaunder(page) test_bit(PG_launder, &(page)->flags)
#define SetPageLaunder(page) set_bit(PG_launder, &(page)->flags)
+ #define ClearPageLaunder(page) clear_bit(PG_launder, &(page)->flags)
extern void FASTCALL(set_page_dirty(struct page *));
***************
*** 333,336 ****
--- 334,338 ----
#define PageClearCompCache(page) clear_bit(PG_comp_cache, &(page)->flags)
#define PageTestandSetCompCache(page) test_and_set_bit(PG_comp_cache, &(page)->flags)
+ #define PageTestandClearCompCache(page) test_and_clear_bit(PG_comp_cache, &(page)->flags)
#define PageActive(page) test_bit(PG_active, &(page)->flags)
|
|
From: Rodrigo S. de C. <rc...@us...> - 2002-02-25 19:34:43
|
Update of /cvsroot/linuxcompressed/linux/fs In directory usw-pr-cvs1:/tmp/cvs-serv26754/fs Modified Files: inode.c Log Message: This version fixes some bugs regarding the clean pages support. And fixes many other bugs with the page cache support, besides code cleanups. The improvement done in this version is the replacement of the slab cache by Rik van Riel's rmap allocation for pte lists. - now address space have two lists for compressed pages: dirty and clean lists. - some static inline functions that were in comp_cache.h have been moved to the c file that uses it. - all vswap functions that are often called are now compiled with FASTCALL option. - all vswap functions have been documented and cleaned up. - since our pte_list struct is smaller than the minimum size needed for slab cache, slab cache has been replaced by Rik's allocation, that's pretty simple. - failed fragment allocations are handled now. - shared memory _broken_ support removed, since it was broken and only bothering us. Index: inode.c =================================================================== RCS file: /cvsroot/linuxcompressed/linux/fs/inode.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** inode.c 21 Feb 2002 15:14:11 -0000 1.1 --- inode.c 25 Feb 2002 19:34:40 -0000 1.2 *************** *** 104,108 **** INIT_LIST_HEAD(&inode->i_data.dirty_pages); #ifdef CONFIG_COMP_CACHE ! INIT_LIST_HEAD(&inode->i_data.comp_pages); #endif INIT_LIST_HEAD(&inode->i_data.locked_pages); --- 104,109 ---- INIT_LIST_HEAD(&inode->i_data.dirty_pages); #ifdef CONFIG_COMP_CACHE ! INIT_LIST_HEAD(&inode->i_data.clean_comp_pages); ! INIT_LIST_HEAD(&inode->i_data.dirty_comp_pages); #endif INIT_LIST_HEAD(&inode->i_data.locked_pages); |