Skip to content

Commit 04bf786

Browse files
author
Jens Axboe
committed
Merge branch 'for-linus' into for-3.1/core
Conflicts: block/blk-throttle.c block/cfq-iosched.c Signed-off-by: Jens Axboe <[email protected]>
2 parents d2f31a5 + 7b28afe commit 04bf786

File tree

992 files changed

+12546
-6664
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

992 files changed

+12546
-6664
lines changed

CREDITS

+8
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,14 @@ N: Zach Brown
518518
519519
D: maestro pci sound
520520

521+
M: David Brownell
522+
D: Kernel engineer, mentor, and friend. Maintained USB EHCI and
523+
D: gadget layers, SPI subsystem, GPIO subsystem, and more than a few
524+
D: device drivers. His encouragement also helped many engineers get
525+
D: started working on the Linux kernel. David passed away in early
526+
D: 2011, and will be greatly missed.
527+
W: https://lkml.org/lkml/2011/4/5/36
528+
521529
N: Gary Brubaker
522530
523531
D: USB Serial Empeg Empeg-car Mark I/II Driver
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
What: /sys/class/backlight/<backlight>/<ambient light zone>_max
2+
What: /sys/class/backlight/<backlight>/l1_daylight_max
3+
What: /sys/class/backlight/<backlight>/l2_bright_max
4+
What: /sys/class/backlight/<backlight>/l3_office_max
5+
What: /sys/class/backlight/<backlight>/l4_indoor_max
6+
What: /sys/class/backlight/<backlight>/l5_dark_max
7+
Date: Mai 2011
8+
KernelVersion: 2.6.40
9+
10+
Description:
11+
Control the maximum brightness for <ambient light zone>
12+
on this <backlight>. Values are between 0 and 127. This file
13+
will also show the brightness level stored for this
14+
<ambient light zone>.
15+
16+
What: /sys/class/backlight/<backlight>/<ambient light zone>_dim
17+
What: /sys/class/backlight/<backlight>/l2_bright_dim
18+
What: /sys/class/backlight/<backlight>/l3_office_dim
19+
What: /sys/class/backlight/<backlight>/l4_indoor_dim
20+
What: /sys/class/backlight/<backlight>/l5_dark_dim
21+
Date: Mai 2011
22+
KernelVersion: 2.6.40
23+
24+
Description:
25+
Control the dim brightness for <ambient light zone>
26+
on this <backlight>. Values are between 0 and 127, typically
27+
set to 0. Full off when the backlight is disabled.
28+
This file will also show the dim brightness level stored for
29+
this <ambient light zone>.
30+
31+
What: /sys/class/backlight/<backlight>/ambient_light_level
32+
Date: Mai 2011
33+
KernelVersion: 2.6.40
34+
35+
Description:
36+
Get conversion value of the light sensor.
37+
This value is updated every 80 ms (when the light sensor
38+
is enabled). Returns integer between 0 (dark) and
39+
8000 (max ambient brightness)
40+
41+
What: /sys/class/backlight/<backlight>/ambient_light_zone
42+
Date: Mai 2011
43+
KernelVersion: 2.6.40
44+
45+
Description:
46+
Get/Set current ambient light zone. Reading returns
47+
integer between 1..5 (1 = daylight, 2 = bright, ..., 5 = dark).
48+
Writing a value between 1..5 forces the backlight controller
49+
to enter the corresponding ambient light zone.
50+
Writing 0 returns to normal/automatic ambient light level
51+
operation. The ambient light sensing feature on these devices
52+
is an extension to the API documented in
53+
Documentation/ABI/stable/sysfs-class-backlight.
54+
It can be enabled by writing the value stored in
55+
/sys/class/backlight/<backlight>/max_brightness to
56+
/sys/class/backlight/<backlight>/brightness.

Documentation/accounting/cgroupstats.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ information will not be available.
2121
To extract cgroup statistics a utility very similar to getdelays.c
2222
has been developed, the sample output of the utility is shown below
2323

24-
~/balbir/cgroupstats # ./getdelays -C "/cgroup/a"
24+
~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup/a"
2525
sleeping 1, blocked 0, running 1, stopped 0, uninterruptible 0
26-
~/balbir/cgroupstats # ./getdelays -C "/cgroup"
26+
~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup"
2727
sleeping 155, blocked 0, running 1, stopped 0, uninterruptible 2

Documentation/cgroups/blkio-controller.txt

+17-14
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,19 @@ cgroups. Here is what you can do.
2828
- Enable group scheduling in CFQ
2929
CONFIG_CFQ_GROUP_IOSCHED=y
3030

31-
- Compile and boot into kernel and mount IO controller (blkio).
31+
- Compile and boot into kernel and mount IO controller (blkio); see
32+
cgroups.txt, Why are cgroups needed?.
3233

33-
mount -t cgroup -o blkio none /cgroup
34+
mount -t tmpfs cgroup_root /sys/fs/cgroup
35+
mkdir /sys/fs/cgroup/blkio
36+
mount -t cgroup -o blkio none /sys/fs/cgroup/blkio
3437

3538
- Create two cgroups
36-
mkdir -p /cgroup/test1/ /cgroup/test2
39+
mkdir -p /sys/fs/cgroup/blkio/test1/ /sys/fs/cgroup/blkio/test2
3740

3841
- Set weights of group test1 and test2
39-
echo 1000 > /cgroup/test1/blkio.weight
40-
echo 500 > /cgroup/test2/blkio.weight
42+
echo 1000 > /sys/fs/cgroup/blkio/test1/blkio.weight
43+
echo 500 > /sys/fs/cgroup/blkio/test2/blkio.weight
4144

4245
- Create two same size files (say 512MB each) on same disk (file1, file2) and
4346
launch two dd threads in different cgroup to read those files.
@@ -46,12 +49,12 @@ cgroups. Here is what you can do.
4649
echo 3 > /proc/sys/vm/drop_caches
4750

4851
dd if=/mnt/sdb/zerofile1 of=/dev/null &
49-
echo $! > /cgroup/test1/tasks
50-
cat /cgroup/test1/tasks
52+
echo $! > /sys/fs/cgroup/blkio/test1/tasks
53+
cat /sys/fs/cgroup/blkio/test1/tasks
5154

5255
dd if=/mnt/sdb/zerofile2 of=/dev/null &
53-
echo $! > /cgroup/test2/tasks
54-
cat /cgroup/test2/tasks
56+
echo $! > /sys/fs/cgroup/blkio/test2/tasks
57+
cat /sys/fs/cgroup/blkio/test2/tasks
5558

5659
- At macro level, first dd should finish first. To get more precise data, keep
5760
on looking at (with the help of script), at blkio.disk_time and
@@ -68,13 +71,13 @@ Throttling/Upper Limit policy
6871
- Enable throttling in block layer
6972
CONFIG_BLK_DEV_THROTTLING=y
7073

71-
- Mount blkio controller
72-
mount -t cgroup -o blkio none /cgroup/blkio
74+
- Mount blkio controller (see cgroups.txt, Why are cgroups needed?)
75+
mount -t cgroup -o blkio none /sys/fs/cgroup/blkio
7376

7477
- Specify a bandwidth rate on particular device for root group. The format
7578
for policy is "<major>:<minor> <byes_per_second>".
7679

77-
echo "8:16 1048576" > /cgroup/blkio/blkio.read_bps_device
80+
echo "8:16 1048576" > /sys/fs/cgroup/blkio/blkio.read_bps_device
7881

7982
Above will put a limit of 1MB/second on reads happening for root group
8083
on device having major/minor number 8:16.
@@ -108,7 +111,7 @@ Hierarchical Cgroups
108111
CFQ and throttling will practically treat all groups at same level.
109112

110113
pivot
111-
/ | \ \
114+
/ / \ \
112115
root test1 test2 test3
113116

114117
Down the line we can implement hierarchical accounting/control support
@@ -149,7 +152,7 @@ Proportional weight policy files
149152

150153
Following is the format.
151154

152-
#echo dev_maj:dev_minor weight > /path/to/cgroup/blkio.weight_device
155+
# echo dev_maj:dev_minor weight > blkio.weight_device
153156
Configure weight=300 on /dev/sdb (8:16) in this cgroup
154157
# echo 8:16 300 > blkio.weight_device
155158
# cat blkio.weight_device

Documentation/cgroups/cgroups.txt

+36-24
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ With the ability to classify tasks differently for different resources
138138
the admin can easily set up a script which receives exec notifications
139139
and depending on who is launching the browser he can
140140

141-
# echo browser_pid > /mnt/<restype>/<userclass>/tasks
141+
# echo browser_pid > /sys/fs/cgroup/<restype>/<userclass>/tasks
142142

143143
With only a single hierarchy, he now would potentially have to create
144144
a separate cgroup for every browser launched and associate it with
145-
approp network and other resource class. This may lead to
145+
appropriate network and other resource class. This may lead to
146146
proliferation of such cgroups.
147147

148148
Also lets say that the administrator would like to give enhanced network
@@ -153,9 +153,9 @@ apps enhanced CPU power,
153153
With ability to write pids directly to resource classes, it's just a
154154
matter of :
155155

156-
# echo pid > /mnt/network/<new_class>/tasks
156+
# echo pid > /sys/fs/cgroup/network/<new_class>/tasks
157157
(after some time)
158-
# echo pid > /mnt/network/<orig_class>/tasks
158+
# echo pid > /sys/fs/cgroup/network/<orig_class>/tasks
159159

160160
Without this ability, he would have to split the cgroup into
161161
multiple separate ones and then associate the new cgroups with the
@@ -310,21 +310,24 @@ subsystem, this is the case for the cpuset.
310310
To start a new job that is to be contained within a cgroup, using
311311
the "cpuset" cgroup subsystem, the steps are something like:
312312

313-
1) mkdir /dev/cgroup
314-
2) mount -t cgroup -ocpuset cpuset /dev/cgroup
315-
3) Create the new cgroup by doing mkdir's and write's (or echo's) in
316-
the /dev/cgroup virtual file system.
317-
4) Start a task that will be the "founding father" of the new job.
318-
5) Attach that task to the new cgroup by writing its pid to the
319-
/dev/cgroup tasks file for that cgroup.
320-
6) fork, exec or clone the job tasks from this founding father task.
313+
1) mount -t tmpfs cgroup_root /sys/fs/cgroup
314+
2) mkdir /sys/fs/cgroup/cpuset
315+
3) mount -t cgroup -ocpuset cpuset /sys/fs/cgroup/cpuset
316+
4) Create the new cgroup by doing mkdir's and write's (or echo's) in
317+
the /sys/fs/cgroup virtual file system.
318+
5) Start a task that will be the "founding father" of the new job.
319+
6) Attach that task to the new cgroup by writing its pid to the
320+
/sys/fs/cgroup/cpuset/tasks file for that cgroup.
321+
7) fork, exec or clone the job tasks from this founding father task.
321322

322323
For example, the following sequence of commands will setup a cgroup
323324
named "Charlie", containing just CPUs 2 and 3, and Memory Node 1,
324325
and then start a subshell 'sh' in that cgroup:
325326

326-
mount -t cgroup cpuset -ocpuset /dev/cgroup
327-
cd /dev/cgroup
327+
mount -t tmpfs cgroup_root /sys/fs/cgroup
328+
mkdir /sys/fs/cgroup/cpuset
329+
mount -t cgroup cpuset -ocpuset /sys/fs/cgroup/cpuset
330+
cd /sys/fs/cgroup/cpuset
328331
mkdir Charlie
329332
cd Charlie
330333
/bin/echo 2-3 > cpuset.cpus
@@ -345,7 +348,7 @@ Creating, modifying, using the cgroups can be done through the cgroup
345348
virtual filesystem.
346349

347350
To mount a cgroup hierarchy with all available subsystems, type:
348-
# mount -t cgroup xxx /dev/cgroup
351+
# mount -t cgroup xxx /sys/fs/cgroup
349352

350353
The "xxx" is not interpreted by the cgroup code, but will appear in
351354
/proc/mounts so may be any useful identifying string that you like.
@@ -354,23 +357,32 @@ Note: Some subsystems do not work without some user input first. For instance,
354357
if cpusets are enabled the user will have to populate the cpus and mems files
355358
for each new cgroup created before that group can be used.
356359

360+
As explained in section `1.2 Why are cgroups needed?' you should create
361+
different hierarchies of cgroups for each single resource or group of
362+
resources you want to control. Therefore, you should mount a tmpfs on
363+
/sys/fs/cgroup and create directories for each cgroup resource or resource
364+
group.
365+
366+
# mount -t tmpfs cgroup_root /sys/fs/cgroup
367+
# mkdir /sys/fs/cgroup/rg1
368+
357369
To mount a cgroup hierarchy with just the cpuset and memory
358370
subsystems, type:
359-
# mount -t cgroup -o cpuset,memory hier1 /dev/cgroup
371+
# mount -t cgroup -o cpuset,memory hier1 /sys/fs/cgroup/rg1
360372

361373
To change the set of subsystems bound to a mounted hierarchy, just
362374
remount with different options:
363-
# mount -o remount,cpuset,blkio hier1 /dev/cgroup
375+
# mount -o remount,cpuset,blkio hier1 /sys/fs/cgroup/rg1
364376

365377
Now memory is removed from the hierarchy and blkio is added.
366378

367379
Note this will add blkio to the hierarchy but won't remove memory or
368380
cpuset, because the new options are appended to the old ones:
369-
# mount -o remount,blkio /dev/cgroup
381+
# mount -o remount,blkio /sys/fs/cgroup/rg1
370382

371383
To Specify a hierarchy's release_agent:
372384
# mount -t cgroup -o cpuset,release_agent="/sbin/cpuset_release_agent" \
373-
xxx /dev/cgroup
385+
xxx /sys/fs/cgroup/rg1
374386

375387
Note that specifying 'release_agent' more than once will return failure.
376388

@@ -379,17 +391,17 @@ when the hierarchy consists of a single (root) cgroup. Supporting
379391
the ability to arbitrarily bind/unbind subsystems from an existing
380392
cgroup hierarchy is intended to be implemented in the future.
381393

382-
Then under /dev/cgroup you can find a tree that corresponds to the
383-
tree of the cgroups in the system. For instance, /dev/cgroup
394+
Then under /sys/fs/cgroup/rg1 you can find a tree that corresponds to the
395+
tree of the cgroups in the system. For instance, /sys/fs/cgroup/rg1
384396
is the cgroup that holds the whole system.
385397

386398
If you want to change the value of release_agent:
387-
# echo "/sbin/new_release_agent" > /dev/cgroup/release_agent
399+
# echo "/sbin/new_release_agent" > /sys/fs/cgroup/rg1/release_agent
388400

389401
It can also be changed via remount.
390402

391-
If you want to create a new cgroup under /dev/cgroup:
392-
# cd /dev/cgroup
403+
If you want to create a new cgroup under /sys/fs/cgroup/rg1:
404+
# cd /sys/fs/cgroup/rg1
393405
# mkdir my_cgroup
394406

395407
Now you want to do something with this cgroup.

Documentation/cgroups/cpuacct.txt

+10-11
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,25 @@ directly present in its group.
1010

1111
Accounting groups can be created by first mounting the cgroup filesystem.
1212

13-
# mkdir /cgroups
14-
# mount -t cgroup -ocpuacct none /cgroups
15-
16-
With the above step, the initial or the parent accounting group
17-
becomes visible at /cgroups. At bootup, this group includes all the
18-
tasks in the system. /cgroups/tasks lists the tasks in this cgroup.
19-
/cgroups/cpuacct.usage gives the CPU time (in nanoseconds) obtained by
20-
this group which is essentially the CPU time obtained by all the tasks
13+
# mount -t cgroup -ocpuacct none /sys/fs/cgroup
14+
15+
With the above step, the initial or the parent accounting group becomes
16+
visible at /sys/fs/cgroup. At bootup, this group includes all the tasks in
17+
the system. /sys/fs/cgroup/tasks lists the tasks in this cgroup.
18+
/sys/fs/cgroup/cpuacct.usage gives the CPU time (in nanoseconds) obtained
19+
by this group which is essentially the CPU time obtained by all the tasks
2120
in the system.
2221

23-
New accounting groups can be created under the parent group /cgroups.
22+
New accounting groups can be created under the parent group /sys/fs/cgroup.
2423

25-
# cd /cgroups
24+
# cd /sys/fs/cgroup
2625
# mkdir g1
2726
# echo $$ > g1
2827

2928
The above steps create a new group g1 and move the current shell
3029
process (bash) into it. CPU time consumed by this bash and its children
3130
can be obtained from g1/cpuacct.usage and the same is accumulated in
32-
/cgroups/cpuacct.usage also.
31+
/sys/fs/cgroup/cpuacct.usage also.
3332

3433
cpuacct.stat file lists a few statistics which further divide the
3534
CPU time obtained by the cgroup into user and system times. Currently

Documentation/cgroups/cpusets.txt

+14-14
Original file line numberDiff line numberDiff line change
@@ -661,21 +661,21 @@ than stress the kernel.
661661

662662
To start a new job that is to be contained within a cpuset, the steps are:
663663

664-
1) mkdir /dev/cpuset
665-
2) mount -t cgroup -ocpuset cpuset /dev/cpuset
664+
1) mkdir /sys/fs/cgroup/cpuset
665+
2) mount -t cgroup -ocpuset cpuset /sys/fs/cgroup/cpuset
666666
3) Create the new cpuset by doing mkdir's and write's (or echo's) in
667-
the /dev/cpuset virtual file system.
667+
the /sys/fs/cgroup/cpuset virtual file system.
668668
4) Start a task that will be the "founding father" of the new job.
669669
5) Attach that task to the new cpuset by writing its pid to the
670-
/dev/cpuset tasks file for that cpuset.
670+
/sys/fs/cgroup/cpuset tasks file for that cpuset.
671671
6) fork, exec or clone the job tasks from this founding father task.
672672

673673
For example, the following sequence of commands will setup a cpuset
674674
named "Charlie", containing just CPUs 2 and 3, and Memory Node 1,
675675
and then start a subshell 'sh' in that cpuset:
676676

677-
mount -t cgroup -ocpuset cpuset /dev/cpuset
678-
cd /dev/cpuset
677+
mount -t cgroup -ocpuset cpuset /sys/fs/cgroup/cpuset
678+
cd /sys/fs/cgroup/cpuset
679679
mkdir Charlie
680680
cd Charlie
681681
/bin/echo 2-3 > cpuset.cpus
@@ -710,14 +710,14 @@ Creating, modifying, using the cpusets can be done through the cpuset
710710
virtual filesystem.
711711

712712
To mount it, type:
713-
# mount -t cgroup -o cpuset cpuset /dev/cpuset
713+
# mount -t cgroup -o cpuset cpuset /sys/fs/cgroup/cpuset
714714

715-
Then under /dev/cpuset you can find a tree that corresponds to the
716-
tree of the cpusets in the system. For instance, /dev/cpuset
715+
Then under /sys/fs/cgroup/cpuset you can find a tree that corresponds to the
716+
tree of the cpusets in the system. For instance, /sys/fs/cgroup/cpuset
717717
is the cpuset that holds the whole system.
718718

719-
If you want to create a new cpuset under /dev/cpuset:
720-
# cd /dev/cpuset
719+
If you want to create a new cpuset under /sys/fs/cgroup/cpuset:
720+
# cd /sys/fs/cgroup/cpuset
721721
# mkdir my_cpuset
722722

723723
Now you want to do something with this cpuset.
@@ -765,12 +765,12 @@ wrapper around the cgroup filesystem.
765765

766766
The command
767767

768-
mount -t cpuset X /dev/cpuset
768+
mount -t cpuset X /sys/fs/cgroup/cpuset
769769

770770
is equivalent to
771771

772-
mount -t cgroup -ocpuset,noprefix X /dev/cpuset
773-
echo "/sbin/cpuset_release_agent" > /dev/cpuset/release_agent
772+
mount -t cgroup -ocpuset,noprefix X /sys/fs/cgroup/cpuset
773+
echo "/sbin/cpuset_release_agent" > /sys/fs/cgroup/cpuset/release_agent
774774

775775
2.2 Adding/removing cpus
776776
------------------------

0 commit comments

Comments
 (0)