Loading CREDITS +1 −1 Original line number Diff line number Diff line Loading @@ -518,7 +518,7 @@ N: Zach Brown E: zab@zabbo.net D: maestro pci sound M: David Brownell N: David Brownell D: Kernel engineer, mentor, and friend. Maintained USB EHCI and D: gadget layers, SPI subsystem, GPIO subsystem, and more than a few D: device drivers. His encouragement also helped many engineers get Loading Documentation/ABI/testing/sysfs-class-backlight-driver-adp8870 0 → 100644 +56 −0 Original line number Diff line number Diff line What: /sys/class/backlight/<backlight>/<ambient light zone>_max What: /sys/class/backlight/<backlight>/l1_daylight_max What: /sys/class/backlight/<backlight>/l2_bright_max What: /sys/class/backlight/<backlight>/l3_office_max What: /sys/class/backlight/<backlight>/l4_indoor_max What: /sys/class/backlight/<backlight>/l5_dark_max Date: Mai 2011 KernelVersion: 2.6.40 Contact: device-drivers-devel@blackfin.uclinux.org Description: Control the maximum brightness for <ambient light zone> on this <backlight>. Values are between 0 and 127. This file will also show the brightness level stored for this <ambient light zone>. What: /sys/class/backlight/<backlight>/<ambient light zone>_dim What: /sys/class/backlight/<backlight>/l2_bright_dim What: /sys/class/backlight/<backlight>/l3_office_dim What: /sys/class/backlight/<backlight>/l4_indoor_dim What: /sys/class/backlight/<backlight>/l5_dark_dim Date: Mai 2011 KernelVersion: 2.6.40 Contact: device-drivers-devel@blackfin.uclinux.org Description: Control the dim brightness for <ambient light zone> on this <backlight>. Values are between 0 and 127, typically set to 0. Full off when the backlight is disabled. This file will also show the dim brightness level stored for this <ambient light zone>. What: /sys/class/backlight/<backlight>/ambient_light_level Date: Mai 2011 KernelVersion: 2.6.40 Contact: device-drivers-devel@blackfin.uclinux.org Description: Get conversion value of the light sensor. This value is updated every 80 ms (when the light sensor is enabled). Returns integer between 0 (dark) and 8000 (max ambient brightness) What: /sys/class/backlight/<backlight>/ambient_light_zone Date: Mai 2011 KernelVersion: 2.6.40 Contact: device-drivers-devel@blackfin.uclinux.org Description: Get/Set current ambient light zone. Reading returns integer between 1..5 (1 = daylight, 2 = bright, ..., 5 = dark). Writing a value between 1..5 forces the backlight controller to enter the corresponding ambient light zone. Writing 0 returns to normal/automatic ambient light level operation. The ambient light sensing feature on these devices is an extension to the API documented in Documentation/ABI/stable/sysfs-class-backlight. It can be enabled by writing the value stored in /sys/class/backlight/<backlight>/max_brightness to /sys/class/backlight/<backlight>/brightness. No newline at end of file Documentation/CodingStyle +2 −2 Original line number Diff line number Diff line Loading @@ -680,8 +680,8 @@ ones already enabled by DEBUG. Chapter 14: Allocating memory The kernel provides the following general purpose memory allocators: kmalloc(), kzalloc(), kcalloc(), and vmalloc(). Please refer to the API documentation for further information about them. kmalloc(), kzalloc(), kcalloc(), vmalloc(), and vzalloc(). Please refer to the API documentation for further information about them. The preferred form for passing a size of a struct is the following: Loading Documentation/accounting/cgroupstats.txt +2 −2 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ information will not be available. To extract cgroup statistics a utility very similar to getdelays.c has been developed, the sample output of the utility is shown below ~/balbir/cgroupstats # ./getdelays -C "/cgroup/a" ~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup/a" sleeping 1, blocked 0, running 1, stopped 0, uninterruptible 0 ~/balbir/cgroupstats # ./getdelays -C "/cgroup" ~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup" sleeping 155, blocked 0, running 1, stopped 0, uninterruptible 2 Documentation/cgroups/blkio-controller.txt +22 −19 Original line number Diff line number Diff line Loading @@ -28,16 +28,19 @@ cgroups. Here is what you can do. - Enable group scheduling in CFQ CONFIG_CFQ_GROUP_IOSCHED=y - Compile and boot into kernel and mount IO controller (blkio). - Compile and boot into kernel and mount IO controller (blkio); see cgroups.txt, Why are cgroups needed?. mount -t cgroup -o blkio none /cgroup mount -t tmpfs cgroup_root /sys/fs/cgroup mkdir /sys/fs/cgroup/blkio mount -t cgroup -o blkio none /sys/fs/cgroup/blkio - Create two cgroups mkdir -p /cgroup/test1/ /cgroup/test2 mkdir -p /sys/fs/cgroup/blkio/test1/ /sys/fs/cgroup/blkio/test2 - Set weights of group test1 and test2 echo 1000 > /cgroup/test1/blkio.weight echo 500 > /cgroup/test2/blkio.weight echo 1000 > /sys/fs/cgroup/blkio/test1/blkio.weight echo 500 > /sys/fs/cgroup/blkio/test2/blkio.weight - Create two same size files (say 512MB each) on same disk (file1, file2) and launch two dd threads in different cgroup to read those files. Loading @@ -46,12 +49,12 @@ cgroups. Here is what you can do. echo 3 > /proc/sys/vm/drop_caches dd if=/mnt/sdb/zerofile1 of=/dev/null & echo $! > /cgroup/test1/tasks cat /cgroup/test1/tasks echo $! > /sys/fs/cgroup/blkio/test1/tasks cat /sys/fs/cgroup/blkio/test1/tasks dd if=/mnt/sdb/zerofile2 of=/dev/null & echo $! > /cgroup/test2/tasks cat /cgroup/test2/tasks echo $! > /sys/fs/cgroup/blkio/test2/tasks cat /sys/fs/cgroup/blkio/test2/tasks - At macro level, first dd should finish first. To get more precise data, keep on looking at (with the help of script), at blkio.disk_time and Loading @@ -68,13 +71,13 @@ Throttling/Upper Limit policy - Enable throttling in block layer CONFIG_BLK_DEV_THROTTLING=y - Mount blkio controller mount -t cgroup -o blkio none /cgroup/blkio - Mount blkio controller (see cgroups.txt, Why are cgroups needed?) mount -t cgroup -o blkio none /sys/fs/cgroup/blkio - Specify a bandwidth rate on particular device for root group. The format for policy is "<major>:<minor> <byes_per_second>". echo "8:16 1048576" > /cgroup/blkio/blkio.read_bps_device echo "8:16 1048576" > /sys/fs/cgroup/blkio/blkio.throttle.read_bps_device Above will put a limit of 1MB/second on reads happening for root group on device having major/minor number 8:16. Loading @@ -87,7 +90,7 @@ Throttling/Upper Limit policy 1024+0 records out 4194304 bytes (4.2 MB) copied, 4.0001 s, 1.0 MB/s Limits for writes can be put using blkio.write_bps_device file. Limits for writes can be put using blkio.throttle.write_bps_device file. Hierarchical Cgroups ==================== Loading @@ -108,7 +111,7 @@ Hierarchical Cgroups CFQ and throttling will practically treat all groups at same level. pivot / | \ \ / / \ \ root test1 test2 test3 Down the line we can implement hierarchical accounting/control support Loading Loading @@ -149,7 +152,7 @@ Proportional weight policy files Following is the format. #echo dev_maj:dev_minor weight > /path/to/cgroup/blkio.weight_device # echo dev_maj:dev_minor weight > blkio.weight_device Configure weight=300 on /dev/sdb (8:16) in this cgroup # echo 8:16 300 > blkio.weight_device # cat blkio.weight_device Loading Loading @@ -283,28 +286,28 @@ Throttling/Upper limit policy files specified in bytes per second. Rules are per deivce. Following is the format. echo "<major>:<minor> <rate_bytes_per_second>" > /cgrp/blkio.read_bps_device echo "<major>:<minor> <rate_bytes_per_second>" > /cgrp/blkio.throttle.read_bps_device - blkio.throttle.write_bps_device - Specifies upper limit on WRITE rate to the device. IO rate is specified in bytes per second. Rules are per deivce. Following is the format. echo "<major>:<minor> <rate_bytes_per_second>" > /cgrp/blkio.write_bps_device echo "<major>:<minor> <rate_bytes_per_second>" > /cgrp/blkio.throttle.write_bps_device - blkio.throttle.read_iops_device - Specifies upper limit on READ rate from the device. IO rate is specified in IO per second. Rules are per deivce. Following is the format. echo "<major>:<minor> <rate_io_per_second>" > /cgrp/blkio.read_iops_device echo "<major>:<minor> <rate_io_per_second>" > /cgrp/blkio.throttle.read_iops_device - blkio.throttle.write_iops_device - Specifies upper limit on WRITE rate to the device. IO rate is specified in io per second. Rules are per deivce. Following is the format. echo "<major>:<minor> <rate_io_per_second>" > /cgrp/blkio.write_iops_device echo "<major>:<minor> <rate_io_per_second>" > /cgrp/blkio.throttle.write_iops_device Note: If both BW and IOPS rules are specified for a device, then IO is subjectd to both the constraints. Loading Loading
CREDITS +1 −1 Original line number Diff line number Diff line Loading @@ -518,7 +518,7 @@ N: Zach Brown E: zab@zabbo.net D: maestro pci sound M: David Brownell N: David Brownell D: Kernel engineer, mentor, and friend. Maintained USB EHCI and D: gadget layers, SPI subsystem, GPIO subsystem, and more than a few D: device drivers. His encouragement also helped many engineers get Loading
Documentation/ABI/testing/sysfs-class-backlight-driver-adp8870 0 → 100644 +56 −0 Original line number Diff line number Diff line What: /sys/class/backlight/<backlight>/<ambient light zone>_max What: /sys/class/backlight/<backlight>/l1_daylight_max What: /sys/class/backlight/<backlight>/l2_bright_max What: /sys/class/backlight/<backlight>/l3_office_max What: /sys/class/backlight/<backlight>/l4_indoor_max What: /sys/class/backlight/<backlight>/l5_dark_max Date: Mai 2011 KernelVersion: 2.6.40 Contact: device-drivers-devel@blackfin.uclinux.org Description: Control the maximum brightness for <ambient light zone> on this <backlight>. Values are between 0 and 127. This file will also show the brightness level stored for this <ambient light zone>. What: /sys/class/backlight/<backlight>/<ambient light zone>_dim What: /sys/class/backlight/<backlight>/l2_bright_dim What: /sys/class/backlight/<backlight>/l3_office_dim What: /sys/class/backlight/<backlight>/l4_indoor_dim What: /sys/class/backlight/<backlight>/l5_dark_dim Date: Mai 2011 KernelVersion: 2.6.40 Contact: device-drivers-devel@blackfin.uclinux.org Description: Control the dim brightness for <ambient light zone> on this <backlight>. Values are between 0 and 127, typically set to 0. Full off when the backlight is disabled. This file will also show the dim brightness level stored for this <ambient light zone>. What: /sys/class/backlight/<backlight>/ambient_light_level Date: Mai 2011 KernelVersion: 2.6.40 Contact: device-drivers-devel@blackfin.uclinux.org Description: Get conversion value of the light sensor. This value is updated every 80 ms (when the light sensor is enabled). Returns integer between 0 (dark) and 8000 (max ambient brightness) What: /sys/class/backlight/<backlight>/ambient_light_zone Date: Mai 2011 KernelVersion: 2.6.40 Contact: device-drivers-devel@blackfin.uclinux.org Description: Get/Set current ambient light zone. Reading returns integer between 1..5 (1 = daylight, 2 = bright, ..., 5 = dark). Writing a value between 1..5 forces the backlight controller to enter the corresponding ambient light zone. Writing 0 returns to normal/automatic ambient light level operation. The ambient light sensing feature on these devices is an extension to the API documented in Documentation/ABI/stable/sysfs-class-backlight. It can be enabled by writing the value stored in /sys/class/backlight/<backlight>/max_brightness to /sys/class/backlight/<backlight>/brightness. No newline at end of file
Documentation/CodingStyle +2 −2 Original line number Diff line number Diff line Loading @@ -680,8 +680,8 @@ ones already enabled by DEBUG. Chapter 14: Allocating memory The kernel provides the following general purpose memory allocators: kmalloc(), kzalloc(), kcalloc(), and vmalloc(). Please refer to the API documentation for further information about them. kmalloc(), kzalloc(), kcalloc(), vmalloc(), and vzalloc(). Please refer to the API documentation for further information about them. The preferred form for passing a size of a struct is the following: Loading
Documentation/accounting/cgroupstats.txt +2 −2 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ information will not be available. To extract cgroup statistics a utility very similar to getdelays.c has been developed, the sample output of the utility is shown below ~/balbir/cgroupstats # ./getdelays -C "/cgroup/a" ~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup/a" sleeping 1, blocked 0, running 1, stopped 0, uninterruptible 0 ~/balbir/cgroupstats # ./getdelays -C "/cgroup" ~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup" sleeping 155, blocked 0, running 1, stopped 0, uninterruptible 2
Documentation/cgroups/blkio-controller.txt +22 −19 Original line number Diff line number Diff line Loading @@ -28,16 +28,19 @@ cgroups. Here is what you can do. - Enable group scheduling in CFQ CONFIG_CFQ_GROUP_IOSCHED=y - Compile and boot into kernel and mount IO controller (blkio). - Compile and boot into kernel and mount IO controller (blkio); see cgroups.txt, Why are cgroups needed?. mount -t cgroup -o blkio none /cgroup mount -t tmpfs cgroup_root /sys/fs/cgroup mkdir /sys/fs/cgroup/blkio mount -t cgroup -o blkio none /sys/fs/cgroup/blkio - Create two cgroups mkdir -p /cgroup/test1/ /cgroup/test2 mkdir -p /sys/fs/cgroup/blkio/test1/ /sys/fs/cgroup/blkio/test2 - Set weights of group test1 and test2 echo 1000 > /cgroup/test1/blkio.weight echo 500 > /cgroup/test2/blkio.weight echo 1000 > /sys/fs/cgroup/blkio/test1/blkio.weight echo 500 > /sys/fs/cgroup/blkio/test2/blkio.weight - Create two same size files (say 512MB each) on same disk (file1, file2) and launch two dd threads in different cgroup to read those files. Loading @@ -46,12 +49,12 @@ cgroups. Here is what you can do. echo 3 > /proc/sys/vm/drop_caches dd if=/mnt/sdb/zerofile1 of=/dev/null & echo $! > /cgroup/test1/tasks cat /cgroup/test1/tasks echo $! > /sys/fs/cgroup/blkio/test1/tasks cat /sys/fs/cgroup/blkio/test1/tasks dd if=/mnt/sdb/zerofile2 of=/dev/null & echo $! > /cgroup/test2/tasks cat /cgroup/test2/tasks echo $! > /sys/fs/cgroup/blkio/test2/tasks cat /sys/fs/cgroup/blkio/test2/tasks - At macro level, first dd should finish first. To get more precise data, keep on looking at (with the help of script), at blkio.disk_time and Loading @@ -68,13 +71,13 @@ Throttling/Upper Limit policy - Enable throttling in block layer CONFIG_BLK_DEV_THROTTLING=y - Mount blkio controller mount -t cgroup -o blkio none /cgroup/blkio - Mount blkio controller (see cgroups.txt, Why are cgroups needed?) mount -t cgroup -o blkio none /sys/fs/cgroup/blkio - Specify a bandwidth rate on particular device for root group. The format for policy is "<major>:<minor> <byes_per_second>". echo "8:16 1048576" > /cgroup/blkio/blkio.read_bps_device echo "8:16 1048576" > /sys/fs/cgroup/blkio/blkio.throttle.read_bps_device Above will put a limit of 1MB/second on reads happening for root group on device having major/minor number 8:16. Loading @@ -87,7 +90,7 @@ Throttling/Upper Limit policy 1024+0 records out 4194304 bytes (4.2 MB) copied, 4.0001 s, 1.0 MB/s Limits for writes can be put using blkio.write_bps_device file. Limits for writes can be put using blkio.throttle.write_bps_device file. Hierarchical Cgroups ==================== Loading @@ -108,7 +111,7 @@ Hierarchical Cgroups CFQ and throttling will practically treat all groups at same level. pivot / | \ \ / / \ \ root test1 test2 test3 Down the line we can implement hierarchical accounting/control support Loading Loading @@ -149,7 +152,7 @@ Proportional weight policy files Following is the format. #echo dev_maj:dev_minor weight > /path/to/cgroup/blkio.weight_device # echo dev_maj:dev_minor weight > blkio.weight_device Configure weight=300 on /dev/sdb (8:16) in this cgroup # echo 8:16 300 > blkio.weight_device # cat blkio.weight_device Loading Loading @@ -283,28 +286,28 @@ Throttling/Upper limit policy files specified in bytes per second. Rules are per deivce. Following is the format. echo "<major>:<minor> <rate_bytes_per_second>" > /cgrp/blkio.read_bps_device echo "<major>:<minor> <rate_bytes_per_second>" > /cgrp/blkio.throttle.read_bps_device - blkio.throttle.write_bps_device - Specifies upper limit on WRITE rate to the device. IO rate is specified in bytes per second. Rules are per deivce. Following is the format. echo "<major>:<minor> <rate_bytes_per_second>" > /cgrp/blkio.write_bps_device echo "<major>:<minor> <rate_bytes_per_second>" > /cgrp/blkio.throttle.write_bps_device - blkio.throttle.read_iops_device - Specifies upper limit on READ rate from the device. IO rate is specified in IO per second. Rules are per deivce. Following is the format. echo "<major>:<minor> <rate_io_per_second>" > /cgrp/blkio.read_iops_device echo "<major>:<minor> <rate_io_per_second>" > /cgrp/blkio.throttle.read_iops_device - blkio.throttle.write_iops_device - Specifies upper limit on WRITE rate to the device. IO rate is specified in io per second. Rules are per deivce. Following is the format. echo "<major>:<minor> <rate_io_per_second>" > /cgrp/blkio.write_iops_device echo "<major>:<minor> <rate_io_per_second>" > /cgrp/blkio.throttle.write_iops_device Note: If both BW and IOPS rules are specified for a device, then IO is subjectd to both the constraints. Loading