[lc-checkins] CVS: linux/include/linux comp_cache.h,1.90,1.91 mm.h,1.16,1.17
Status: Beta
Brought to you by:
nitin_sf
|
From: Rodrigo S. de C. <rc...@us...> - 2002-07-16 18:41:58
|
Update of /cvsroot/linuxcompressed/linux/include/linux
In directory usw-pr-cvs1:/tmp/cvs-serv28423/include/linux
Modified Files:
comp_cache.h mm.h
Log Message:
Cleanups
o remove support for pages with buffers
o virtual swap code (mainly when freeing an entry or allocating a page to
service a page fault)
Other
o Added help for CONFIG_COMP_DOUBLE_PAGE into Configure.help
Index: comp_cache.h
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/include/linux/comp_cache.h,v
retrieving revision 1.90
retrieving revision 1.91
diff -C2 -r1.90 -r1.91
*** comp_cache.h 15 Jul 2002 20:52:23 -0000 1.90
--- comp_cache.h 16 Jul 2002 18:41:54 -0000 1.91
***************
*** 2,6 ****
* linux/mm/comp_cache.h
*
! * Time-stamp: <2002-07-15 13:44:19 rcastro>
*
* Linux Virtual Memory Compressed Cache
--- 2,6 ----
* linux/mm/comp_cache.h
*
! * Time-stamp: <2002-07-16 14:49:02 rcastro>
*
* Linux Virtual Memory Compressed Cache
***************
*** 364,384 ****
#endif
- #ifdef CONFIG_COMP_PAGE_CACHE
- void steal_page_from_comp_cache(struct page *, struct page *);
- #else
- static inline void steal_page_from_comp_cache(struct page * page, struct page * new_page) {};
- #endif
-
- #if defined(CONFIG_COMP_PAGE_CACHE) && !defined(CONFIG_COMP_DEMAND_RESIZE)
- int comp_cache_try_to_release_page(struct page **, int, int);
- #else
- static inline int comp_cache_try_to_release_page(struct page ** page, int gfp_mask, int priority) { return try_to_release_page(*page, gfp_mask); }
- #endif
-
/* vswap.c */
struct vswap_address {
struct list_head list;
! unsigned int count;
unsigned long offset;
--- 364,376 ----
#endif
/* vswap.c */
struct vswap_address {
struct list_head list;
! /* how many ptes are set to this vswap address */
! unsigned int swap_count;
! /* number of faults being serviced at a given moment */
! unsigned int fault_count;
! /* offset within the vswap table */
unsigned long offset;
***************
*** 409,413 ****
#define COMP_CACHE_SWP_TYPE MAX_SWAPFILES
#define VSWAP_RESERVED ((struct comp_cache_fragment *) 0xffffffff)
- #define VSWAP_FREEING ((struct comp_cache_fragment *) 0xfffffffe)
#define VSWAP_ALLOCATING ((struct page *) 0xffffffff)
--- 401,404 ----
***************
*** 417,422 ****
#define vswap_address(entry) (SWP_TYPE(entry) == COMP_CACHE_SWP_TYPE)
#define reserved(offset) (vswap_address[offset]->fragment == VSWAP_RESERVED)
- #define freeing(offset) (vswap_address[offset]->fragment == VSWAP_FREEING)
- #define allocating(offset) (vswap_address[offset]->swap_cache_page == VSWAP_ALLOCATING)
int comp_cache_swp_duplicate(swp_entry_t);
--- 408,411 ----
***************
*** 438,441 ****
--- 427,441 ----
int vswap_alloc_and_init(struct vswap_address **, unsigned long);
+ static inline void get_vswap(swp_entry_t entry) {
+ if (!vswap_address(entry))
+ return;
+ vswap_address[SWP_OFFSET(entry)]->fault_count++;
+ }
+
+ static inline void put_vswap(swp_entry_t entry) {
+ if (!vswap_address(entry))
+ return;
+ vswap_address[SWP_OFFSET(entry)]->fault_count--;
+ }
#else
Index: mm.h
===================================================================
RCS file: /cvsroot/linuxcompressed/linux/include/linux/mm.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** mm.h 11 Jun 2002 13:20:49 -0000 1.16
--- mm.h 16 Jul 2002 18:41:55 -0000 1.17
***************
*** 332,339 ****
#ifdef CONFIG_COMP_CACHE
#define PageCompCache(page) test_bit(PG_comp_cache, &(page)->flags)
- #define PageMappedCompCache(page) test_bit(PG_mapped_comp_cache, &(page)->flags)
#else
#define PageCompCache(page) 0
- #define PageMappedCompCache(page) 0
#endif
--- 332,337 ----
***************
*** 342,350 ****
#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 PageSetMappedCompCache(page) set_bit(PG_mapped_comp_cache, &(page)->flags)
- #define PageClearMappedCompCache(page) clear_bit(PG_mapped_comp_cache, &(page)->flags)
- #define PageTestandSetMappedCompCache(page) test_and_set_bit(PG_mapped_comp_cache, &(page)->flags)
- #define PageTestandClearMappedCompCache(page) test_and_clear_bit(PG_mapped_comp_cache, &(page)->flags)
#define PageActive(page) test_bit(PG_active, &(page)->flags)
--- 340,343 ----
|