lkml.org 
[lkml]   [2011]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 4/7] zram/xvmalloc: free bit block insertion optimization
There is no need to set the bits in the first- and second-level indices
to indicate a free page when we know that a free page existed at this
level.

Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com>
---
drivers/staging/zram/xvmalloc.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/zram/xvmalloc.c b/drivers/staging/zram/xvmalloc.c
index a507f95..b3622f1 100644
--- a/drivers/staging/zram/xvmalloc.c
+++ b/drivers/staging/zram/xvmalloc.c
@@ -205,6 +205,8 @@ static void insert_block(struct xv_pool *pool, struct page *page, u32 offset,
nextblock->link.prev_page = page;
nextblock->link.prev_offset = offset;
put_ptr_atomic(nextblock, KM_USER1);
+ /* If there was a next page then the free bits are set. */
+ return;
}

__set_bit(slindex % BITS_PER_LONG, &pool->slbitmap[flindex]);
--
1.6.0.2


\
 
 \ /
  Last update: 2011-01-26 18:27    [W:0.127 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site