Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752823AbcD2AYQ (ORCPT ); Thu, 28 Apr 2016 20:24:16 -0400 Received: from mail-pf0-f180.google.com ([209.85.192.180]:36298 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752346AbcD2AYP (ORCPT ); Thu, 28 Apr 2016 20:24:15 -0400 Date: Fri, 29 Apr 2016 09:25:47 +0900 From: Sergey Senozhatsky To: Dan Streetman Cc: Sergey Senozhatsky , Andrew Morton , Seth Jennings , Yu Zhao , Minchan Kim , Nitin Gupta , Linux-MM , Sergey Senozhatsky , linux-kernel , Dan Streetman Subject: Re: [PATCH] mm/zswap: provide unique zpool name Message-ID: <20160429002547.GB4920@swordfish> References: <1461834803-5565-1-git-send-email-ddstreet@ieee.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1461834803-5565-1-git-send-email-ddstreet@ieee.org> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1262 Lines: 25 On (04/28/16 05:13), Dan Streetman wrote: > Instead of using "zswap" as the name for all zpools created, add > an atomic counter and use "zswap%x" with the counter number for each > zpool created, to provide a unique name for each new zpool. > > As zsmalloc, one of the zpool implementations, requires/expects a > unique name for each pool created, zswap should provide a unique name. > The zsmalloc pool creation does not fail if a new pool with a > conflicting name is created, unless CONFIG_ZSMALLOC_STAT is enabled; > in that case, zsmalloc pool creation fails with -ENOMEM. Then zswap > will be unable to change its compressor parameter if its zpool is > zsmalloc; it also will be unable to change its zpool parameter back > to zsmalloc, if it has any existing old zpool using zsmalloc with > page(s) in it. Attempts to change the parameters will result in > failure to create the zpool. This changes zswap to provide a > unique name for each zpool creation. > > Fixes: f1c54846ee45 ("zswap: dynamic pool creation") > Reported-by: Sergey Senozhatsky > Cc: Dan Streetman > Signed-off-by: Dan Streetman Reviewed-by: Sergey Senozhatsky -ss