From: Johannes Weiner <hannes@cmpxchg.org>
To: Yu Zhao <yuzhao@google.com>
Cc: linux-mm@kvack.org, cgroups@vger.kernel.org, x86@kernel.org,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
jamieliu@google.com, suleiman@google.com
Subject: Re: [PATCH v2 0/3] Per-cgroup swap file support
Date: Wed, 2 Apr 2014 16:54:33 -0400 [thread overview]
Message-ID: <20140402205433.GW14688@cmpxchg.org> (raw)
In-Reply-To: <1396470849-26154-1-git-send-email-yuzhao@google.com>
On Wed, Apr 02, 2014 at 01:34:06PM -0700, Yu Zhao wrote:
> This series of patches adds support to configure a cgroup to swap to a
> particular file by using control file memory.swapfile.
>
> Originally, cgroups share system-wide swap space and limiting cgroup swapping
> is not possible. This patchset solves the problem by adding mechanism that
> isolates cgroup swap spaces (i.e. per-cgroup swap file) so users can safely
> enable swap for particular cgroups without worrying about one cgroup uses up
> all swap space.
Isn't that what the swap controller is for?
config MEMCG_SWAP
bool "Memory Resource Controller Swap Extension"
depends on MEMCG && SWAP
help
Add swap management feature to memory resource controller. When you
enable this, you can limit mem+swap usage per cgroup. In other words,
when you disable this, memory resource controller has no cares to
usage of swap...a process can exhaust all of the swap. This extension
is useful when you want to avoid exhaustion swap but this itself
adds more overheads and consumes memory for remembering information.
Especially if you use 32bit system or small memory system, please
be careful about enabling this. When memory resource controller
is disabled by boot option, this will be automatically disabled and
there will be no overhead from this. Even when you set this config=y,
if boot option "swapaccount=0" is set, swap will not be accounted.
Now, memory usage of swap_cgroup is 2 bytes per entry. If swap page
size is 4096bytes, 512k per 1Gbytes of swap.
next prev parent reply other threads:[~2014-04-02 20:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-02 20:34 Yu Zhao
2014-04-02 20:34 ` [PATCH v2 1/3] mm/swap: support per memory cgroup swapfiles Yu Zhao
2014-04-02 20:34 ` [PATCH v2 2/3] swap: do not store private swap files on swap_list Yu Zhao
2014-04-02 20:34 ` [PATCH v2 3/3] swap: Increase the max swap files to 8192 on x86_64 Yu Zhao
2014-04-02 20:54 ` Johannes Weiner [this message]
2014-04-02 21:29 ` [PATCH v2 0/3] Per-cgroup swap file support Yu Zhao
2014-04-04 17:10 ` Johannes Weiner
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=20140402205433.GW14688@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=cgroups@vger.kernel.org \
--cc=jamieliu@google.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=suleiman@google.com \
--cc=x86@kernel.org \
--cc=yuzhao@google.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
Powered by JetHome