Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754905Ab3ENR3P (ORCPT ); Tue, 14 May 2013 13:29:15 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:32874 "EHLO e39.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751375Ab3ENR3N (ORCPT ); Tue, 14 May 2013 13:29:13 -0400 Date: Tue, 14 May 2013 12:28:27 -0500 From: Seth Jennings To: Dan Magenheimer Cc: Bob Liu , Mel Gorman , Andrew Morton , Greg Kroah-Hartman , Nitin Gupta , Minchan Kim , Konrad Wilk , Robert Jennings , Jenifer Hopper , Johannes Weiner , Rik van Riel , Larry Woodman , Benjamin Herrenschmidt , Dave Hansen , Joe Perches , Joonsoo Kim , Cody P Schafer , Hugh Dickens , Paul Mackerras , linux-mm@kvack.org, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org Subject: Re: [PATCHv11 3/4] zswap: add to mm/ Message-ID: <20130514172827.GE4024@medulla> References: <1368448803-2089-1-git-send-email-sjenning@linux.vnet.ibm.com> <1368448803-2089-4-git-send-email-sjenning@linux.vnet.ibm.com> <51920197.9070105@oracle.com> <20130514160040.GB4024@medulla> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13051417-3620-0000-0000-00000279BEDF Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3407 Lines: 87 On Tue, May 14, 2013 at 09:37:08AM -0700, Dan Magenheimer wrote: > > From: Seth Jennings [mailto:sjenning@linux.vnet.ibm.com] > > Subject: Re: [PATCHv11 3/4] zswap: add to mm/ > > > > On Tue, May 14, 2013 at 05:19:19PM +0800, Bob Liu wrote: > > > Hi Seth, > > > > Hi Bob, thanks for the review! > > > > > > > > > + /* reclaim space if needed */ > > > > + if (zswap_is_full()) { > > > > + zswap_pool_limit_hit++; > > > > + if (zbud_reclaim_page(tree->pool, 8)) { > > > > > > My idea is to wake up a kernel thread here to do the reclaim. > > > Once zswap is full(20% percent of total mem currently), the kernel > > > thread should reclaim pages from it. Not only reclaim one page, it > > > should depend on the current memory pressure. > > > And then the API in zbud may like this: > > > zbud_reclaim_page(pool, nr_pages_to_reclaim, nr_retry); > > > > So kswapd for zswap. I'm not opposed to the idea if a case can be > > made for the complexity. I must say, I don't see that case though. > > > > The policy can evolve as deficiencies are demonstrated and solutions are > > found. > > Hmmm... it is fairly easy to demonstrate the deficiency if > one tries. I actually first saw it occur on a real (though > early) EL6 system which started some graphics-related service > that caused a very brief swapstorm that was invisible during > normal boot but clogged up RAM with compressed pages which > later caused reduced weird benchmarking performance. Without any specifics, I'm not sure what I can do with this. I'm hearing you say that the source of the benchmark degradation are the idle pages in zswap. In that case, the periodic writeback patches I have in the wings should address this. I think we are on the same page without realizing it. Right now zswap supports a kind of "direct reclaim" model at allocation time. The periodic writeback patches will handle the proactive writeback part to free up the zswap pool when it has idle pages in it. > > I think Mel's unpredictability concern applies equally here... > this may be a "long-term source of bugs and strange memory > management behavior." > > > Can I get your ack on this pending the other changes? > > I'd like to hear Mel's feedback about this, but perhaps > a compromise to allow for zswap merging would be to add > something like the following to zswap's Kconfig comment: > > "Zswap reclaim policy is still primitive. Until it improves, > zswap should be considered experimental and is not recommended > for production use." Just for the record, an "experimental" tag in the Kconfig won't work for me. The reclaim policy for zswap is not primitive, it's simple. There is a difference. Plus zswap is already runtime disabled by default. If distros/customers enabled it, it is because they purposely enabled it. Seth > > If Mel agrees with the unpredictability and also agrees > with the Kconfig compromise, I am willing to ack. > > -- > To unsubscribe, send a message with 'unsubscribe linux-mm' in > the body to majordomo@kvack.org. For more info on Linux MM, > see: http://www.linux-mm.org/ . > Don't email: email@kvack.org > -- 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/