Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * zbud.c
0004  *
0005  * Copyright (C) 2013, Seth Jennings, IBM
0006  *
0007  * Concepts based on zcache internal zbud allocator by Dan Magenheimer.
0008  *
0009  * zbud is an special purpose allocator for storing compressed pages.  Contrary
0010  * to what its name may suggest, zbud is not a buddy allocator, but rather an
0011  * allocator that "buddies" two compressed pages together in a single memory
0012  * page.
0013  *
0014  * While this design limits storage density, it has simple and deterministic
0015  * reclaim properties that make it preferable to a higher density approach when
0016  * reclaim will be used.
0017  *
0018  * zbud works by storing compressed pages, or "zpages", together in pairs in a
0019  * single memory page called a "zbud page".  The first buddy is "left
0020  * justified" at the beginning of the zbud page, and the last buddy is "right
0021  * justified" at the end of the zbud page.  The benefit is that if either
0022  * buddy is freed, the freed buddy space, coalesced with whatever slack space
0023  * that existed between the buddies, results in the largest possible free region
0024  * within the zbud page.
0025  *
0026  * zbud also provides an attractive lower bound on density. The ratio of zpages
0027  * to zbud pages can not be less than 1.  This ensures that zbud can never "do
0028  * harm" by using more pages to store zpages than the uncompressed zpages would
0029  * have used on their own.
0030  *
0031  * zbud pages are divided into "chunks".  The size of the chunks is fixed at
0032  * compile time and determined by NCHUNKS_ORDER below.  Dividing zbud pages
0033  * into chunks allows organizing unbuddied zbud pages into a manageable number
0034  * of unbuddied lists according to the number of free chunks available in the
0035  * zbud page.
0036  *
0037  * The zbud API differs from that of conventional allocators in that the
0038  * allocation function, zbud_alloc(), returns an opaque handle to the user,
0039  * not a dereferenceable pointer.  The user must map the handle using
0040  * zbud_map() in order to get a usable pointer by which to access the
0041  * allocation data and unmap the handle with zbud_unmap() when operations
0042  * on the allocation data are complete.
0043  */
0044 
0045 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
0046 
0047 #include <linux/atomic.h>
0048 #include <linux/list.h>
0049 #include <linux/mm.h>
0050 #include <linux/module.h>
0051 #include <linux/preempt.h>
0052 #include <linux/slab.h>
0053 #include <linux/spinlock.h>
0054 #include <linux/zpool.h>
0055 
0056 /*****************
0057  * Structures
0058 *****************/
0059 /*
0060  * NCHUNKS_ORDER determines the internal allocation granularity, effectively
0061  * adjusting internal fragmentation.  It also determines the number of
0062  * freelists maintained in each pool. NCHUNKS_ORDER of 6 means that the
0063  * allocation granularity will be in chunks of size PAGE_SIZE/64. As one chunk
0064  * in allocated page is occupied by zbud header, NCHUNKS will be calculated to
0065  * 63 which shows the max number of free chunks in zbud page, also there will be
0066  * 63 freelists per pool.
0067  */
0068 #define NCHUNKS_ORDER   6
0069 
0070 #define CHUNK_SHIFT (PAGE_SHIFT - NCHUNKS_ORDER)
0071 #define CHUNK_SIZE  (1 << CHUNK_SHIFT)
0072 #define ZHDR_SIZE_ALIGNED CHUNK_SIZE
0073 #define NCHUNKS     ((PAGE_SIZE - ZHDR_SIZE_ALIGNED) >> CHUNK_SHIFT)
0074 
0075 struct zbud_pool;
0076 
0077 struct zbud_ops {
0078     int (*evict)(struct zbud_pool *pool, unsigned long handle);
0079 };
0080 
0081 /**
0082  * struct zbud_pool - stores metadata for each zbud pool
0083  * @lock:   protects all pool fields and first|last_chunk fields of any
0084  *      zbud page in the pool
0085  * @unbuddied:  array of lists tracking zbud pages that only contain one buddy;
0086  *      the lists each zbud page is added to depends on the size of
0087  *      its free region.
0088  * @buddied:    list tracking the zbud pages that contain two buddies;
0089  *      these zbud pages are full
0090  * @lru:    list tracking the zbud pages in LRU order by most recently
0091  *      added buddy.
0092  * @pages_nr:   number of zbud pages in the pool.
0093  * @ops:    pointer to a structure of user defined operations specified at
0094  *      pool creation time.
0095  * @zpool:  zpool driver
0096  * @zpool_ops:  zpool operations structure with an evict callback
0097  *
0098  * This structure is allocated at pool creation time and maintains metadata
0099  * pertaining to a particular zbud pool.
0100  */
0101 struct zbud_pool {
0102     spinlock_t lock;
0103     union {
0104         /*
0105          * Reuse unbuddied[0] as buddied on the ground that
0106          * unbuddied[0] is unused.
0107          */
0108         struct list_head buddied;
0109         struct list_head unbuddied[NCHUNKS];
0110     };
0111     struct list_head lru;
0112     u64 pages_nr;
0113     const struct zbud_ops *ops;
0114     struct zpool *zpool;
0115     const struct zpool_ops *zpool_ops;
0116 };
0117 
0118 /*
0119  * struct zbud_header - zbud page metadata occupying the first chunk of each
0120  *          zbud page.
0121  * @buddy:  links the zbud page into the unbuddied/buddied lists in the pool
0122  * @lru:    links the zbud page into the lru list in the pool
0123  * @first_chunks:   the size of the first buddy in chunks, 0 if free
0124  * @last_chunks:    the size of the last buddy in chunks, 0 if free
0125  */
0126 struct zbud_header {
0127     struct list_head buddy;
0128     struct list_head lru;
0129     unsigned int first_chunks;
0130     unsigned int last_chunks;
0131     bool under_reclaim;
0132 };
0133 
0134 /*****************
0135  * Helpers
0136 *****************/
0137 /* Just to make the code easier to read */
0138 enum buddy {
0139     FIRST,
0140     LAST
0141 };
0142 
0143 /* Converts an allocation size in bytes to size in zbud chunks */
0144 static int size_to_chunks(size_t size)
0145 {
0146     return (size + CHUNK_SIZE - 1) >> CHUNK_SHIFT;
0147 }
0148 
0149 #define for_each_unbuddied_list(_iter, _begin) \
0150     for ((_iter) = (_begin); (_iter) < NCHUNKS; (_iter)++)
0151 
0152 /* Initializes the zbud header of a newly allocated zbud page */
0153 static struct zbud_header *init_zbud_page(struct page *page)
0154 {
0155     struct zbud_header *zhdr = page_address(page);
0156     zhdr->first_chunks = 0;
0157     zhdr->last_chunks = 0;
0158     INIT_LIST_HEAD(&zhdr->buddy);
0159     INIT_LIST_HEAD(&zhdr->lru);
0160     zhdr->under_reclaim = false;
0161     return zhdr;
0162 }
0163 
0164 /* Resets the struct page fields and frees the page */
0165 static void free_zbud_page(struct zbud_header *zhdr)
0166 {
0167     __free_page(virt_to_page(zhdr));
0168 }
0169 
0170 /*
0171  * Encodes the handle of a particular buddy within a zbud page
0172  * Pool lock should be held as this function accesses first|last_chunks
0173  */
0174 static unsigned long encode_handle(struct zbud_header *zhdr, enum buddy bud)
0175 {
0176     unsigned long handle;
0177 
0178     /*
0179      * For now, the encoded handle is actually just the pointer to the data
0180      * but this might not always be the case.  A little information hiding.
0181      * Add CHUNK_SIZE to the handle if it is the first allocation to jump
0182      * over the zbud header in the first chunk.
0183      */
0184     handle = (unsigned long)zhdr;
0185     if (bud == FIRST)
0186         /* skip over zbud header */
0187         handle += ZHDR_SIZE_ALIGNED;
0188     else /* bud == LAST */
0189         handle += PAGE_SIZE - (zhdr->last_chunks  << CHUNK_SHIFT);
0190     return handle;
0191 }
0192 
0193 /* Returns the zbud page where a given handle is stored */
0194 static struct zbud_header *handle_to_zbud_header(unsigned long handle)
0195 {
0196     return (struct zbud_header *)(handle & PAGE_MASK);
0197 }
0198 
0199 /* Returns the number of free chunks in a zbud page */
0200 static int num_free_chunks(struct zbud_header *zhdr)
0201 {
0202     /*
0203      * Rather than branch for different situations, just use the fact that
0204      * free buddies have a length of zero to simplify everything.
0205      */
0206     return NCHUNKS - zhdr->first_chunks - zhdr->last_chunks;
0207 }
0208 
0209 /*****************
0210  * API Functions
0211 *****************/
0212 /**
0213  * zbud_create_pool() - create a new zbud pool
0214  * @gfp:    gfp flags when allocating the zbud pool structure
0215  * @ops:    user-defined operations for the zbud pool
0216  *
0217  * Return: pointer to the new zbud pool or NULL if the metadata allocation
0218  * failed.
0219  */
0220 static struct zbud_pool *zbud_create_pool(gfp_t gfp, const struct zbud_ops *ops)
0221 {
0222     struct zbud_pool *pool;
0223     int i;
0224 
0225     pool = kzalloc(sizeof(struct zbud_pool), gfp);
0226     if (!pool)
0227         return NULL;
0228     spin_lock_init(&pool->lock);
0229     for_each_unbuddied_list(i, 0)
0230         INIT_LIST_HEAD(&pool->unbuddied[i]);
0231     INIT_LIST_HEAD(&pool->buddied);
0232     INIT_LIST_HEAD(&pool->lru);
0233     pool->pages_nr = 0;
0234     pool->ops = ops;
0235     return pool;
0236 }
0237 
0238 /**
0239  * zbud_destroy_pool() - destroys an existing zbud pool
0240  * @pool:   the zbud pool to be destroyed
0241  *
0242  * The pool should be emptied before this function is called.
0243  */
0244 static void zbud_destroy_pool(struct zbud_pool *pool)
0245 {
0246     kfree(pool);
0247 }
0248 
0249 /**
0250  * zbud_alloc() - allocates a region of a given size
0251  * @pool:   zbud pool from which to allocate
0252  * @size:   size in bytes of the desired allocation
0253  * @gfp:    gfp flags used if the pool needs to grow
0254  * @handle: handle of the new allocation
0255  *
0256  * This function will attempt to find a free region in the pool large enough to
0257  * satisfy the allocation request.  A search of the unbuddied lists is
0258  * performed first. If no suitable free region is found, then a new page is
0259  * allocated and added to the pool to satisfy the request.
0260  *
0261  * gfp should not set __GFP_HIGHMEM as highmem pages cannot be used
0262  * as zbud pool pages.
0263  *
0264  * Return: 0 if success and handle is set, otherwise -EINVAL if the size or
0265  * gfp arguments are invalid or -ENOMEM if the pool was unable to allocate
0266  * a new page.
0267  */
0268 static int zbud_alloc(struct zbud_pool *pool, size_t size, gfp_t gfp,
0269             unsigned long *handle)
0270 {
0271     int chunks, i, freechunks;
0272     struct zbud_header *zhdr = NULL;
0273     enum buddy bud;
0274     struct page *page;
0275 
0276     if (!size || (gfp & __GFP_HIGHMEM))
0277         return -EINVAL;
0278     if (size > PAGE_SIZE - ZHDR_SIZE_ALIGNED - CHUNK_SIZE)
0279         return -ENOSPC;
0280     chunks = size_to_chunks(size);
0281     spin_lock(&pool->lock);
0282 
0283     /* First, try to find an unbuddied zbud page. */
0284     for_each_unbuddied_list(i, chunks) {
0285         if (!list_empty(&pool->unbuddied[i])) {
0286             zhdr = list_first_entry(&pool->unbuddied[i],
0287                     struct zbud_header, buddy);
0288             list_del(&zhdr->buddy);
0289             if (zhdr->first_chunks == 0)
0290                 bud = FIRST;
0291             else
0292                 bud = LAST;
0293             goto found;
0294         }
0295     }
0296 
0297     /* Couldn't find unbuddied zbud page, create new one */
0298     spin_unlock(&pool->lock);
0299     page = alloc_page(gfp);
0300     if (!page)
0301         return -ENOMEM;
0302     spin_lock(&pool->lock);
0303     pool->pages_nr++;
0304     zhdr = init_zbud_page(page);
0305     bud = FIRST;
0306 
0307 found:
0308     if (bud == FIRST)
0309         zhdr->first_chunks = chunks;
0310     else
0311         zhdr->last_chunks = chunks;
0312 
0313     if (zhdr->first_chunks == 0 || zhdr->last_chunks == 0) {
0314         /* Add to unbuddied list */
0315         freechunks = num_free_chunks(zhdr);
0316         list_add(&zhdr->buddy, &pool->unbuddied[freechunks]);
0317     } else {
0318         /* Add to buddied list */
0319         list_add(&zhdr->buddy, &pool->buddied);
0320     }
0321 
0322     /* Add/move zbud page to beginning of LRU */
0323     if (!list_empty(&zhdr->lru))
0324         list_del(&zhdr->lru);
0325     list_add(&zhdr->lru, &pool->lru);
0326 
0327     *handle = encode_handle(zhdr, bud);
0328     spin_unlock(&pool->lock);
0329 
0330     return 0;
0331 }
0332 
0333 /**
0334  * zbud_free() - frees the allocation associated with the given handle
0335  * @pool:   pool in which the allocation resided
0336  * @handle: handle associated with the allocation returned by zbud_alloc()
0337  *
0338  * In the case that the zbud page in which the allocation resides is under
0339  * reclaim, as indicated by the PG_reclaim flag being set, this function
0340  * only sets the first|last_chunks to 0.  The page is actually freed
0341  * once both buddies are evicted (see zbud_reclaim_page() below).
0342  */
0343 static void zbud_free(struct zbud_pool *pool, unsigned long handle)
0344 {
0345     struct zbud_header *zhdr;
0346     int freechunks;
0347 
0348     spin_lock(&pool->lock);
0349     zhdr = handle_to_zbud_header(handle);
0350 
0351     /* If first buddy, handle will be page aligned */
0352     if ((handle - ZHDR_SIZE_ALIGNED) & ~PAGE_MASK)
0353         zhdr->last_chunks = 0;
0354     else
0355         zhdr->first_chunks = 0;
0356 
0357     if (zhdr->under_reclaim) {
0358         /* zbud page is under reclaim, reclaim will free */
0359         spin_unlock(&pool->lock);
0360         return;
0361     }
0362 
0363     /* Remove from existing buddy list */
0364     list_del(&zhdr->buddy);
0365 
0366     if (zhdr->first_chunks == 0 && zhdr->last_chunks == 0) {
0367         /* zbud page is empty, free */
0368         list_del(&zhdr->lru);
0369         free_zbud_page(zhdr);
0370         pool->pages_nr--;
0371     } else {
0372         /* Add to unbuddied list */
0373         freechunks = num_free_chunks(zhdr);
0374         list_add(&zhdr->buddy, &pool->unbuddied[freechunks]);
0375     }
0376 
0377     spin_unlock(&pool->lock);
0378 }
0379 
0380 /**
0381  * zbud_reclaim_page() - evicts allocations from a pool page and frees it
0382  * @pool:   pool from which a page will attempt to be evicted
0383  * @retries:    number of pages on the LRU list for which eviction will
0384  *      be attempted before failing
0385  *
0386  * zbud reclaim is different from normal system reclaim in that the reclaim is
0387  * done from the bottom, up.  This is because only the bottom layer, zbud, has
0388  * information on how the allocations are organized within each zbud page. This
0389  * has the potential to create interesting locking situations between zbud and
0390  * the user, however.
0391  *
0392  * To avoid these, this is how zbud_reclaim_page() should be called:
0393  *
0394  * The user detects a page should be reclaimed and calls zbud_reclaim_page().
0395  * zbud_reclaim_page() will remove a zbud page from the pool LRU list and call
0396  * the user-defined eviction handler with the pool and handle as arguments.
0397  *
0398  * If the handle can not be evicted, the eviction handler should return
0399  * non-zero. zbud_reclaim_page() will add the zbud page back to the
0400  * appropriate list and try the next zbud page on the LRU up to
0401  * a user defined number of retries.
0402  *
0403  * If the handle is successfully evicted, the eviction handler should
0404  * return 0 _and_ should have called zbud_free() on the handle. zbud_free()
0405  * contains logic to delay freeing the page if the page is under reclaim,
0406  * as indicated by the setting of the PG_reclaim flag on the underlying page.
0407  *
0408  * If all buddies in the zbud page are successfully evicted, then the
0409  * zbud page can be freed.
0410  *
0411  * Returns: 0 if page is successfully freed, otherwise -EINVAL if there are
0412  * no pages to evict or an eviction handler is not registered, -EAGAIN if
0413  * the retry limit was hit.
0414  */
0415 static int zbud_reclaim_page(struct zbud_pool *pool, unsigned int retries)
0416 {
0417     int i, ret, freechunks;
0418     struct zbud_header *zhdr;
0419     unsigned long first_handle = 0, last_handle = 0;
0420 
0421     spin_lock(&pool->lock);
0422     if (!pool->ops || !pool->ops->evict || list_empty(&pool->lru) ||
0423             retries == 0) {
0424         spin_unlock(&pool->lock);
0425         return -EINVAL;
0426     }
0427     for (i = 0; i < retries; i++) {
0428         zhdr = list_last_entry(&pool->lru, struct zbud_header, lru);
0429         list_del(&zhdr->lru);
0430         list_del(&zhdr->buddy);
0431         /* Protect zbud page against free */
0432         zhdr->under_reclaim = true;
0433         /*
0434          * We need encode the handles before unlocking, since we can
0435          * race with free that will set (first|last)_chunks to 0
0436          */
0437         first_handle = 0;
0438         last_handle = 0;
0439         if (zhdr->first_chunks)
0440             first_handle = encode_handle(zhdr, FIRST);
0441         if (zhdr->last_chunks)
0442             last_handle = encode_handle(zhdr, LAST);
0443         spin_unlock(&pool->lock);
0444 
0445         /* Issue the eviction callback(s) */
0446         if (first_handle) {
0447             ret = pool->ops->evict(pool, first_handle);
0448             if (ret)
0449                 goto next;
0450         }
0451         if (last_handle) {
0452             ret = pool->ops->evict(pool, last_handle);
0453             if (ret)
0454                 goto next;
0455         }
0456 next:
0457         spin_lock(&pool->lock);
0458         zhdr->under_reclaim = false;
0459         if (zhdr->first_chunks == 0 && zhdr->last_chunks == 0) {
0460             /*
0461              * Both buddies are now free, free the zbud page and
0462              * return success.
0463              */
0464             free_zbud_page(zhdr);
0465             pool->pages_nr--;
0466             spin_unlock(&pool->lock);
0467             return 0;
0468         } else if (zhdr->first_chunks == 0 ||
0469                 zhdr->last_chunks == 0) {
0470             /* add to unbuddied list */
0471             freechunks = num_free_chunks(zhdr);
0472             list_add(&zhdr->buddy, &pool->unbuddied[freechunks]);
0473         } else {
0474             /* add to buddied list */
0475             list_add(&zhdr->buddy, &pool->buddied);
0476         }
0477 
0478         /* add to beginning of LRU */
0479         list_add(&zhdr->lru, &pool->lru);
0480     }
0481     spin_unlock(&pool->lock);
0482     return -EAGAIN;
0483 }
0484 
0485 /**
0486  * zbud_map() - maps the allocation associated with the given handle
0487  * @pool:   pool in which the allocation resides
0488  * @handle: handle associated with the allocation to be mapped
0489  *
0490  * While trivial for zbud, the mapping functions for others allocators
0491  * implementing this allocation API could have more complex information encoded
0492  * in the handle and could create temporary mappings to make the data
0493  * accessible to the user.
0494  *
0495  * Returns: a pointer to the mapped allocation
0496  */
0497 static void *zbud_map(struct zbud_pool *pool, unsigned long handle)
0498 {
0499     return (void *)(handle);
0500 }
0501 
0502 /**
0503  * zbud_unmap() - maps the allocation associated with the given handle
0504  * @pool:   pool in which the allocation resides
0505  * @handle: handle associated with the allocation to be unmapped
0506  */
0507 static void zbud_unmap(struct zbud_pool *pool, unsigned long handle)
0508 {
0509 }
0510 
0511 /**
0512  * zbud_get_pool_size() - gets the zbud pool size in pages
0513  * @pool:   pool whose size is being queried
0514  *
0515  * Returns: size in pages of the given pool.  The pool lock need not be
0516  * taken to access pages_nr.
0517  */
0518 static u64 zbud_get_pool_size(struct zbud_pool *pool)
0519 {
0520     return pool->pages_nr;
0521 }
0522 
0523 /*****************
0524  * zpool
0525  ****************/
0526 
0527 static int zbud_zpool_evict(struct zbud_pool *pool, unsigned long handle)
0528 {
0529     if (pool->zpool && pool->zpool_ops && pool->zpool_ops->evict)
0530         return pool->zpool_ops->evict(pool->zpool, handle);
0531     else
0532         return -ENOENT;
0533 }
0534 
0535 static const struct zbud_ops zbud_zpool_ops = {
0536     .evict =    zbud_zpool_evict
0537 };
0538 
0539 static void *zbud_zpool_create(const char *name, gfp_t gfp,
0540                    const struct zpool_ops *zpool_ops,
0541                    struct zpool *zpool)
0542 {
0543     struct zbud_pool *pool;
0544 
0545     pool = zbud_create_pool(gfp, zpool_ops ? &zbud_zpool_ops : NULL);
0546     if (pool) {
0547         pool->zpool = zpool;
0548         pool->zpool_ops = zpool_ops;
0549     }
0550     return pool;
0551 }
0552 
0553 static void zbud_zpool_destroy(void *pool)
0554 {
0555     zbud_destroy_pool(pool);
0556 }
0557 
0558 static int zbud_zpool_malloc(void *pool, size_t size, gfp_t gfp,
0559             unsigned long *handle)
0560 {
0561     return zbud_alloc(pool, size, gfp, handle);
0562 }
0563 static void zbud_zpool_free(void *pool, unsigned long handle)
0564 {
0565     zbud_free(pool, handle);
0566 }
0567 
0568 static int zbud_zpool_shrink(void *pool, unsigned int pages,
0569             unsigned int *reclaimed)
0570 {
0571     unsigned int total = 0;
0572     int ret = -EINVAL;
0573 
0574     while (total < pages) {
0575         ret = zbud_reclaim_page(pool, 8);
0576         if (ret < 0)
0577             break;
0578         total++;
0579     }
0580 
0581     if (reclaimed)
0582         *reclaimed = total;
0583 
0584     return ret;
0585 }
0586 
0587 static void *zbud_zpool_map(void *pool, unsigned long handle,
0588             enum zpool_mapmode mm)
0589 {
0590     return zbud_map(pool, handle);
0591 }
0592 static void zbud_zpool_unmap(void *pool, unsigned long handle)
0593 {
0594     zbud_unmap(pool, handle);
0595 }
0596 
0597 static u64 zbud_zpool_total_size(void *pool)
0598 {
0599     return zbud_get_pool_size(pool) * PAGE_SIZE;
0600 }
0601 
0602 static struct zpool_driver zbud_zpool_driver = {
0603     .type =     "zbud",
0604     .sleep_mapped = true,
0605     .owner =    THIS_MODULE,
0606     .create =   zbud_zpool_create,
0607     .destroy =  zbud_zpool_destroy,
0608     .malloc =   zbud_zpool_malloc,
0609     .free =     zbud_zpool_free,
0610     .shrink =   zbud_zpool_shrink,
0611     .map =      zbud_zpool_map,
0612     .unmap =    zbud_zpool_unmap,
0613     .total_size =   zbud_zpool_total_size,
0614 };
0615 
0616 MODULE_ALIAS("zpool-zbud");
0617 
0618 static int __init init_zbud(void)
0619 {
0620     /* Make sure the zbud header will fit in one chunk */
0621     BUILD_BUG_ON(sizeof(struct zbud_header) > ZHDR_SIZE_ALIGNED);
0622     pr_info("loaded\n");
0623 
0624     zpool_register_driver(&zbud_zpool_driver);
0625 
0626     return 0;
0627 }
0628 
0629 static void __exit exit_zbud(void)
0630 {
0631     zpool_unregister_driver(&zbud_zpool_driver);
0632     pr_info("unloaded\n");
0633 }
0634 
0635 module_init(init_zbud);
0636 module_exit(exit_zbud);
0637 
0638 MODULE_LICENSE("GPL");
0639 MODULE_AUTHOR("Seth Jennings <sjennings@variantweb.net>");
0640 MODULE_DESCRIPTION("Buddy Allocator for Compressed Pages");