From: Vitaly Wool <vitalywool@gmail.com>
To: ddstreet@ieee.org, akpm@linux-foundation.org,
Seth Jennings <sjennings@variantweb.net>,
Minchan Kim <minchan@kernel.org>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
Linux-MM <linux-mm@kvack.org>
Subject: [PATCHv2 3/3] zsmalloc: add compaction callbacks
Date: Sat, 26 Sep 2015 10:09:43 +0200 [thread overview]
Message-ID: <20150926100943.60420d355d818aa64be0dd9d@gmail.com> (raw)
In-Reply-To: <20150926100401.96a36c7cd3c913b063887466@gmail.com>
Add compaction callbacks for zpool compaction API extension.
Signed-off-by: Vitaly Wool <vitalywool@gmail.com>
---
mm/zsmalloc.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index f135b1b..8f2ddd1 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -365,6 +365,19 @@ static void zs_zpool_unmap(void *pool, unsigned long handle)
zs_unmap_object(pool, handle);
}
+static unsigned long zs_zpool_compact(void *pool)
+{
+ return zs_compact(pool);
+}
+
+static unsigned long zs_zpool_get_compacted(void *pool)
+{
+ struct zs_pool_stats stats;
+
+ zs_pool_stats(pool, &stats);
+ return stats.pages_compacted;
+}
+
static u64 zs_zpool_total_size(void *pool)
{
return zs_get_total_pages(pool) << PAGE_SHIFT;
@@ -380,6 +393,8 @@ static struct zpool_driver zs_zpool_driver = {
.shrink = zs_zpool_shrink,
.map = zs_zpool_map,
.unmap = zs_zpool_unmap,
+ .compact = zs_zpool_compact,
+ .get_num_compacted = zs_zpool_get_compacted,
.total_size = zs_zpool_total_size,
};
--
1.9.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2015-09-26 8:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-26 8:04 [PATCHv2 0/3] align zpool/zbud/zsmalloc on the api Vitaly Wool
2015-09-26 8:05 ` [PATCHv2 1/3] zpool: add compaction api Vitaly Wool
2015-09-26 8:07 ` [PATCHv2 2/3] zbud: add compaction callbacks Vitaly Wool
2015-09-26 8:09 ` Vitaly Wool [this message]
2015-09-30 8:03 ` [PATCHv2 0/3] align zpool/zbud/zsmalloc on the api Minchan Kim
2015-10-09 12:36 ` Dan Streetman
2015-10-14 1:27 ` Sergey Senozhatsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150926100943.60420d355d818aa64be0dd9d@gmail.com \
--to=vitalywool@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=ddstreet@ieee.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=sergey.senozhatsky@gmail.com \
--cc=sjennings@variantweb.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).