From: Dan Streetman <ddstreet@ieee.org>
To: srividya.dr@samsung.com
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
Seth Jennings <sjenning@redhat.com>,
"penberg@kernel.org" <penberg@kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Dinakar Reddy Pathireddy <dinakar.p@samsung.com>,
SHARAN ALLUR <sharan.allur@samsung.com>,
SUNEEL KUMAR SURIMANI <suneel@samsung.com>,
JUHUN KIM <juhunkim@samsung.com>,
"srividya.desireddy@gmail.com" <srividya.desireddy@gmail.com>
Subject: Re: [PATCH v2] zswap: Zero-filled pages handling
Date: Thu, 6 Jul 2017 06:02:58 -0400 [thread overview]
Message-ID: <CALZtONDqz0GZUxhBt0QXmup2=5zw+xsSvNrNGOFN4KAZRb9urg@mail.gmail.com> (raw)
In-Reply-To: <20170706092919epcms5p53dae183bd95cd2fa5b050f496f32aa73@epcms5p5>
On Thu, Jul 6, 2017 at 5:29 AM, Srividya Desireddy
<srividya.dr@samsung.com> wrote:
> On Wed, Jul 6, 2017 at 10:49 AM, Sergey Senozhatsky wrote:
>> 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.
>>
>
> Thank you for your suggestion. It is a better solution to handle
> zero-filled pages before swapping-out to zswap. Since, Zram is already
> handles Zero pages internally, I considered to handle within Zswap.
> In a long run, we can work on it to commonly handle zero-filled anon
> pages.
>
>> 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
>
> It is a good solution to extend zero-filled pages handling to same value
> pages. I will work on to identify the percentage of same value pages
> excluding zero-filled pages in Zswap and will get back.
Yes, this sounds like a good modification to the patch. Also, unless
anyone else disagrees, it may be good to control this with a module
param - in case anyone has a use case that they know won't be helped
by this, and the extra overhead of checking each page is wasteful.
Probably should default to enabled.
>
> - Srividya
--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2017-07-06 10:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20170702141959epcms5p32119c772b960e942da3a92e5a79d8c41@epcms5p3>
2017-07-02 14:19 ` [PATCH v2] zswap: Zero-filled pages handling Srividya Desireddy
2017-07-03 1:28 ` Seth Jennings
2017-07-06 5:19 ` Sergey Senozhatsky
[not found] ` <CGME20170702141959epcms5p32119c772b960e942da3a92e5a79d8c41@epcms5p5>
2017-07-06 9:29 ` Srividya Desireddy
2017-07-06 10:02 ` Dan Streetman [this message]
[not found] <CGME20170816172008epcms5p24e951e01951f055559210af10edf2250@epcms5p2>
2017-08-16 17:20 ` Srividya Desireddy
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='CALZtONDqz0GZUxhBt0QXmup2=5zw+xsSvNrNGOFN4KAZRb9urg@mail.gmail.com' \
--to=ddstreet@ieee.org \
--cc=dinakar.p@samsung.com \
--cc=juhunkim@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=penberg@kernel.org \
--cc=sergey.senozhatsky.work@gmail.com \
--cc=sharan.allur@samsung.com \
--cc=sjenning@redhat.com \
--cc=srividya.desireddy@gmail.com \
--cc=srividya.dr@samsung.com \
--cc=suneel@samsung.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;
as well as URLs for NNTP newsgroup(s).