Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753745AbdC1BBq (ORCPT ); Mon, 27 Mar 2017 21:01:46 -0400 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:59745 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753686AbdC1BBp (ORCPT ); Mon, 27 Mar 2017 21:01:45 -0400 X-Original-SENDERIP: 156.147.1.126 X-Original-MAILFROM: iamjoonsoo.kim@lge.com X-Original-SENDERIP: 165.244.249.23 X-Original-MAILFROM: iamjoonsoo.kim@lge.com X-Original-SENDERIP: 10.177.222.138 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Date: Tue, 28 Mar 2017 10:02:17 +0900 From: Joonsoo Kim To: Sergey Senozhatsky CC: Minchan Kim , Andrew Morton , Sergey Senozhatsky , , Subject: Re: [PATCH 4/4] zram: make deduplication feature optional Message-ID: <20170328010217.GB8462@js1304-P5Q-DELUXE> References: <1489632398-31501-1-git-send-email-iamjoonsoo.kim@lge.com> <1489632398-31501-5-git-send-email-iamjoonsoo.kim@lge.com> <20170322000059.GB30149@bbox> <20170323030530.GC17486@js1304-P5Q-DELUXE> <20170327081105.GA390@jagdpanzerIV.localdomain> MIME-Version: 1.0 In-Reply-To: <20170327081105.GA390@jagdpanzerIV.localdomain> User-Agent: Mutt/1.5.21 (2010-09-15) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB02/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/03/28 10:00:02, Serialize by Router on LGEKRMHUB02/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/03/28 10:00:02, Serialize complete at 2017/03/28 10:00:02 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1835 Lines: 41 On Mon, Mar 27, 2017 at 05:11:05PM +0900, Sergey Senozhatsky wrote: > On (03/23/17 12:05), Joonsoo Kim wrote: > > On Wed, Mar 22, 2017 at 09:00:59AM +0900, Minchan Kim wrote: > > > On Thu, Mar 16, 2017 at 11:46:38AM +0900, js1304@gmail.com wrote: > > > > From: Joonsoo Kim > > > > > > > > Benefit of deduplication is dependent on the workload so it's not > > > > preferable to always enable. Therefore, make it optional. > > > > > > Please make it to Kconfig, too. And write down the description to impress > > > "help a lot for users who uses zram to build output directory" > > > And the feature should be disabled as default. > > > > Okay. > > so I was thinking for a moment -- do we want to keep this > functionality in zram or may be it belongs to allocator (zsmalloc)? > what do you think? just a question. I think that zram is more appropriate layer to implement this feature. I may be wrong so please let me know if I'm missing something. First, I'd like to leave allocator to just allocator. If it awares the contents, further improvement would be restricted. For example, we should use map/unmap semantic to store contents, since, without them, we can't know when the content is changed and when deduplication check should be done. I know that zsmalloc is already implemented by that way but I guess that similar issue could happen in the future. Second, we always need to compress the page to check duplication if it is implemented in zsmalloc since we store compressed page to zsmalloc. I guess that less compression would be better in performance wise. Third, in case of zsmalloc dedup, we always need to allocate zs memory before checking duplication and need to free it if duplication is found. It's also undesirable. If you are okay with above arguments, I will send v2 soon. Thanks.