From: Dan Streetman <ddstreet@ieee.org>
To: Minchan Kim <minchan@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Linux-MM <linux-mm@kvack.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Jerome Marchand <jmarchan@redhat.com>,
juno.choi@lge.com, seungho1.park@lge.com,
Luigi Semenzato <semenzato@google.com>,
Nitin Gupta <ngupta@vflare.org>,
Seth Jennings <sjennings@variantweb.net>,
David Horner <ds2horner@gmail.com>
Subject: Re: [PATCH v4 0/4] zram memory control enhance
Date: Fri, 22 Aug 2014 15:15:36 -0400 [thread overview]
Message-ID: <CALZtONChBVQKzROJ9zR=nXYEHSWRcmegh_w9P34FfCz9c47Mnw@mail.gmail.com> (raw)
In-Reply-To: <1408668134-21696-1-git-send-email-minchan@kernel.org>
On Thu, Aug 21, 2014 at 8:42 PM, Minchan Kim <minchan@kernel.org> wrote:
> Currently, zram has no feature to limit memory so theoretically
> zram can deplete system memory.
> Users have asked for a limit several times as even without exhaustion
> zram makes it hard to control memory usage of the platform.
> This patchset adds the feature.
>
> Patch 1 makes zs_get_total_size_bytes faster because it would be
> used frequently in later patches for the new feature.
>
> Patch 2 changes zs_get_total_size_bytes's return unit from bytes
> to page so that zsmalloc doesn't need unnecessary operation(ie,
> << PAGE_SHIFT).
>
> Patch 3 adds new feature. I added the feature into zram layer,
> not zsmalloc because limiation is zram's requirement, not zsmalloc
> so any other user using zsmalloc(ie, zpool) shouldn't affected
> by unnecessary branch of zsmalloc. In future, if every users
> of zsmalloc want the feature, then, we could move the feature
> from client side to zsmalloc easily but vice versa would be
> painful.
>
> Patch 4 adds news facility to report maximum memory usage of zram
> so that this avoids user polling frequently via /sys/block/zram0/
> mem_used_total and ensures transient max are not missed.
FWIW, with the minor update to checking the memparse in patch 3 David
mentioned, feel free to add to all the patches:
Reviewed-by: Dan Streetman <ddstreet@ieee.org>
>
> * From v3
> * get_zs_total_size_byte function name change - Dan
> * clarifiction of the document - Dan
> * atomic account instead of introducing new lock in zsmalloc - David
> * remove unnecessary atomic instruction in updating max - David
>
> * From v2
> * introduce helper funcntion to update max_used_pages
> for readability - David
> * avoid unncessary zs_get_total_size call in updating loop
> for max_used_pages - David
>
> * From v1
> * rebased on next-20140815
> * fix up race problem - David, Dan
> * reset mem_used_max as current total_bytes, rather than 0 - David
> * resetting works with only "0" write for extensiblilty - David, Dan
>
> Minchan Kim (4):
> zsmalloc: move pages_allocated to zs_pool
> zsmalloc: change return value unit of zs_get_total_size_bytes
> zram: zram memory size limitation
> zram: report maximum used memory
>
> Documentation/ABI/testing/sysfs-block-zram | 20 ++++++
> Documentation/blockdev/zram.txt | 25 +++++--
> drivers/block/zram/zram_drv.c | 101 ++++++++++++++++++++++++++++-
> drivers/block/zram/zram_drv.h | 6 ++
> include/linux/zsmalloc.h | 2 +-
> mm/zsmalloc.c | 30 ++++-----
> 6 files changed, 158 insertions(+), 26 deletions(-)
>
> --
> 2.0.0
>
--
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:[~2014-08-22 19:15 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-22 0:42 Minchan Kim
2014-08-22 0:42 ` [PATCH v4 1/4] zsmalloc: move pages_allocated to zs_pool Minchan Kim
2014-08-22 0:42 ` [PATCH v4 2/4] zsmalloc: change return value unit of zs_get_total_size_bytes Minchan Kim
2014-08-22 0:42 ` [PATCH v4 3/4] zram: zram memory size limitation Minchan Kim
2014-08-22 10:55 ` David Horner
2014-08-22 18:47 ` Dan Streetman
2014-08-24 23:56 ` Minchan Kim
2014-08-25 3:40 ` David Horner
2014-08-25 4:37 ` Minchan Kim
2014-08-25 8:22 ` David Horner
2014-08-25 18:12 ` Dan Streetman
2014-08-26 1:54 ` David Horner
2014-08-26 4:39 ` Minchan Kim
2014-08-26 5:36 ` David Horner
2014-08-26 13:31 ` Dan Streetman
2014-08-26 4:28 ` David Horner
2014-08-26 13:40 ` Dan Streetman
2014-08-25 8:25 ` Dongsheng Song
2014-08-26 4:51 ` Minchan Kim
2014-08-22 0:42 ` [PATCH v4 4/4] zram: report maximum used memory Minchan Kim
2014-08-22 19:15 ` Dan Streetman [this message]
2014-08-24 23:58 ` [PATCH v4 0/4] zram memory control enhance Minchan Kim
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='CALZtONChBVQKzROJ9zR=nXYEHSWRcmegh_w9P34FfCz9c47Mnw@mail.gmail.com' \
--to=ddstreet@ieee.org \
--cc=akpm@linux-foundation.org \
--cc=ds2horner@gmail.com \
--cc=jmarchan@redhat.com \
--cc=juno.choi@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=ngupta@vflare.org \
--cc=semenzato@google.com \
--cc=sergey.senozhatsky@gmail.com \
--cc=seungho1.park@lge.com \
--cc=sjennings@variantweb.net \
/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