From: Vitaly Wool <vitalywool@gmail.com>
To: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
Dan Streetman <ddstreet@ieee.org>,
Andrew Morton <akpm@linux-foundation.org>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
LKML <linux-kernel@vger.kernel.org>,
linux-mm@kvack.org
Subject: Re: [PATCH 0/2] prepare zbud to be used by zram as underlying allocator
Date: Mon, 21 Sep 2015 23:11:00 +0200 [thread overview]
Message-ID: <CAMJBoFN0KocBQLSMJkxYS2JS+jSPR3Y5gGdceoKTYJWbm06t1g@mail.gmail.com> (raw)
In-Reply-To: <20150921041837.GF27729@bbox>
Hello Minchan,
> Sorry, because you wrote up "zram" in the title.
> As I said earlier, we need several numbers to investigate.
>
> First of all, what is culprit of your latency?
> It seems you are thinking about compaction. so compaction what?
> Frequent scanning? lock collision? or frequent sleeping in compaction
> code somewhere? And then why does zbud solve it? If we use zbud for zram,
> we lose memory efficiency so there is something to justify it.
The data I've got so far strongly suggests that in some use cases (see
below) with zsmalloc
* there are more allocstalls
* memory compaction is triggered more frequently
* allocstalls happen more often
* page migrations are way more frequent, too.
Please also keep in mind that I do not advise you or anyone to use
zbud instead of zsmalloc. The point I'm trying to make is that zbud
fits my particular case better and I want to be able to choose it in
the kernel without hacking it with my private patches.
FWIW, given that I am not an author of either, I don't see why anyone
would consider me biased. :-)
As of the memory efficiency, you seem to be quite comfortable with
storing uncompressed pages when they compress to more than 3/4 of a
page. I observed ~13% reported ratio increase (3.8x to 4.3x) when I
increased max_zpage_size to PAGE_SIZE / 32 * 31. Doesn't look like a
fight for every byte to me.
> The reason I am asking is I have investigated similar problems
> in android and other plaforms and the reason of latency was not zsmalloc
> but agressive high-order allocations from subsystems, watermark check
> race, deferring of compaction, LMK not working and too much swapout so
> it causes to reclaim lots of page cache pages which was main culprit
> in my cases. When I checks with perf, compaction stall count is increased,
> the time spent in there is not huge so it was not main factor of latency.
The main use case where the difference is seen is switching between
users on an Android device. It does cause a lot of reclaim, too, as
you say, but this is in the nature of zbud that reclaim happens in a
more deterministic way and worst-case looks substantially nicer. That
said, the standard deviation calculated over 20 iterations of a
change-user-multiple-times-test is 2x less for zbud than the one of
zsmalloc.
I'll post some numbers in the next patch respin so they won't get lost :)
~vitaly
--
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:[~2015-09-21 21:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-16 11:48 [PATCH 0/2] prepare zbud to be used by zram as underlying allocator Vitaly Wool
2015-09-16 11:50 ` [PATCH 1/2] zbud: allow PAGE_SIZE allocations Vitaly Wool
2015-09-17 13:00 ` Vlastimil Babka
2015-09-18 8:03 ` Vitaly Wool
2015-09-21 15:27 ` Dan Streetman
2015-09-21 16:17 ` Dan Streetman
2015-09-22 10:18 ` Vitaly Wool
2015-09-22 17:09 ` Dan Streetman
2015-09-16 11:53 ` [PATCH 2/2] zpool/zsmalloc/zbud: align on interfaces Vitaly Wool
2015-09-21 17:15 ` Dan Streetman
2015-09-17 1:30 ` [PATCH 0/2] prepare zbud to be used by zram as underlying allocator Sergey Senozhatsky
2015-09-17 10:26 ` Vitaly Wool
2015-09-21 4:18 ` Minchan Kim
2015-09-21 21:11 ` Vitaly Wool [this message]
2015-09-22 15:36 ` Minchan Kim
2015-09-22 16:49 ` Austin S Hemmelgarn
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=CAMJBoFN0KocBQLSMJkxYS2JS+jSPR3Y5gGdceoKTYJWbm06t1g@mail.gmail.com \
--to=vitalywool@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=ddstreet@ieee.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@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;
as well as URLs for NNTP newsgroup(s).