From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1955806AbdDZF5V (ORCPT ); Wed, 26 Apr 2017 01:57:21 -0400 Received: from mail-pf0-f179.google.com ([209.85.192.179]:33790 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1954335AbdDZF5M (ORCPT ); Wed, 26 Apr 2017 01:57:12 -0400 Date: Wed, 26 Apr 2017 14:57:03 +0900 From: Joonsoo Kim To: Sergey Senozhatsky Cc: Andrew Morton , Minchan Kim , Sergey Senozhatsky , linux-kernel@vger.kernel.org, kernel-team@lge.com Subject: Re: [PATCH v4 2/4] zram: implement deduplication in zram Message-ID: <20170426055700.GA29773@js1304-desktop> References: <1493167946-10936-1-git-send-email-iamjoonsoo.kim@lge.com> <1493167946-10936-3-git-send-email-iamjoonsoo.kim@lge.com> <20170426021452.GA673@jagdpanzerIV.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170426021452.GA673@jagdpanzerIV.localdomain> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 26, 2017 at 11:14:52AM +0900, Sergey Senozhatsky wrote: > Hello, > > On (04/26/17 09:52), js1304@gmail.com wrote: > [..] > > ret = scnprintf(buf, PAGE_SIZE, > > - "%8llu %8llu %8llu %8lu %8ld %8llu %8lu\n", > > + "%8llu %8llu %8llu %8lu %8ld %8llu %8lu %8llu %8llu\n", > > orig_size << PAGE_SHIFT, > > (u64)atomic64_read(&zram->stats.compr_data_size), > > mem_used << PAGE_SHIFT, > > zram->limit_pages << PAGE_SHIFT, > > max_used << PAGE_SHIFT, > > (u64)atomic64_read(&zram->stats.same_pages), > > - pool_stats.pages_compacted); > > + pool_stats.pages_compacted, > > + zram_dedup_dup_size(zram), > > + zram_dedup_meta_size(zram)); > > hm... should't we subtract zram_dedup_dup_size(zram) from > ->stats.compr_data_size? we don't use extra memory for dedupped > pages. or don't inc ->stats.compr_data_size for dedupped pages? Hmm... My intention is to keep previous stat as much as possible. User can just notice the saving by only checking mem_used. However, it's also odd that compr_data_size doesn't show actual compressed data size. Minchan, what do you think about it? Thanks.