All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH] UBC: user resource beancounters
@ 2006-08-16 15:24 Kirill Korotaev
  2006-08-16 15:35 ` [RFC][PATCH 1/7] UBC: kconfig Kirill Korotaev
                   ` (10 more replies)
  0 siblings, 11 replies; 209+ messages in thread
From: Kirill Korotaev @ 2006-08-16 15:24 UTC (permalink / raw)
  To: Andrew Morton, Linux Kernel Mailing List, Alan Cox, Ingo Molnar,
	Christoph Hellwig, Pavel Emelianov, Andrey Savochkin, devel,
	Rik van Riel, hugh, ckrm-tech, Andi Kleen

The following patch set presents base of
User Resource Beancounters (UBC).
UBC allows to account and control consumption
of kernel resources used by group of processes.

The full UBC patch set allows to control:
- kernel memory. All the kernel objects allocatable
  on user demand should be accounted and limited
  for DoS protection.
  E.g. page tables, task structs, vmas etc.

- virtual memory pages. UBC allows to
  limit a container to some amount of memory and
  introduces 2-level OOM killer taking into account
  container's consumption.
  pages shared between containers are correctly
  charged as fractions (tunable).

- network buffers. These includes TCP/IP rcv/snd
  buffers, dgram snd buffers, unix, netlinks and
  other buffers.

- minor resources accounted/limited by number:
  tasks, files, flocks, ptys, siginfo, pinned dcache
  mem, sockets, iptentries (for containers with
  virtualized networking)

As the first step we want to propose for discussion
the most complicated parts of resource management:
kernel memory and virtual memory.
The patch set to be sent provides core for UBC and
management of kernel memory only. Virtual memory
management will be sent in a couple of days.

The patches in these series are:
diff-ubc-kconfig.patch:
    Adds kernel/ub/Kconfig file with UBC options and
    includes it into arch Kconfigs

diff-ubc-core.patch:
    Contains core functionality and interfaces of UBC:
    find/create beancounter, initialization,
    charge/uncharge of resource, core objects' declarations.

diff-ubc-task.patch:
    Contains code responsible for setting UB on task,
    it's inheriting and setting host context in interrupts.

    Task contains three beancounters:
    1. exec_ub  - current context. all resources are charged
                  to this beancounter.
    2. task_ub  - beancounter to which task_struct is charged
                  itself.
    3. fork_sub - beancounter which is inherited by
                  task's children on fork

diff-ubc-syscalls.patch:
    Patch adds system calls for UB management:
    1. sys_getluid    - get current UB id
    2. sys_setluid    - changes exec_ and fork_ UBs on current
    3. sys_setublimit - set limits for resources consumtions

diff-ubc-kmem-core.patch:
    Introduces UB_KMEMSIZE resource which accounts kernel
    objects allocated by task's request.

    Objects are accounted via struct page and slab objects.
    For the latter ones each slab contains a set of pointers
    corresponding object is charged to.

    Allocation charge rules:
    1. Pages - if allocation is performed with __GFP_UBC flag - page
       is charged to current's exec_ub.
    2. Slabs - kmem_cache may be created with SLAB_UBC flag - in this
       case each allocation is charged. Caches used by kmalloc are
       created with SLAB_UBC | SLAB_UBC_NOCHARGE flags. In this case
       only __GFP_UBC allocations are charged.

diff-ubc-kmem-charge.patch:
    Adds SLAB_UBC and __GFP_UBC flags in appropriate places
    to cause charging/limiting of specified resources.

diff-ubc-proc.patch:
    Adds two proc entries user_beancounters and user_beancounters_sub
    allowing to see current state (usage/limits/fails for each UB).
    Implemented via seq files.

Patch set is applicable to 2.6.18-rc4-mm1

Thanks,
Kirill


^ permalink raw reply	[flat|nested] 209+ messages in thread

end of thread, other threads:[~2006-08-25 23:00 UTC | newest]

Thread overview: 209+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-16 15:24 [RFC][PATCH] UBC: user resource beancounters Kirill Korotaev
2006-08-16 15:35 ` [RFC][PATCH 1/7] UBC: kconfig Kirill Korotaev
2006-08-18 19:57   ` [ckrm-tech] " Chandra Seetharaman
2006-08-18 21:14   ` Adrian Bunk
2006-08-25 15:12   ` Pavel Machek
2006-08-16 15:37 ` [RFC][PATCH 2/7] UBC: core (structures, API) Kirill Korotaev
2006-08-16 16:58   ` Alan Cox
2006-08-17 11:42     ` Kirill Korotaev
2006-08-16 17:15   ` Greg KH
2006-08-17 11:45     ` Kirill Korotaev
2006-08-17 12:14       ` Greg KH
2006-08-17 14:32       ` [ckrm-tech] " Dave Hansen
2006-08-18 12:36         ` Kirill Korotaev
2006-08-16 18:11   ` Rohit Seth
2006-08-16 18:18     ` Andrew Morton
2006-08-17 11:54       ` Kirill Korotaev
2006-08-17 11:53     ` Kirill Korotaev
2006-08-17 16:55       ` Rohit Seth
2006-08-18 11:14         ` Kirill Korotaev
2006-08-18 17:51           ` Rohit Seth
2006-08-18  5:31       ` Andrew Morton
2006-08-18  7:35         ` [PATCH " Andrey Savochkin
2006-08-18  8:26           ` [ckrm-tech] " Matt Helsley
2006-08-18 11:52             ` Kirill Korotaev
2006-08-18 15:59         ` [RFC][PATCH " Alan Cox
2006-08-17 11:09   ` [ckrm-tech] " Srivatsa Vaddagiri
2006-08-17 14:02     ` Kirill Korotaev
2006-08-17 18:59       ` Chandra Seetharaman
2006-08-18  1:58   ` Matt Helsley
2006-08-18 11:36     ` Kirill Korotaev
2006-08-19  2:38       ` Matt Helsley
2006-08-21 11:02         ` Kirill Korotaev
2006-08-22 12:23           ` Srivatsa Vaddagiri
2006-08-22 12:46             ` Kirill Korotaev
2006-08-22 14:38               ` Srivatsa Vaddagiri
2006-08-21 17:35         ` Chandra Seetharaman
2006-08-20  4:58   ` Balbir Singh
2006-08-20  5:01   ` Balbir Singh
2006-08-16 15:38 ` [RFC][PATCH 3/7] UBC: ub context and inheritance Kirill Korotaev
2006-08-16 16:51   ` Alan Cox
2006-08-17 11:09   ` [ckrm-tech] " Srivatsa Vaddagiri
2006-08-17 13:21     ` [Devel] " Pavel V. Emelianov
2006-08-18  2:42   ` Matt Helsley
2006-08-18  9:23     ` Kirill Korotaev
2006-08-19  2:19       ` Matt Helsley
2006-08-18 20:03   ` Chandra Seetharaman
2006-08-21 10:32     ` Kirill Korotaev
2006-08-21 20:48       ` Chandra Seetharaman
2006-08-16 15:39 ` [RFC][PATCH 4/7] UBC: syscalls (user interface) Kirill Korotaev
2006-08-16 16:52   ` Alan Cox
2006-08-16 17:17   ` Greg KH
2006-08-17 12:02     ` Kirill Korotaev
2006-08-16 18:17   ` Rohit Seth
2006-08-16 19:04     ` Alan Cox
2006-08-16 19:22       ` Rohit Seth
2006-08-17 12:13         ` Kirill Korotaev
2006-08-17 15:40           ` Andrew Morton
2006-08-18  8:08             ` [PATCH " Andrey Savochkin
2006-08-18 14:45               ` [ckrm-tech] " Dave Hansen
2006-08-18 16:42                 ` Andrew Morton
2006-08-18 17:29                   ` Dave Hansen
2006-08-18 17:38                     ` Andrew Morton
2006-08-18 17:59                   ` Rohit Seth
2006-08-18 18:18                     ` Andrew Morton
2006-08-21  2:42                     ` Magnus Damm
2006-08-18 18:09                   ` Paul Jackson
2006-08-18 18:17                   ` Chandra Seetharaman
2006-08-18 18:27                     ` Chandra Seetharaman
2006-08-18 18:56                     ` Paul Jackson
2006-08-18 19:16                       ` Chris Friesen
2006-08-18 21:19                         ` Paul Jackson
2006-08-18 19:48                       ` Chandra Seetharaman
2006-08-18 21:16                         ` Paul Jackson
2006-08-21  2:38                   ` Magnus Damm
2006-08-21  7:48                     ` Andi Kleen
2006-08-21  8:42                       ` Magnus Damm
2006-08-21  9:03                         ` Andi Kleen
2006-08-21  9:18                           ` Magnus Damm
2006-08-21 13:35                   ` Kirill Korotaev
2006-08-21 17:51                     ` Paul Jackson
2006-08-22  8:52                       ` Kirill Korotaev
2006-08-21  2:47                 ` Magnus Damm
2006-08-22  1:16                   ` Rohit Seth
2006-08-22  3:58                     ` Magnus Damm
2006-08-22 18:34                       ` Chandra Seetharaman
2006-08-24  1:20                       ` Rohit Seth
2006-08-18 11:05             ` [RFC][PATCH " Kirill Korotaev
2006-08-17 17:08           ` Rohit Seth
2006-08-17 12:04     ` Kirill Korotaev
2006-08-17 17:05       ` Rohit Seth
2006-08-17 11:09   ` [ckrm-tech] " Srivatsa Vaddagiri
2006-08-17 14:04     ` Kirill Korotaev
2006-08-17 16:19       ` Srivatsa Vaddagiri
2006-08-18  2:31   ` Matt Helsley
2006-08-18 11:45     ` Kirill Korotaev
2006-08-19  2:43       ` Matt Helsley
2006-08-18 11:40   ` Arnd Bergmann
2006-08-18 20:13   ` [ckrm-tech] " Chandra Seetharaman
2006-08-16 15:40 ` [RFC][PATCH 5/7] UBC: kernel memory accounting (core) Kirill Korotaev
2006-08-16 16:56   ` Alan Cox
2006-08-17 13:47     ` Kirill Korotaev
2006-08-16 18:24   ` Rohit Seth
2006-08-17 13:27     ` Kirill Korotaev
2006-08-17 14:38       ` [ckrm-tech] " Dave Hansen
2006-08-18  9:31         ` Kirill Korotaev
2006-08-18 14:58           ` Dave Hansen
2006-08-21 10:40             ` Kirill Korotaev
2006-08-21 15:10               ` Dave Hansen
2006-08-18 15:06           ` Dave Hansen
2006-08-21 12:38             ` Kirill Korotaev
2006-08-17 17:02       ` Rohit Seth
2006-08-18  9:38         ` Kirill Korotaev
2006-08-18 16:55           ` Rohit Seth
2006-08-21 10:43             ` Kirill Korotaev
2006-08-22  1:23               ` Rohit Seth
2006-08-16 18:47   ` Dave Hansen
2006-08-16 19:15     ` Rohit Seth
2006-08-16 19:59       ` [ckrm-tech] " Dave Hansen
2006-08-17  0:24         ` Alan Cox
2006-08-17 14:26           ` Dave Hansen
2006-08-17 15:01             ` Alan Cox
2006-08-17 16:04               ` Andi Kleen
2006-08-18 10:54                 ` Kirill Korotaev
2006-08-17 16:37               ` Dave Hansen
2006-08-17 15:19             ` Rik van Riel
2006-08-17 17:28               ` Rohit Seth
2006-08-17 18:43                 ` Andi Kleen
2006-08-17 17:49                   ` Dave Hansen
2006-08-18  8:29               ` Kirill Korotaev
2006-08-18 17:06                 ` Rohit Seth
2006-08-17 17:16             ` Rohit Seth
2006-08-17 17:23               ` Dave Hansen
2006-08-17 17:36                 ` Rohit Seth
2006-08-17 17:53                   ` Dave Hansen
2006-08-18  8:54                   ` Kirill Korotaev
2006-08-18 14:52                     ` Dave Hansen
2006-08-18 17:38                     ` Rohit Seth
2006-08-21 11:29                       ` Kirill Korotaev
2006-08-22  1:48                         ` Rohit Seth
2006-08-22  7:43                           ` Pavel V. Emelianov
2006-08-18  8:51               ` Kirill Korotaev
2006-08-18  8:52               ` Kirill Korotaev
2006-08-18 14:59                 ` Alan Cox
2006-08-18 19:32                   ` Dave Hansen
2006-08-18 20:52                     ` Alan Cox
2006-08-21  9:44                       ` Kirill Korotaev
2006-08-17 16:42           ` Rohit Seth
2006-08-17 16:31         ` Rohit Seth
2006-08-17  0:22       ` Alan Cox
2006-08-17 16:36         ` Rohit Seth
2006-08-18  8:44           ` [ckrm-tech] " Kirill Korotaev
2006-08-17 13:35       ` Kirill Korotaev
2006-08-17 17:13         ` Rohit Seth
2006-08-18  8:49           ` [ckrm-tech] " Kirill Korotaev
2006-08-17 13:31     ` Kirill Korotaev
2006-08-17 14:36       ` Dave Hansen
2006-08-18  8:12         ` [ckrm-tech] " Kirill Korotaev
2006-08-18 14:43           ` Dave Hansen
2006-08-21  8:57             ` Kirill Korotaev
2006-08-18 20:26   ` Chandra Seetharaman
2006-08-21 10:51     ` Kirill Korotaev
2006-08-21 20:55       ` Chandra Seetharaman
2006-08-16 15:42 ` [RFC][PATCH 6/7] UBC: kernel memory acconting (mark objects) Kirill Korotaev
2006-08-16 16:57   ` Alan Cox
2006-08-16 15:44 ` [RFC][PATCH 7/7] UBC: proc interface Kirill Korotaev
2006-08-16 17:13   ` Greg KH
2006-08-17 13:43     ` Kirill Korotaev
2006-08-17 15:40       ` Greg KH
2006-08-17 16:12         ` [Devel] " Kir Kolyshkin
2006-08-16 18:53 ` [RFC][PATCH] UBC: user resource beancounters Rohit Seth
2006-08-16 19:26   ` Alan Cox
2006-08-17  0:15 ` [ckrm-tech] " Chandra Seetharaman
2006-08-17 11:02 ` Srivatsa Vaddagiri
2006-08-17 13:55   ` Kirill Korotaev
2006-08-17 19:55     ` Chandra Seetharaman
2006-08-18 10:36       ` Kirill Korotaev
2006-08-18 18:53         ` Chandra Seetharaman
2006-08-18 22:55           ` Matt Helsley
2006-08-21 10:55           ` Kirill Korotaev
2006-08-21 21:04             ` Chandra Seetharaman
2006-08-18 19:39 ` Chandra Seetharaman
2006-08-21 13:24   ` Kirill Korotaev
2006-08-21 21:45     ` Chandra Seetharaman
2006-08-21 22:20       ` Alan Cox
2006-08-21 22:44         ` Chandra Seetharaman
2006-08-22  1:45       ` Rohit Seth
2006-08-22 10:02         ` Alan Cox
2006-08-22  9:57           ` Arjan van de Ven
2006-08-22 11:15             ` Alan Cox
2006-08-24  1:31           ` Rohit Seth
2006-08-22 18:55         ` Chandra Seetharaman
2006-08-24  1:44           ` Rohit Seth
2006-08-24  2:04             ` Chandra Seetharaman
2006-08-24 11:10               ` Alan Cox
2006-08-24 23:48                 ` Chandra Seetharaman
2006-08-24 23:55                   ` Kyle Moffett
2006-08-25 18:21                     ` Chandra Seetharaman
2006-08-25 20:46                       ` Alan Cox
2006-08-25 21:37                         ` Chandra Seetharaman
2006-08-25 22:51                           ` Alan Cox
2006-08-25 22:59                             ` Chandra Seetharaman
2006-08-24 17:27               ` Rohit Seth
2006-08-24 23:52                 ` Chandra Seetharaman
2006-08-25 11:12                   ` Kirill Korotaev
2006-08-25 18:47                     ` Chandra Seetharaman
2006-08-25 20:52                       ` Alan Cox
2006-08-25 22:23                         ` Chandra Seetharaman
2006-08-25 23:12                           ` Alan Cox
2006-08-25 23:00                             ` Chandra Seetharaman

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.