Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165665
b: refs/heads/master
c: a6df636
h: refs/heads/master
i:
  165663: 543aa28
v: v3
  • Loading branch information
Balbir Singh authored and Linus Torvalds committed Sep 24, 2009
1 parent 3096e8d commit ed327e2
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 261fb61a8bf6d3bd964ae6f1e6af49585d30db51
refs/heads/master: a6df63615b943dbef22df04c19f4506330fe835e
37 changes: 36 additions & 1 deletion trunk/Documentation/cgroups/memory.txt
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,42 @@ cgroups created below it.

NOTE2: This feature can be enabled/disabled per subtree.

7. TODO
7. Soft limits

Soft limits allow for greater sharing of memory. The idea behind soft limits
is to allow control groups to use as much of the memory as needed, provided

a. There is no memory contention
b. They do not exceed their hard limit

When the system detects memory contention or low memory control groups
are pushed back to their soft limits. If the soft limit of each control
group is very high, they are pushed back as much as possible to make
sure that one control group does not starve the others of memory.

Please note that soft limits is a best effort feature, it comes with
no guarantees, but it does its best to make sure that when memory is
heavily contended for, memory is allocated based on the soft limit
hints/setup. Currently soft limit based reclaim is setup such that
it gets invoked from balance_pgdat (kswapd).

7.1 Interface

Soft limits can be setup by using the following commands (in this example we
assume a soft limit of 256 megabytes)

# echo 256M > memory.soft_limit_in_bytes

If we want to change this to 1G, we can at any time use

# echo 1G > memory.soft_limit_in_bytes

NOTE1: Soft limits take effect over a long period of time, since they involve
reclaiming memory for balancing between memory cgroups
NOTE2: It is recommended to set the soft limit always below the hard limit,
otherwise the hard limit will take precedence.

8. TODO

1. Add support for accounting huge pages (as a separate controller)
2. Make per-cgroup scanner reclaim not-shared pages first
Expand Down

0 comments on commit ed327e2

Please sign in to comment.