Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754114AbbHEUOK (ORCPT ); Wed, 5 Aug 2015 16:14:10 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37204 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753890AbbHEUOI (ORCPT ); Wed, 5 Aug 2015 16:14:08 -0400 Date: Wed, 5 Aug 2015 13:14:06 -0700 From: Andrew Morton To: Dan Streetman Cc: Seth Jennings , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] zswap: change zpool/compressor at runtime Message-Id: <20150805131406.8bd8a1a6d2a6691aa6eedd34@linux-foundation.org> In-Reply-To: <1438782403-29496-4-git-send-email-ddstreet@ieee.org> References: <1438782403-29496-1-git-send-email-ddstreet@ieee.org> <1438782403-29496-4-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: 1188 Lines: 32 On Wed, 5 Aug 2015 09:46:43 -0400 Dan Streetman wrote: > Update the zpool and compressor parameters to be changeable at runtime. > When changed, a new pool is created with the requested zpool/compressor, > and added as the current pool at the front of the pool list. Previous > pools remain in the list only to remove existing compressed pages from. > The old pool(s) are removed once they become empty. > > +/********************************* > +* param callbacks > +**********************************/ > + > +static int __zswap_param_set(const char *val, const struct kernel_param *kp, > + char *type, char *compressor) > +{ > + struct zswap_pool *pool, *put_pool = NULL; > + char str[kp->str->maxlen], *s; What's the upper bound on the size of this variable-sized array? > + int ret; > + > + strlcpy(str, val, kp->str->maxlen); > + s = strim(str); > + > + /* if this is load-time (pre-init) param setting, -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/