linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kirill Korotaev <dev@sw.ru>
To: Andrew Morton <akpm@osdl.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Christoph Hellwig <hch@infradead.org>,
	Pavel Emelianov <xemul@openvz.org>, Andrey Savochkin <saw@sw.ru>,
	devel@openvz.org, Rik van Riel <riel@redhat.com>,
	Andi Kleen <ak@suse.de>, Greg KH <greg@kroah.com>,
	Oleg Nesterov <oleg@tv-sign.ru>,
	Matt Helsley <matthltc@us.ibm.com>,
	Rohit Seth <rohitseth@google.com>,
	Chandra Seetharaman <sekharan@us.ibm.com>
Subject: Re: [PATCH] BC: resource beancounters (v2)
Date: Fri, 25 Aug 2006 15:49:15 +0400	[thread overview]
Message-ID: <44EEE3BB.10303@sw.ru> (raw)
In-Reply-To: <20060823100532.459da50a.akpm@osdl.org>

Andrew Morton wrote:
>>As the first step we want to propose for discussion
>>the most complicated parts of resource management:
>>kernel memory and virtual memory.
> 
> 
> The patches look reasonable to me - mergeable after updating them for
> today's batch of review commentlets.
sure. will do updates as long as there are reasonable comments.

> I have two high-level problems though.
> 
> a) I don't yet have a sense of whether this implementation
>    is appropriate/sufficient for the various other
>    applications which people are working on.
> 
>    If the general shape is OK and we think this
>    implementation can be grown into one which everyone can
>    use then fine.
> 
> And...
> 
> 
>>The patch set to be sent provides core for BC and
>>management of kernel memory only. Virtual memory
>>management will be sent in a couple of days.
> 
> 
> We need to go over this work before we can commit to the BC
> core.  Last time I looked at the VM accounting patch it
> seemed rather unpleasing from a maintainability POV.
hmmm... in which regard?

> And, if I understand it correctly, the only response to a job
> going over its VM limits is to kill it, rather than trimming
> it.  Which sounds like a big problem?
No, UBC virtual memory management refuses occur on mmap()'s.
Andrey Savochkin wrote already a brief summary on vm resource management:

------------- cut ----------------
The task of limiting a container to 4.5GB of memory bottles down to the
question: what to do when the container starts to use more than assigned
4.5GB of memory?

At this moment there are only 3 viable alternatives.

A) Have separate memory management for each container,
   with separate buddy allocator, lru lists, page replacement mechanism.
   That implies a considerable overhead, and the main challenge there
   is sharing of pages between these separate memory managers.

B) Return errors on extension of mappings, but not on page faults, where
   memory is actually consumed.
   In this case it makes sense to take into account not only the size of used
   memory, but the size of created mappings as well.
   This is approximately what "privvmpages" accounting/limiting provides in
   UBC.

C) Rely on OOM killer.
   This is a fall-back method in UBC, for the case "privvmpages" limits
   still leave the possibility to overload the system.

It would be nice, indeed, to invent something new.
The ideal mechanism would
 - slow down the container over-using memory, to signal the user that
   he is over his limits,
 - at the same time this slowdown shouldn't lead to the increase of memory
   usage: for example, a simple slowdown of apache web server would lead
   to the growth of the number of serving children and consumption of more
   memory while showing worse performance,
 - and, at the same time, it shouldn't penalize the rest of the system from
   the performance point of view...
May be this can be achieved via carefully tuned swapout mechanism together
with disk bandwidth management capable of tracking asynchronous write
requests, may be something else is required.
It's really a big challenge.

Meanwhile, I guess we can only make small steps in improving Linux resource
management features for this moment.
------------- cut ----------------

Thanks,
Kirill

  parent reply	other threads:[~2006-08-25 11:46 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-23 10:46 [PATCH] BC: resource beancounters (v2) Kirill Korotaev
2006-08-23 11:01 ` [PATCH 1/6] BC: kconfig Kirill Korotaev
2006-08-23 13:04   ` Alexey Dobriyan
2006-08-23 22:04   ` [Devel] " Dave Hansen
2006-08-23 22:13     ` Matt Helsley
2006-08-23 22:32       ` Randy.Dunlap
2006-08-23 22:27         ` Matt Helsley
2006-08-25 11:30       ` Kirill Korotaev
2006-08-25 11:34     ` Kirill Korotaev
2006-08-24  0:23   ` Chandra Seetharaman
2006-08-24 11:47     ` [ckrm-tech] " Kirill Korotaev
2006-08-24 22:23       ` Matt Helsley
2006-08-23 11:03 ` [PATCH 2/6] BC: beancounters core (API) Kirill Korotaev
2006-08-23 11:37   ` Andi Kleen
2006-08-23 13:27     ` Kirill Korotaev
2006-08-23 13:48       ` Andi Kleen
2006-08-23 13:30   ` Alexey Dobriyan
2006-08-23 13:49     ` Kirill Korotaev
2006-08-23 13:53       ` Alexey Dobriyan
2006-08-23 22:05       ` Matt Helsley
2006-08-23 16:42   ` Andrew Morton
2006-08-24 12:06     ` Kirill Korotaev
2006-08-24 15:00       ` Andrew Morton
2006-08-25 10:53         ` Kirill Korotaev
2006-08-24 14:13     ` Oleg Nesterov
2006-08-24 21:33   ` Oleg Nesterov
2006-08-23 11:05 ` [PATCH 3/6] BC: context inheriting and changing Kirill Korotaev
2006-08-23 11:06 ` [PATCH 4/6] BC: user interface (syscalls) Kirill Korotaev
2006-08-23 13:41   ` Alexey Dobriyan
2006-08-23 13:43   ` Kirill Korotaev
2006-08-23 16:50     ` Andrew Morton
2006-08-23 17:29       ` Alan Cox
2006-08-24  4:35         ` Andrew Morton
2006-08-24 11:04           ` Alan Cox
2006-08-24 13:08             ` Alexey Dobriyan
2006-08-25 10:56               ` Kirill Korotaev
2006-08-24  0:30   ` Chandra Seetharaman
2006-08-23 11:06 ` [PATCH 5/6] BC: kernel memory accounting (core) Kirill Korotaev
2006-08-24  0:36   ` Chandra Seetharaman
2006-08-24 21:23   ` Oleg Nesterov
2006-08-25 10:09     ` Kirill Korotaev
2006-08-23 11:08 ` [PATCH 6/6] BC: kernel memory accounting (marks) Kirill Korotaev
2006-08-23 18:30   ` [Devel] " Dave Hansen
2006-08-29  9:52     ` Kirill Korotaev
2006-08-29 15:48       ` Dave Hansen
2006-08-29 15:56         ` Kirill Korotaev
2006-08-23 23:03   ` Dave Hansen
2006-08-24  9:30     ` Geert Uytterhoeven
2006-08-24 15:52       ` Dave Hansen
2006-08-29 14:37     ` Kirill Korotaev
2006-08-23 17:05 ` [PATCH] BC: resource beancounters (v2) Andrew Morton
2006-08-24  0:17   ` Chandra Seetharaman
2006-08-25 11:49   ` Kirill Korotaev [this message]
2006-08-25 14:30     ` Andrew Morton
2006-08-25 14:48       ` Andi Kleen
2006-08-28  8:28         ` Kirill Korotaev
2006-08-25 15:14       ` Nick Piggin
2006-08-25 15:57         ` Alan Cox
2006-08-26  3:55           ` Nick Piggin
2006-08-25 16:30       ` Andrey Savochkin
2006-08-25 17:50         ` Andrew Morton
2006-08-25 19:00         ` Chandra Seetharaman
2006-08-26  2:15         ` Rohit Seth
2006-08-26 16:37           ` Alan Cox
2006-08-28 16:48             ` Rohit Seth
2006-08-28 17:41               ` [Devel] " Kir Kolyshkin
2006-08-28 22:28                 ` Rohit Seth
2006-08-29 10:15                   ` Alan Cox
2006-08-29 17:30                     ` Rohit Seth
2006-08-29 19:06                       ` Alan Cox
2006-08-29 19:15                         ` Rohit Seth
2006-08-29 15:35       ` [PATCH] " Kirill Korotaev
2006-08-29 17:08         ` Balbir Singh
2006-08-23 21:00 ` Cedric Le Goater
2006-08-24  5:52 ` Jan Engelhardt
2006-08-24 10:59   ` Alan Cox

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=44EEE3BB.10303@sw.ru \
    --to=dev@sw.ru \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=devel@openvz.org \
    --cc=greg@kroah.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthltc@us.ibm.com \
    --cc=oleg@tv-sign.ru \
    --cc=riel@redhat.com \
    --cc=rohitseth@google.com \
    --cc=saw@sw.ru \
    --cc=sekharan@us.ibm.com \
    --cc=xemul@openvz.org \
    /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).