From: Vladimir Davydov <vdavydov@parallels.com>
To: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org, cgroups@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Tejun Heo <tj@kernel.org>, Li Zefan <lizefan@huawei.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@suse.cz>, Mel Gorman <mgorman@suse.de>,
Rik van Riel <riel@redhat.com>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Hugh Dickins <hughd@google.com>,
David Rientjes <rientjes@google.com>,
Pavel Emelyanov <xemul@parallels.com>,
Balbir Singh <bsingharora@gmail.com>
Subject: Re: [PATCH RFC 0/5] Virtual Memory Resource Controller for cgroups
Date: Wed, 9 Jul 2014 11:52:52 +0400 [thread overview]
Message-ID: <20140709075252.GB31067@esperanza> (raw)
In-Reply-To: <cover.1404383187.git.vdavydov@parallels.com>
On Thu, Jul 03, 2014 at 04:48:16PM +0400, Vladimir Davydov wrote:
> Hi,
>
> Typically, when a process calls mmap, it isn't given all the memory pages it
> requested immediately. Instead, only its address space is grown, while the
> memory pages will be actually allocated on the first use. If the system fails
> to allocate a page, it will have no choice except invoking the OOM killer,
> which may kill this or any other process. Obviously, it isn't the best way of
> telling the user that the system is unable to handle his request. It would be
> much better to fail mmap with ENOMEM instead.
>
> That's why Linux has the memory overcommit control feature, which accounts and
> limits VM size that may contribute to mem+swap, i.e. private writable mappings
> and shared memory areas. However, currently it's only available system-wide,
> and there's no way of avoiding OOM in cgroups.
>
> This patch set is an attempt to fill the gap. It implements the resource
> controller for cgroups that accounts and limits address space allocations that
> may contribute to mem+swap.
>
> The interface is similar to the one of the memory cgroup except it controls
> virtual memory usage, not actual memory allocation:
>
> vm.usage_in_bytes current vm usage of processes inside cgroup
> (read-only)
>
> vm.max_usage_in_bytes max vm.usage_in_bytes, can be reset by writing 0
>
> vm.limit_in_bytes vm.usage_in_bytes must be <= vm.limite_in_bytes;
> allocations that hit the limit will be failed
> with ENOMEM
>
> vm.failcnt number of times the limit was hit, can be reset
> by writing 0
>
> In future, the controller can be easily extended to account for locked pages
> and shmem.
Any thoughts on this?
Thanks.
--
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: Vladimir Davydov <vdavydov@parallels.com>
To: <linux-kernel@vger.kernel.org>
Cc: <linux-mm@kvack.org>, <cgroups@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Tejun Heo <tj@kernel.org>, Li Zefan <lizefan@huawei.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@suse.cz>, Mel Gorman <mgorman@suse.de>,
Rik van Riel <riel@redhat.com>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Hugh Dickins <hughd@google.com>,
David Rientjes <rientjes@google.com>,
Pavel Emelyanov <xemul@parallels.com>,
Balbir Singh <bsingharora@gmail.com>
Subject: Re: [PATCH RFC 0/5] Virtual Memory Resource Controller for cgroups
Date: Wed, 9 Jul 2014 11:52:52 +0400 [thread overview]
Message-ID: <20140709075252.GB31067@esperanza> (raw)
In-Reply-To: <cover.1404383187.git.vdavydov@parallels.com>
On Thu, Jul 03, 2014 at 04:48:16PM +0400, Vladimir Davydov wrote:
> Hi,
>
> Typically, when a process calls mmap, it isn't given all the memory pages it
> requested immediately. Instead, only its address space is grown, while the
> memory pages will be actually allocated on the first use. If the system fails
> to allocate a page, it will have no choice except invoking the OOM killer,
> which may kill this or any other process. Obviously, it isn't the best way of
> telling the user that the system is unable to handle his request. It would be
> much better to fail mmap with ENOMEM instead.
>
> That's why Linux has the memory overcommit control feature, which accounts and
> limits VM size that may contribute to mem+swap, i.e. private writable mappings
> and shared memory areas. However, currently it's only available system-wide,
> and there's no way of avoiding OOM in cgroups.
>
> This patch set is an attempt to fill the gap. It implements the resource
> controller for cgroups that accounts and limits address space allocations that
> may contribute to mem+swap.
>
> The interface is similar to the one of the memory cgroup except it controls
> virtual memory usage, not actual memory allocation:
>
> vm.usage_in_bytes current vm usage of processes inside cgroup
> (read-only)
>
> vm.max_usage_in_bytes max vm.usage_in_bytes, can be reset by writing 0
>
> vm.limit_in_bytes vm.usage_in_bytes must be <= vm.limite_in_bytes;
> allocations that hit the limit will be failed
> with ENOMEM
>
> vm.failcnt number of times the limit was hit, can be reset
> by writing 0
>
> In future, the controller can be easily extended to account for locked pages
> and shmem.
Any thoughts on this?
Thanks.
next prev parent reply other threads:[~2014-07-09 7:52 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-03 12:48 [PATCH RFC 0/5] Virtual Memory Resource Controller for cgroups Vladimir Davydov
2014-07-03 12:48 ` Vladimir Davydov
2014-07-03 12:48 ` Vladimir Davydov
[not found] ` <cover.1404383187.git.vdavydov-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2014-07-03 12:48 ` [PATCH RFC 1/5] vm_cgroup: basic infrastructure Vladimir Davydov
2014-07-03 12:48 ` Vladimir Davydov
2014-07-03 12:48 ` Vladimir Davydov
2014-07-03 12:48 ` [PATCH RFC 5/5] vm_cgroup: do not charge tasks in root cgroup Vladimir Davydov
2014-07-03 12:48 ` Vladimir Davydov
2014-07-03 12:48 ` Vladimir Davydov
2014-07-03 12:48 ` [PATCH RFC 2/5] vm_cgroup: private writable mappings accounting Vladimir Davydov
2014-07-03 12:48 ` Vladimir Davydov
2014-07-03 12:48 ` [PATCH RFC 3/5] shmem: pass inode to shmem_acct_* methods Vladimir Davydov
2014-07-03 12:48 ` Vladimir Davydov
2014-07-03 12:48 ` [PATCH RFC 4/5] vm_cgroup: shared memory accounting Vladimir Davydov
2014-07-03 12:48 ` Vladimir Davydov
2014-07-04 12:16 ` [PATCH RFC 0/5] Virtual Memory Resource Controller for cgroups Michal Hocko
2014-07-04 12:16 ` Michal Hocko
[not found] ` <20140704121621.GE12466-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2014-07-04 15:38 ` Vladimir Davydov
2014-07-04 15:38 ` Vladimir Davydov
2014-07-04 15:38 ` Vladimir Davydov
2014-07-16 12:01 ` Michal Hocko
2014-07-16 12:01 ` Michal Hocko
2014-07-23 14:08 ` Vladimir Davydov
2014-07-23 14:08 ` Vladimir Davydov
2014-07-09 7:52 ` Vladimir Davydov [this message]
2014-07-09 7:52 ` Vladimir Davydov
2014-07-09 15:08 ` Tim Hockin
2014-07-09 15:08 ` Tim Hockin
2014-07-09 15:08 ` Tim Hockin
2014-07-09 16:36 ` Vladimir Davydov
2014-07-09 16:36 ` Vladimir Davydov
2014-07-09 17:04 ` Greg Thelen
2014-07-09 17:04 ` Greg Thelen
[not found] ` <CAHH2K0Y2OH9scJ8FGkL3M124RSfoUFiELNhGNTHJEsaCEm+hiQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-10 16:35 ` Vladimir Davydov
2014-07-10 16:35 ` Vladimir Davydov
2014-07-10 16:35 ` Vladimir Davydov
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=20140709075252.GB31067@esperanza \
--to=vdavydov@parallels.com \
--cc=akpm@linux-foundation.org \
--cc=bsingharora@gmail.com \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lizefan@huawei.com \
--cc=mgorman@suse.de \
--cc=mhocko@suse.cz \
--cc=riel@redhat.com \
--cc=rientjes@google.com \
--cc=tj@kernel.org \
--cc=xemul@parallels.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.