Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752802AbdGFFTx (ORCPT ); Thu, 6 Jul 2017 01:19:53 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:34762 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750970AbdGFFTv (ORCPT ); Thu, 6 Jul 2017 01:19:51 -0400 Date: Thu, 6 Jul 2017 14:19:59 +0900 From: Sergey Senozhatsky To: Seth Jennings Cc: srividya.dr@samsung.com, "ddstreet@ieee.org" , "penberg@kernel.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Dinakar Reddy Pathireddy , SHARAN ALLUR , SUNEEL KUMAR SURIMANI , JUHUN KIM , "srividya.desireddy@gmail.com" Subject: Re: [PATCH v2] zswap: Zero-filled pages handling Message-ID: <20170706051959.GD7195@jagdpanzerIV.localdomain> References: <20170702141959epcms5p32119c772b960e942da3a92e5a79d8c41@epcms5p3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1109 Lines: 25 On (07/02/17 20:28), Seth Jennings wrote: > On Sun, Jul 2, 2017 at 9:19 AM, Srividya Desireddy > > Zswap is a cache which compresses the pages that are being swapped out > > and stores them into a dynamically allocated RAM-based memory pool. > > Experiments have shown that around 10-20% of pages stored in zswap > > are zero-filled pages (i.e. contents of the page are all zeros), but > > these pages are handled as normal pages by compressing and allocating > > memory in the pool. > > I am somewhat surprised that this many anon pages are zero filled. > > If this is true, then maybe we should consider solving this at the > swap level in general, as we can de-dup zero pages in all swap > devices, not just zswap. > > That being said, this is a fair small change and I don't see anything > objectionable. However, I do think the better solution would be to do > this at a higher level. zero-filled pages are just 1 case. in general, it's better to handle pages that are memset-ed with the same value (e.g. memset(page, 0x01, page_size)). which includes, but not limited to, 0x00. zram does it. -ss