The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Minchan Kim <minchan@kernel.org>
To: Joonsoo Kim <js1304@gmail.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	linux-kernel@vger.kernel.org, kernel-team@lge.com
Subject: Re: [PATCH v4 2/4] zram: implement deduplication in zram
Date: Wed, 26 Apr 2017 15:29:38 +0900	[thread overview]
Message-ID: <20170426062938.GA19907@bbox> (raw)
In-Reply-To: <20170426055700.GA29773@js1304-desktop>

Hi Sergey and Joonsoo,

On Wed, Apr 26, 2017 at 02:57:03PM +0900, Joonsoo Kim wrote:
> 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.

Actually, I found it for the last review cycle but didn't say that
intentionally. Because it is also odd to me that pages_stored isn't
increased for same_pages so I thought we can fix it all.

I mean:

* normal page
        inc pages_stored
        inc compr_data_size
* same_page
        inc pages_stored
        inc same_pages
* dedup_page
        inc pages_stored
        inc dup_data_size
         
IOW, pages_stored should be increased for every write IO.
But the concern is we have said in zram.txt

 orig_data_size   uncompressed size of data stored in this disk.
                  This excludes same-element-filled pages (same_pages) since
                  no memory is allocated for them.

So, we might be too late. :-(
What do you think about it?
If anyone doesn't have any objection, I want to correct it all.

Thanks.

  reply	other threads:[~2017-04-26  6:29 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-26  0:52 [PATCH v4 0/4] zram: implement deduplication in zram js1304
2017-04-26  0:52 ` [PATCH v4 1/4] zram: introduce zram_entry to prepare dedup functionality js1304
2017-04-26  0:52 ` [PATCH v4 2/4] zram: implement deduplication in zram js1304
2017-04-26  2:14   ` Sergey Senozhatsky
2017-04-26  5:57     ` Joonsoo Kim
2017-04-26  6:29       ` Minchan Kim [this message]
2017-04-26  6:59         ` Joonsoo Kim
2017-04-26  7:21           ` Sergey Senozhatsky
2017-04-26  7:39             ` Minchan Kim
2017-04-26  7:12         ` Sergey Senozhatsky
2017-04-26  2:37   ` Sergey Senozhatsky
2017-04-26  5:59     ` Joonsoo Kim
2017-04-26  6:04       ` Sergey Senozhatsky
2017-04-26  4:02   ` Sergey Senozhatsky
2017-04-26  6:04     ` Joonsoo Kim
2017-04-26  6:21       ` Sergey Senozhatsky
2017-04-27  6:57         ` Joonsoo Kim
2017-04-27  7:46           ` Sergey Senozhatsky
2017-05-02  5:31             ` Joonsoo Kim
2017-04-26  4:28   ` Sergey Senozhatsky
2017-04-26  6:08     ` Joonsoo Kim
2017-04-26  6:14       ` Sergey Senozhatsky
2017-04-26  0:52 ` [PATCH v4 3/4] zram: make deduplication feature optional js1304
2017-04-26  0:52 ` [PATCH v4 4/4] zram: compare all the entries with same checksum for deduplication js1304
2017-04-27  7:49 ` [PATCH v4 0/4] zram: implement deduplication in zram Sergey Senozhatsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170426062938.GA19907@bbox \
    --to=minchan@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=js1304@gmail.com \
    --cc=kernel-team@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=sergey.senozhatsky@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox