From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Joonsoo Kim <js1304@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH v2 3/3] mm/zsmalloc: increase ZS_MAX_PAGES_PER_ZSPAGE
Date: Sat, 27 Feb 2016 15:31:53 +0900 [thread overview]
Message-ID: <20160227063153.GB396@swordfish> (raw)
In-Reply-To: <20160223160515.GA13851@bbox>
Hello Minchan,
sorry for very long reply.
On (02/24/16 01:05), Minchan Kim wrote:
[..]
> > And the thing is -- quite huge internal class fragmentation. These are the 'normal'
> > classes, not affected by ORDER modification in any way:
> >
> > class size almost_full almost_empty obj_allocated obj_used pages_used pages_per_zspage compact
> > 107 1744 1 23 196 76 84 3 51
> > 111 1808 0 0 63 63 28 4 0
> > 126 2048 0 160 568 408 284 1 80
> > 144 2336 52 620 8631 5747 4932 4 1648
> > 151 2448 123 406 10090 8736 6054 3 810
> > 168 2720 0 512 15738 14926 10492 2 540
> > 190 3072 0 2 136 130 102 3 3
> >
> >
> > so I've been thinking about using some sort of watermaks (well, zsmalloc is an allocator
> > after all, allocators love watermarks :-)). we can't defeat this fragmentation, we never
> > know in advance which of the pages will be modified or we the size class those pages will
> > land after compression. but we know stats for every class -- zs_can_compact(),
> > obj_allocated/obj_used, etc. so we can start class compaction if we detect that internal
> > fragmentation is too high (e.g. 30+% of class pages can be compacted).
>
> AFAIRC, we discussed about that when I introduced compaction.
> Namely, per-class compaction.
> I love it and just wanted to do after soft landing of compaction.
> So, it's good time to introduce it. ;-)
ah, yeah, indeed. I vaguely recall this. my first 'auto-compaction' submission
has had this "compact every class in zs_free()", which was a subject to 10+%
performance penalty on some of the tests. but with watermarks this will be less
dramatic, I think.
> >
> > on the other hand, we always can wait for the shrinker to come in and do the job for us,
> > but that can take some time.
>
> Sure, with the feature, we can remove shrinker itself, I think.
> >
> > what's your opinion on this?
>
> I will be very happy.
good, I'll take a look later, to avoid any conflicts with your re-work.
[..]
> > does it look to you good enough to be committed on its own (off the series)?
>
> I think it's good to have. Firstly, I thought we can get the information
> by existing stats with simple math on userspace but changed my mind
> because we could change the implementation sometime so such simple math
> might not be perfect in future and even, we can expose it easily so yes,
> let's do it.
thanks! submitted.
-ss
--
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>
WARNING: multiple messages have this Message-ID (diff)
From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Joonsoo Kim <js1304@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH v2 3/3] mm/zsmalloc: increase ZS_MAX_PAGES_PER_ZSPAGE
Date: Sat, 27 Feb 2016 15:31:53 +0900 [thread overview]
Message-ID: <20160227063153.GB396@swordfish> (raw)
In-Reply-To: <20160223160515.GA13851@bbox>
Hello Minchan,
sorry for very long reply.
On (02/24/16 01:05), Minchan Kim wrote:
[..]
> > And the thing is -- quite huge internal class fragmentation. These are the 'normal'
> > classes, not affected by ORDER modification in any way:
> >
> > class size almost_full almost_empty obj_allocated obj_used pages_used pages_per_zspage compact
> > 107 1744 1 23 196 76 84 3 51
> > 111 1808 0 0 63 63 28 4 0
> > 126 2048 0 160 568 408 284 1 80
> > 144 2336 52 620 8631 5747 4932 4 1648
> > 151 2448 123 406 10090 8736 6054 3 810
> > 168 2720 0 512 15738 14926 10492 2 540
> > 190 3072 0 2 136 130 102 3 3
> >
> >
> > so I've been thinking about using some sort of watermaks (well, zsmalloc is an allocator
> > after all, allocators love watermarks :-)). we can't defeat this fragmentation, we never
> > know in advance which of the pages will be modified or we the size class those pages will
> > land after compression. but we know stats for every class -- zs_can_compact(),
> > obj_allocated/obj_used, etc. so we can start class compaction if we detect that internal
> > fragmentation is too high (e.g. 30+% of class pages can be compacted).
>
> AFAIRC, we discussed about that when I introduced compaction.
> Namely, per-class compaction.
> I love it and just wanted to do after soft landing of compaction.
> So, it's good time to introduce it. ;-)
ah, yeah, indeed. I vaguely recall this. my first 'auto-compaction' submission
has had this "compact every class in zs_free()", which was a subject to 10+%
performance penalty on some of the tests. but with watermarks this will be less
dramatic, I think.
> >
> > on the other hand, we always can wait for the shrinker to come in and do the job for us,
> > but that can take some time.
>
> Sure, with the feature, we can remove shrinker itself, I think.
> >
> > what's your opinion on this?
>
> I will be very happy.
good, I'll take a look later, to avoid any conflicts with your re-work.
[..]
> > does it look to you good enough to be committed on its own (off the series)?
>
> I think it's good to have. Firstly, I thought we can get the information
> by existing stats with simple math on userspace but changed my mind
> because we could change the implementation sometime so such simple math
> might not be perfect in future and even, we can expose it easily so yes,
> let's do it.
thanks! submitted.
-ss
next prev parent reply other threads:[~2016-02-27 6:33 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-21 13:27 [RFC][PATCH v2 0/3] mm/zsmalloc: increase objects density and reduce memory wastage Sergey Senozhatsky
2016-02-21 13:27 ` Sergey Senozhatsky
2016-02-21 13:27 ` [RFC][PATCH v2 1/3] mm/zsmalloc: introduce zs_get_huge_class_size_watermark() Sergey Senozhatsky
2016-02-21 13:27 ` Sergey Senozhatsky
2016-02-21 13:27 ` [RFC][PATCH v2 2/3] zram: use zs_get_huge_class_size_watermark() Sergey Senozhatsky
2016-02-21 13:27 ` Sergey Senozhatsky
2016-02-22 0:04 ` Minchan Kim
2016-02-22 0:04 ` Minchan Kim
2016-02-22 0:40 ` Sergey Senozhatsky
2016-02-22 0:40 ` Sergey Senozhatsky
2016-02-22 1:27 ` Minchan Kim
2016-02-22 1:27 ` Minchan Kim
2016-02-22 1:59 ` Sergey Senozhatsky
2016-02-22 1:59 ` Sergey Senozhatsky
2016-02-22 2:05 ` Sergey Senozhatsky
2016-02-22 2:05 ` Sergey Senozhatsky
2016-02-22 2:57 ` Minchan Kim
2016-02-22 2:57 ` Minchan Kim
2016-02-22 3:54 ` Sergey Senozhatsky
2016-02-22 3:54 ` Sergey Senozhatsky
2016-02-22 4:54 ` Minchan Kim
2016-02-22 4:54 ` Minchan Kim
2016-02-22 5:05 ` Sergey Senozhatsky
2016-02-22 5:05 ` Sergey Senozhatsky
2016-02-21 13:27 ` [RFC][PATCH v2 3/3] mm/zsmalloc: increase ZS_MAX_PAGES_PER_ZSPAGE Sergey Senozhatsky
2016-02-21 13:27 ` Sergey Senozhatsky
2016-02-22 0:25 ` Minchan Kim
2016-02-22 0:25 ` Minchan Kim
2016-02-22 0:47 ` Sergey Senozhatsky
2016-02-22 0:47 ` Sergey Senozhatsky
2016-02-22 1:34 ` Minchan Kim
2016-02-22 1:34 ` Minchan Kim
2016-02-22 2:01 ` Sergey Senozhatsky
2016-02-22 2:01 ` Sergey Senozhatsky
2016-02-22 2:34 ` Minchan Kim
2016-02-22 2:34 ` Minchan Kim
2016-02-22 3:59 ` Sergey Senozhatsky
2016-02-22 3:59 ` Sergey Senozhatsky
2016-02-22 4:41 ` Minchan Kim
2016-02-22 4:41 ` Minchan Kim
2016-02-22 10:43 ` Sergey Senozhatsky
2016-02-22 10:43 ` Sergey Senozhatsky
2016-02-23 8:25 ` Minchan Kim
2016-02-23 8:25 ` Minchan Kim
2016-02-23 10:35 ` Sergey Senozhatsky
2016-02-23 10:35 ` Sergey Senozhatsky
2016-02-23 16:05 ` Minchan Kim
2016-02-23 16:05 ` Minchan Kim
2016-02-27 6:31 ` Sergey Senozhatsky [this message]
2016-02-27 6:31 ` Sergey Senozhatsky
2016-02-22 2:24 ` Sergey Senozhatsky
2016-02-22 2:24 ` 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=20160227063153.GB396@swordfish \
--to=sergey.senozhatsky@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=js1304@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=sergey.senozhatsky.work@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 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.