From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756777AbbE2PJR (ORCPT ); Fri, 29 May 2015 11:09:17 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:34564 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756533AbbE2PGl (ORCPT ); Fri, 29 May 2015 11:06:41 -0400 From: Sergey Senozhatsky To: Andrew Morton , Minchan Kim Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Sergey Senozhatsky , Sergey Senozhatsky Subject: [RFC][PATCH 08/10] zsmalloc: export zs_pool `num_migrated' Date: Sat, 30 May 2015 00:05:26 +0900 Message-Id: <1432911928-14654-9-git-send-email-sergey.senozhatsky@gmail.com> X-Mailer: git-send-email 2.4.2.337.gfae46aa In-Reply-To: <1432911928-14654-1-git-send-email-sergey.senozhatsky@gmail.com> References: <1432911928-14654-1-git-send-email-sergey.senozhatsky@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org introduce zs_get_num_migrated() to export zs_pool's ->num_migrated counter. Signed-off-by: Sergey Senozhatsky --- include/linux/zsmalloc.h | 1 + mm/zsmalloc.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/include/linux/zsmalloc.h b/include/linux/zsmalloc.h index 1338190..e878875 100644 --- a/include/linux/zsmalloc.h +++ b/include/linux/zsmalloc.h @@ -47,6 +47,7 @@ void *zs_map_object(struct zs_pool *pool, unsigned long handle, void zs_unmap_object(struct zs_pool *pool, unsigned long handle); unsigned long zs_get_total_pages(struct zs_pool *pool); +unsigned long zs_get_num_migrated(struct zs_pool *pool); unsigned long zs_compact(struct zs_pool *pool); #endif diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 70bf481..0524c4a 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -1543,6 +1543,13 @@ unsigned long zs_get_total_pages(struct zs_pool *pool) } EXPORT_SYMBOL_GPL(zs_get_total_pages); +unsigned long zs_get_num_migrated(struct zs_pool *pool) +{ + /* can be outdated */ + return pool->num_migrated; +} +EXPORT_SYMBOL_GPL(zs_get_num_migrated); + /** * zs_map_object - get address of allocated object from handle. * @pool: pool from which the object was allocated -- 2.4.2.337.gfae46aa