linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@kernel.org>
To: srividya.dr@samsung.com
Cc: sjenning@redhat.com, "linux-mm@kvack.org" <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Dinakar Reddy Pathireddy" <dinakar.p@samsung.com>,
	샤란 <sharan.allur@samsung.com>,
	"SUNEEL KUMAR SURIMANI" <suneel@samsung.com>,
	김주훈 <juhunkim@samsung.com>
Subject: Re: [PATCH 3/4] zswap: Zero-filled pages handling
Date: Wed, 17 Aug 2016 15:25:26 +0300	[thread overview]
Message-ID: <CAOJsxLF2iomkK0xS7VQJmxeS-PR2nURmQq4QQHqWa1S82JQ_og@mail.gmail.com> (raw)
In-Reply-To: <570065255.35200.1471429099337.JavaMail.weblogic@epwas3e2>

On Wed, Aug 17, 2016 at 1:18 PM, Srividya Desireddy
<srividya.dr@samsung.com> wrote:
> This patch adds a check in zswap_frontswap_store() to identify zero-filled
> page before compression of the page. If the page is a zero-filled page, set
> zswap_entry.zeroflag and skip the compression of the page and alloction
> of memory in zpool. In zswap_frontswap_load(), check if the zeroflag is
> set for the page in zswap_entry. If the flag is set, memset the page with
> zero. This saves the decompression time during load.
>
> The overall overhead caused due to zero-filled page check is very minimal
> when compared to the time saved by avoiding compression and allocation in
> case of zero-filled pages. The load time of a zero-filled page is reduced
> by 80% when compared to baseline.

AFAICT, that's an overall improvement only if there are a lot of
zero-filled pages because it's just overhead for pages that we *need*
to compress, no? So I suppose the question is, are there a lot of
zero-filled pages that we need to swap and why is that the case?

> @@ -1314,6 +1347,13 @@ static int zswap_frontswap_load(unsigned type, pgoff_t offset,
>         }
>         spin_unlock(&tree->lock);
>
> +       if (entry->zeroflag) {
> +               dst = kmap_atomic(page);
> +               memset(dst, 0, PAGE_SIZE);
> +               kunmap_atomic(dst);
> +               goto freeentry;
> +       }

Don't we need the same thing in zswap_writeback_entry() for the
ZSWAP_SWAPCACHE_NEW case?

> +
>         /* decompress */
>         dlen = PAGE_SIZE;
>         src = (u8 *)zpool_map_handle(entry->pool->zpool, entry->zhandle->handle,
> @@ -1327,6 +1367,7 @@ static int zswap_frontswap_load(unsigned type, pgoff_t offset,
>         zpool_unmap_handle(entry->pool->zpool, entry->zhandle->handle);
>         BUG_ON(ret);

- Pekka

--
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>

  reply	other threads:[~2016-08-17 12:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20160817101819epcms5p25ad7d8a53c761ffff62993ca4d4bf129@epcms5p2>
2016-08-17 10:18 ` Srividya Desireddy
2016-08-17 12:25   ` Pekka Enberg [this message]
2016-08-17 12:32     ` Pekka Enberg
2017-02-17 20:06   ` Dan Streetman
2016-08-19 13:30 ` Srividya Desireddy
     [not found] <CGME20160817101819epcms5p25ad7d8a53c761ffff62993ca4d4bf129@epcms5p1>
2016-08-19  5:51 ` 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=CAOJsxLF2iomkK0xS7VQJmxeS-PR2nURmQq4QQHqWa1S82JQ_og@mail.gmail.com \
    --to=penberg@kernel.org \
    --cc=dinakar.p@samsung.com \
    --cc=juhunkim@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sharan.allur@samsung.com \
    --cc=sjenning@redhat.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