All of lore.kernel.org
 help / color / mirror / Atom feed
From: Timofey Titovets <nefelim4ag@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Srividya Desireddy <srividya.dr@samsung.com>,
	"sjenning@redhat.com" <sjenning@redhat.com>,
	"ddstreet@ieee.org" <ddstreet@ieee.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"penberg@kernel.org" <penberg@kernel.org>,
	Dinakar Reddy Pathireddy <dinakar.p@samsung.com>,
	SHARAN ALLUR <sharan.allur@samsung.com>,
	RAJIB BASU <rajib.basu@samsung.com>,
	JUHUN KIM <juhunkim@samsung.com>,
	"srividya.desireddy@gmail.com" <srividya.desireddy@gmail.com>
Subject: Re: [PATCH] zswap: Same-filled pages handling
Date: Wed, 18 Oct 2017 16:33:43 +0300	[thread overview]
Message-ID: <CAGqmi77nDU+z2PhNFJq3i208mxMbdTdk2=uPwfj42y0G3yyiWw@mail.gmail.com> (raw)
In-Reply-To: <20171018123427.GA7271@bombadil.infradead.org>

2017-10-18 15:34 GMT+03:00 Matthew Wilcox <willy@infradead.org>:
> On Wed, Oct 18, 2017 at 10:48:32AM +0000, Srividya Desireddy wrote:
>> +static void zswap_fill_page(void *ptr, unsigned long value)
>> +{
>> +     unsigned int pos;
>> +     unsigned long *page;
>> +
>> +     page = (unsigned long *)ptr;
>> +     if (value == 0)
>> +             memset(page, 0, PAGE_SIZE);
>> +     else {
>> +             for (pos = 0; pos < PAGE_SIZE / sizeof(*page); pos++)
>> +                     page[pos] = value;
>> +     }
>> +}
>
> I think you meant:
>
> static void zswap_fill_page(void *ptr, unsigned long value)
> {
>         memset_l(ptr, value, PAGE_SIZE / sizeof(unsigned long));
> }
>
> (and you should see significantly better numbers at least on x86;
> I don't know if anyone's done an arm64 version of memset_l yet).
>
> --
> 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>

IIRC kernel have special zero page, and if i understand correctly.
You can map all zero pages to that zero page and not touch zswap completely.
(Your situation look like some KSM case (i.e. KSM can handle pages
with same content), but i'm not sure if that applicable there)

Thanks.
-- 
Have a nice day,
Timofey.

WARNING: multiple messages have this Message-ID (diff)
From: Timofey Titovets <nefelim4ag@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Srividya Desireddy <srividya.dr@samsung.com>,
	"sjenning@redhat.com" <sjenning@redhat.com>,
	"ddstreet@ieee.org" <ddstreet@ieee.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"penberg@kernel.org" <penberg@kernel.org>,
	Dinakar Reddy Pathireddy <dinakar.p@samsung.com>,
	SHARAN ALLUR <sharan.allur@samsung.com>,
	RAJIB BASU <rajib.basu@samsung.com>,
	JUHUN KIM <juhunkim@samsung.com>,
	"srividya.desireddy@gmail.com" <srividya.desireddy@gmail.com>
Subject: Re: [PATCH] zswap: Same-filled pages handling
Date: Wed, 18 Oct 2017 16:33:43 +0300	[thread overview]
Message-ID: <CAGqmi77nDU+z2PhNFJq3i208mxMbdTdk2=uPwfj42y0G3yyiWw@mail.gmail.com> (raw)
In-Reply-To: <20171018123427.GA7271@bombadil.infradead.org>

2017-10-18 15:34 GMT+03:00 Matthew Wilcox <willy@infradead.org>:
> On Wed, Oct 18, 2017 at 10:48:32AM +0000, Srividya Desireddy wrote:
>> +static void zswap_fill_page(void *ptr, unsigned long value)
>> +{
>> +     unsigned int pos;
>> +     unsigned long *page;
>> +
>> +     page = (unsigned long *)ptr;
>> +     if (value == 0)
>> +             memset(page, 0, PAGE_SIZE);
>> +     else {
>> +             for (pos = 0; pos < PAGE_SIZE / sizeof(*page); pos++)
>> +                     page[pos] = value;
>> +     }
>> +}
>
> I think you meant:
>
> static void zswap_fill_page(void *ptr, unsigned long value)
> {
>         memset_l(ptr, value, PAGE_SIZE / sizeof(unsigned long));
> }
>
> (and you should see significantly better numbers at least on x86;
> I don't know if anyone's done an arm64 version of memset_l yet).
>
> --
> 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>

IIRC kernel have special zero page, and if i understand correctly.
You can map all zero pages to that zero page and not touch zswap completely.
(Your situation look like some KSM case (i.e. KSM can handle pages
with same content), but i'm not sure if that applicable there)

Thanks.
-- 
Have a nice day,
Timofey.

--
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:[~2017-10-18 13:34 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20171018104832epcms5p1b2232e2236258de3d03d1344dde9fce0@epcms5p1>
2017-10-18 10:48 ` [PATCH] zswap: Same-filled pages handling Srividya Desireddy
2017-10-18 10:48   ` Srividya Desireddy
2017-10-18 12:34   ` Matthew Wilcox
2017-10-18 12:34     ` Matthew Wilcox
2017-10-18 13:33     ` Timofey Titovets [this message]
2017-10-18 13:33       ` Timofey Titovets
2017-10-18 14:11       ` Matthew Wilcox
2017-10-18 14:11         ` Matthew Wilcox
2017-10-18 20:43   ` Andi Kleen
2017-10-18 20:43     ` Andi Kleen
2017-10-19  1:10     ` Matthew Wilcox
2017-10-19  1:10       ` Matthew Wilcox
2017-10-19  4:30       ` Andi Kleen
2017-10-19  4:30         ` Andi Kleen
2017-10-19 13:24         ` Matthew Wilcox
2017-10-19 13:24           ` Matthew Wilcox
2017-10-18 21:31   ` Timofey Titovets
2017-10-18 21:31     ` Timofey Titovets
2017-10-19  1:08     ` Matthew Wilcox
2017-10-19  1:08       ` Matthew Wilcox
     [not found]     ` <CGME20171018104832epcms5p1b2232e2236258de3d03d1344dde9fce0@epcms5p3>
2017-11-02 15:08       ` Srividya Desireddy
2017-11-02 15:08         ` Srividya Desireddy
2017-11-17 22:10         ` Dan Streetman
2017-11-17 22:10           ` Dan Streetman
2017-11-17 22:07     ` Dan Streetman
2017-11-17 22:07       ` Dan Streetman
2017-11-17 21:27   ` Dan Streetman
2017-11-17 21:27     ` Dan Streetman
2017-11-20 23:46   ` Andrew Morton
2017-11-20 23:46     ` Andrew Morton
2017-11-28 11:35     ` Dan Streetman
2017-11-28 11:35       ` Dan Streetman
     [not found]     ` <CGME20171018104832epcms5p1b2232e2236258de3d03d1344dde9fce0@epcms5p6>
2017-11-29 15:34       ` [PATCH] zswap: Update with same-value filled page feature Srividya Desireddy
2017-11-29 15:34         ` Srividya Desireddy
2017-11-29 21:29         ` Dan Streetman
2017-11-29 21:29           ` Dan Streetman
2017-12-06 11:48       ` [PATCH v2] " Srividya Desireddy
2017-12-06 11:48         ` Srividya Desireddy
2017-12-06 15:20         ` Dan Streetman
2017-12-06 15:20           ` Dan Streetman
     [not found]   ` <CGME20171018104832epcms5p1b2232e2236258de3d03d1344dde9fce0@epcms5p4>
2017-11-21 14:18     ` [PATCH v2] zswap: Same-filled pages handling Srividya Desireddy
2017-11-21 14:18       ` Srividya Desireddy
2017-10-18 14:43 ` [PATCH] " Srividya Desireddy
2017-10-18 14:43   ` 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='CAGqmi77nDU+z2PhNFJq3i208mxMbdTdk2=uPwfj42y0G3yyiWw@mail.gmail.com' \
    --to=nefelim4ag@gmail.com \
    --cc=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=rajib.basu@samsung.com \
    --cc=sharan.allur@samsung.com \
    --cc=sjenning@redhat.com \
    --cc=srividya.desireddy@gmail.com \
    --cc=srividya.dr@samsung.com \
    --cc=willy@infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.