mm/zpool: add name argument to create zpool
Currently the underlay of zpool: zsmalloc/zbud, do not know who creates them. There is not a method to let zsmalloc/zbud find which caller they belong to. Now we want to add statistics collection in zsmalloc. We need to name the debugfs dir for each pool created. The way suggested by Minchan Kim is to use a name passed by caller(such as zram) to create the zsmalloc pool. /sys/kernel/debug/zsmalloc/zram0 This patch adds an argument `name' to zs_create_pool() and other related functions. Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com> Acked-by: Minchan Kim <minchan@kernel.org> Cc: Seth Jennings <sjennings@variantweb.net> Cc: Nitin Gupta <ngupta@vflare.org> Cc: Dan Streetman <ddstreet@ieee.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

parent
ee98016010
commit
3eba0c6a56
@@ -906,11 +906,12 @@ static int __init init_zswap(void)
|
||||
|
||||
pr_info("loading zswap\n");
|
||||
|
||||
zswap_pool = zpool_create_pool(zswap_zpool_type, gfp, &zswap_zpool_ops);
|
||||
zswap_pool = zpool_create_pool(zswap_zpool_type, "zswap", gfp,
|
||||
&zswap_zpool_ops);
|
||||
if (!zswap_pool && strcmp(zswap_zpool_type, ZSWAP_ZPOOL_DEFAULT)) {
|
||||
pr_info("%s zpool not available\n", zswap_zpool_type);
|
||||
zswap_zpool_type = ZSWAP_ZPOOL_DEFAULT;
|
||||
zswap_pool = zpool_create_pool(zswap_zpool_type, gfp,
|
||||
zswap_pool = zpool_create_pool(zswap_zpool_type, "zswap", gfp,
|
||||
&zswap_zpool_ops);
|
||||
}
|
||||
if (!zswap_pool) {
|
||||
|
Reference in New Issue
Block a user