Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752696AbcD1WQu (ORCPT ); Thu, 28 Apr 2016 18:16:50 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48241 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751657AbcD1WQt (ORCPT ); Thu, 28 Apr 2016 18:16:49 -0400 Date: Thu, 28 Apr 2016 15:16:47 -0700 From: Andrew Morton To: Dan Streetman Cc: Sergey Senozhatsky , 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: <20160428151647.8bbf279a7d937a1b017ca003@linux-foundation.org> In-Reply-To: <1461834803-5565-1-git-send-email-ddstreet@ieee.org> References: <1461834803-5565-1-git-send-email-ddstreet@ieee.org> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1279 Lines: 25 On Thu, 28 Apr 2016 05:13:23 -0400 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") September 2015. I added a cc:stable to this one. > Reported-by: Sergey Senozhatsky > Cc: Dan Streetman > Signed-off-by: Dan Streetman