Merge branch 'for-5.8' into for-linus
This commit is contained in:
+21
-4
@@ -86,6 +86,8 @@ ForEachMacros:
|
||||
- 'bio_for_each_segment_all'
|
||||
- 'bio_list_for_each'
|
||||
- 'bip_for_each_vec'
|
||||
- 'bitmap_for_each_clear_region'
|
||||
- 'bitmap_for_each_set_region'
|
||||
- 'blkg_for_each_descendant_post'
|
||||
- 'blkg_for_each_descendant_pre'
|
||||
- 'blk_queue_for_each_rl'
|
||||
@@ -115,6 +117,7 @@ ForEachMacros:
|
||||
- 'drm_client_for_each_connector_iter'
|
||||
- 'drm_client_for_each_modeset'
|
||||
- 'drm_connector_for_each_possible_encoder'
|
||||
- 'drm_for_each_bridge_in_chain'
|
||||
- 'drm_for_each_connector_iter'
|
||||
- 'drm_for_each_crtc'
|
||||
- 'drm_for_each_encoder'
|
||||
@@ -136,9 +139,10 @@ ForEachMacros:
|
||||
- 'for_each_bio'
|
||||
- 'for_each_board_func_rsrc'
|
||||
- 'for_each_bvec'
|
||||
- 'for_each_card_auxs'
|
||||
- 'for_each_card_auxs_safe'
|
||||
- 'for_each_card_components'
|
||||
- 'for_each_card_links'
|
||||
- 'for_each_card_links_safe'
|
||||
- 'for_each_card_pre_auxs'
|
||||
- 'for_each_card_prelinks'
|
||||
- 'for_each_card_rtds'
|
||||
- 'for_each_card_rtds_safe'
|
||||
@@ -166,6 +170,7 @@ ForEachMacros:
|
||||
- 'for_each_dpcm_fe'
|
||||
- 'for_each_drhd_unit'
|
||||
- 'for_each_dss_dev'
|
||||
- 'for_each_efi_handle'
|
||||
- 'for_each_efi_memory_desc'
|
||||
- 'for_each_efi_memory_desc_in_map'
|
||||
- 'for_each_element'
|
||||
@@ -190,6 +195,7 @@ ForEachMacros:
|
||||
- 'for_each_lru'
|
||||
- 'for_each_matching_node'
|
||||
- 'for_each_matching_node_and_match'
|
||||
- 'for_each_member'
|
||||
- 'for_each_memblock'
|
||||
- 'for_each_memblock_type'
|
||||
- 'for_each_memcg_cache_index'
|
||||
@@ -200,9 +206,11 @@ ForEachMacros:
|
||||
- 'for_each_msi_entry'
|
||||
- 'for_each_msi_entry_safe'
|
||||
- 'for_each_net'
|
||||
- 'for_each_net_continue_reverse'
|
||||
- 'for_each_netdev'
|
||||
- 'for_each_netdev_continue'
|
||||
- 'for_each_netdev_continue_rcu'
|
||||
- 'for_each_netdev_continue_reverse'
|
||||
- 'for_each_netdev_feature'
|
||||
- 'for_each_netdev_in_bond_rcu'
|
||||
- 'for_each_netdev_rcu'
|
||||
@@ -254,10 +262,10 @@ ForEachMacros:
|
||||
- 'for_each_reserved_mem_region'
|
||||
- 'for_each_rtd_codec_dai'
|
||||
- 'for_each_rtd_codec_dai_rollback'
|
||||
- 'for_each_rtdcom'
|
||||
- 'for_each_rtdcom_safe'
|
||||
- 'for_each_rtd_components'
|
||||
- 'for_each_set_bit'
|
||||
- 'for_each_set_bit_from'
|
||||
- 'for_each_set_clump8'
|
||||
- 'for_each_sg'
|
||||
- 'for_each_sg_dma_page'
|
||||
- 'for_each_sg_page'
|
||||
@@ -267,6 +275,7 @@ ForEachMacros:
|
||||
- 'for_each_subelement_id'
|
||||
- '__for_each_thread'
|
||||
- 'for_each_thread'
|
||||
- 'for_each_wakeup_source'
|
||||
- 'for_each_zone'
|
||||
- 'for_each_zone_zonelist'
|
||||
- 'for_each_zone_zonelist_nodemask'
|
||||
@@ -330,6 +339,7 @@ ForEachMacros:
|
||||
- 'list_for_each'
|
||||
- 'list_for_each_codec'
|
||||
- 'list_for_each_codec_safe'
|
||||
- 'list_for_each_continue'
|
||||
- 'list_for_each_entry'
|
||||
- 'list_for_each_entry_continue'
|
||||
- 'list_for_each_entry_continue_rcu'
|
||||
@@ -351,6 +361,7 @@ ForEachMacros:
|
||||
- 'llist_for_each_entry'
|
||||
- 'llist_for_each_entry_safe'
|
||||
- 'llist_for_each_safe'
|
||||
- 'mci_for_each_dimm'
|
||||
- 'media_device_for_each_entity'
|
||||
- 'media_device_for_each_intf'
|
||||
- 'media_device_for_each_link'
|
||||
@@ -444,10 +455,16 @@ ForEachMacros:
|
||||
- 'virtio_device_for_each_vq'
|
||||
- 'xa_for_each'
|
||||
- 'xa_for_each_marked'
|
||||
- 'xa_for_each_range'
|
||||
- 'xa_for_each_start'
|
||||
- 'xas_for_each'
|
||||
- 'xas_for_each_conflict'
|
||||
- 'xas_for_each_marked'
|
||||
- 'xbc_array_for_each_value'
|
||||
- 'xbc_for_each_key_value'
|
||||
- 'xbc_node_for_each_array_value'
|
||||
- 'xbc_node_for_each_child'
|
||||
- 'xbc_node_for_each_key_value'
|
||||
- 'zorro_for_each_dev'
|
||||
|
||||
#IncludeBlocks: Preserve # Unknown to clang-format-5.0
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
#
|
||||
# NOTE! Don't add files that are generated in specific
|
||||
# subdirectories here. Add them in the ".gitignore" file
|
||||
|
||||
@@ -18,6 +18,7 @@ Aleksey Gorelov <aleksey_gorelov@phoenix.com>
|
||||
Aleksandar Markovic <aleksandar.markovic@mips.com> <aleksandar.markovic@imgtec.com>
|
||||
Alex Shi <alex.shi@linux.alibaba.com> <alex.shi@intel.com>
|
||||
Alex Shi <alex.shi@linux.alibaba.com> <alex.shi@linaro.org>
|
||||
Alexandre Belloni <alexandre.belloni@bootlin.com> <alexandre.belloni@free-electrons.com>
|
||||
Alexei Starovoitov <ast@kernel.org> <ast@plumgrid.com>
|
||||
Alexei Starovoitov <ast@kernel.org> <alexei.starovoitov@gmail.com>
|
||||
Alexei Starovoitov <ast@kernel.org> <ast@fb.com>
|
||||
@@ -27,6 +28,8 @@ Andi Shyti <andi@etezian.org> <andi.shyti@samsung.com>
|
||||
Andreas Herrmann <aherrman@de.ibm.com>
|
||||
Andrey Ryabinin <ryabinin.a.a@gmail.com> <a.ryabinin@samsung.com>
|
||||
Andrew Morton <akpm@linux-foundation.org>
|
||||
Andrew Murray <amurray@thegoodpenguin.co.uk> <andrew.murray@arm.com>
|
||||
Andrew Murray <amurray@thegoodpenguin.co.uk> <amurray@embedded-bits.co.uk>
|
||||
Andrew Vasquez <andrew.vasquez@qlogic.com>
|
||||
Andy Adamson <andros@citi.umich.edu>
|
||||
Antoine Tenart <antoine.tenart@free-electrons.com>
|
||||
@@ -207,6 +210,7 @@ Oleksij Rempel <linux@rempel-privat.de> <external.Oleksij.Rempel@de.bosch.com>
|
||||
Oleksij Rempel <linux@rempel-privat.de> <fixed-term.Oleksij.Rempel@de.bosch.com>
|
||||
Oleksij Rempel <linux@rempel-privat.de> <o.rempel@pengutronix.de>
|
||||
Oleksij Rempel <linux@rempel-privat.de> <ore@pengutronix.de>
|
||||
Pali Rohár <pali@kernel.org> <pali.rohar@gmail.com>
|
||||
Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
|
||||
Patrick Mochel <mochel@digitalimplant.org>
|
||||
Paul Burton <paulburton@kernel.org> <paul.burton@imgtec.com>
|
||||
@@ -222,6 +226,7 @@ Pratyush Anand <pratyush.anand@gmail.com> <pratyush.anand@st.com>
|
||||
Praveen BP <praveenbp@ti.com>
|
||||
Punit Agrawal <punitagrawal@gmail.com> <punit.agrawal@arm.com>
|
||||
Qais Yousef <qsyousef@gmail.com> <qais.yousef@imgtec.com>
|
||||
Quentin Monnet <quentin@isovalent.com> <quentin.monnet@netronome.com>
|
||||
Quentin Perret <qperret@qperret.net> <quentin.perret@arm.com>
|
||||
Rafael J. Wysocki <rjw@rjwysocki.net> <rjw@sisk.pl>
|
||||
Rajesh Shah <rajesh.shah@intel.com>
|
||||
@@ -240,9 +245,11 @@ Santosh Shilimkar <ssantosh@kernel.org>
|
||||
Santosh Shilimkar <santosh.shilimkar@oracle.org>
|
||||
Sascha Hauer <s.hauer@pengutronix.de>
|
||||
S.Çağlar Onur <caglar@pardus.org.tr>
|
||||
Sakari Ailus <sakari.ailus@linux.intel.com> <sakari.ailus@iki.fi>
|
||||
Sean Nyekjaer <sean@geanix.com> <sean.nyekjaer@prevas.dk>
|
||||
Sebastian Reichel <sre@kernel.org> <sre@debian.org>
|
||||
Sebastian Reichel <sre@kernel.org> <sebastian.reichel@collabora.co.uk>
|
||||
Sedat Dilek <sedat.dilek@gmail.com> <sedat.dilek@credativ.de>
|
||||
Shiraz Hashim <shiraz.linux.kernel@gmail.com> <shiraz.hashim@st.com>
|
||||
Shuah Khan <shuah@kernel.org> <shuahkhan@gmail.com>
|
||||
Shuah Khan <shuah@kernel.org> <shuah.khan@hp.com>
|
||||
@@ -259,6 +266,7 @@ Sumit Semwal <sumit.semwal@ti.com>
|
||||
Tejun Heo <htejun@gmail.com>
|
||||
Thomas Graf <tgraf@suug.ch>
|
||||
Thomas Pedersen <twp@codeaurora.org>
|
||||
Tiezhu Yang <yangtiezhu@loongson.cn> <kernelpatch@126.com>
|
||||
Todor Tomov <todor.too@gmail.com> <todor.tomov@linaro.org>
|
||||
Tony Luck <tony.luck@intel.com>
|
||||
TripleX Chung <xxx.phy@gmail.com> <zhongyu@18mail.cn>
|
||||
|
||||
@@ -16,3 +16,5 @@ In addition, other licenses may also apply. Please see:
|
||||
Documentation/process/license-rules.rst
|
||||
|
||||
for more details.
|
||||
|
||||
All contributions to the Linux Kernel are subject to this COPYING file.
|
||||
|
||||
@@ -567,6 +567,11 @@ D: Original author of Amiga FFS filesystem
|
||||
S: Orlando, Florida
|
||||
S: USA
|
||||
|
||||
N: Paul Burton
|
||||
E: paulburton@kernel.org
|
||||
W: https://pburton.com
|
||||
D: MIPS maintainer 2018-2020
|
||||
|
||||
N: Lennert Buytenhek
|
||||
E: kernel@wantstofly.org
|
||||
D: Original (2.4) rewrite of the ethernet bridging code
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
output
|
||||
*.pyc
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
This ABI is renamed and moved to a new location /sys/kernel/fadump/enabled.
|
||||
|
||||
What: /sys/kernel/fadump_enabled
|
||||
Date: Feb 2012
|
||||
Contact: linuxppc-dev@lists.ozlabs.org
|
||||
Description: read only
|
||||
Primarily used to identify whether the FADump is enabled in
|
||||
the kernel or not.
|
||||
User: Kdump service
|
||||
@@ -0,0 +1,10 @@
|
||||
This ABI is renamed and moved to a new location /sys/kernel/fadump/registered.¬
|
||||
|
||||
What: /sys/kernel/fadump_registered
|
||||
Date: Feb 2012
|
||||
Contact: linuxppc-dev@lists.ozlabs.org
|
||||
Description: read/write
|
||||
Helps to control the dump collect feature from userspace.
|
||||
Setting 1 to this file enables the system to collect the
|
||||
dump and 0 to disable it.
|
||||
User: Kdump service
|
||||
@@ -0,0 +1,10 @@
|
||||
This ABI is renamed and moved to a new location /sys/kernel/fadump/release_mem.¬
|
||||
|
||||
What: /sys/kernel/fadump_release_mem
|
||||
Date: Feb 2012
|
||||
Contact: linuxppc-dev@lists.ozlabs.org
|
||||
Description: write only
|
||||
This is a special sysfs file and only available when
|
||||
the system is booted to capture the vmcore using FADump.
|
||||
It is used to release the memory reserved by FADump to
|
||||
save the crash dump.
|
||||
@@ -0,0 +1,23 @@
|
||||
What: /sys/fs/selinux/checkreqprot
|
||||
Date: April 2005 (predates git)
|
||||
KernelVersion: 2.6.12-rc2 (predates git)
|
||||
Contact: selinux@vger.kernel.org
|
||||
Description:
|
||||
|
||||
The selinuxfs "checkreqprot" node allows SELinux to be configured
|
||||
to check the protection requested by userspace for mmap/mprotect
|
||||
calls instead of the actual protection applied by the kernel.
|
||||
This was a compatibility mechanism for legacy userspace and
|
||||
for the READ_IMPLIES_EXEC personality flag. However, if set to
|
||||
1, it weakens security by allowing mappings to be made executable
|
||||
without authorization by policy. The default value of checkreqprot
|
||||
at boot was changed starting in Linux v4.4 to 0 (i.e. check the
|
||||
actual protection), and Android and Linux distributions have been
|
||||
explicitly writing a "0" to /sys/fs/selinux/checkreqprot during
|
||||
initialization for some time. Support for setting checkreqprot to 1
|
||||
will be removed in a future kernel release, at which point the kernel
|
||||
will always cease using checkreqprot internally and will always
|
||||
check the actual protections being applied upon mmap/mprotect calls.
|
||||
The checkreqprot selinuxfs node will remain for backward compatibility
|
||||
but will discard writes of the "0" value and will reject writes of the
|
||||
"1" value when this mechanism is removed.
|
||||
@@ -0,0 +1,9 @@
|
||||
This ABI is moved to /sys/firmware/opal/mpipl/release_core.
|
||||
|
||||
What: /sys/kernel/fadump_release_opalcore
|
||||
Date: Sep 2019
|
||||
Contact: linuxppc-dev@lists.ozlabs.org
|
||||
Description: write only
|
||||
The sysfs file is available when the system is booted to
|
||||
collect the dump on OPAL based machine. It used to release
|
||||
the memory used to collect the opalcore.
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
What: /sys/kernel/uids/<uid>/cpu_shares
|
||||
Date: December 2007
|
||||
Date: December 2007, finally removed in kernel v2.6.34-rc1
|
||||
Contact: Dhaval Giani <dhaval@linux.vnet.ibm.com>
|
||||
Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
|
||||
Description:
|
||||
@@ -0,0 +1,196 @@
|
||||
What: /sys/kernel/config/most_<component>
|
||||
Date: March 8, 2019
|
||||
KernelVersion: 5.2
|
||||
Description: Interface is used to configure and connect device channels
|
||||
to component drivers.
|
||||
|
||||
Attributes are visible only when configfs is mounted. To mount
|
||||
configfs in /sys/kernel/config directory use:
|
||||
# mount -t configfs none /sys/kernel/config/
|
||||
|
||||
|
||||
What: /sys/kernel/config/most_cdev/<link>
|
||||
Date: March 8, 2019
|
||||
KernelVersion: 5.2
|
||||
Description:
|
||||
The attributes:
|
||||
|
||||
buffer_size configure the buffer size for this channel
|
||||
|
||||
subbuffer_size configure the sub-buffer size for this channel
|
||||
(needed for synchronous and isochrnous data)
|
||||
|
||||
|
||||
num_buffers configure number of buffers used for this
|
||||
channel
|
||||
|
||||
datatype configure type of data that will travel over
|
||||
this channel
|
||||
|
||||
direction configure whether this link will be an input
|
||||
or output
|
||||
|
||||
dbr_size configure DBR data buffer size (this is used
|
||||
for MediaLB communication only)
|
||||
|
||||
packets_per_xact
|
||||
configure the number of packets that will be
|
||||
collected from the network before being
|
||||
transmitted via USB (this is used for USB
|
||||
communication only)
|
||||
|
||||
device name of the device the link is to be attached to
|
||||
|
||||
channel name of the channel the link is to be attached to
|
||||
|
||||
comp_params pass parameters needed by some components
|
||||
|
||||
create_link write '1' to this attribute to trigger the
|
||||
creation of the link. In case of speculative
|
||||
configuration, the creation is post-poned until
|
||||
a physical device is being attached to the bus.
|
||||
|
||||
destroy_link write '1' to this attribute to destroy an
|
||||
active link
|
||||
|
||||
What: /sys/kernel/config/most_video/<link>
|
||||
Date: March 8, 2019
|
||||
KernelVersion: 5.2
|
||||
Description:
|
||||
The attributes:
|
||||
|
||||
buffer_size configure the buffer size for this channel
|
||||
|
||||
subbuffer_size configure the sub-buffer size for this channel
|
||||
(needed for synchronous and isochrnous data)
|
||||
|
||||
|
||||
num_buffers configure number of buffers used for this
|
||||
channel
|
||||
|
||||
datatype configure type of data that will travel over
|
||||
this channel
|
||||
|
||||
direction configure whether this link will be an input
|
||||
or output
|
||||
|
||||
dbr_size configure DBR data buffer size (this is used
|
||||
for MediaLB communication only)
|
||||
|
||||
packets_per_xact
|
||||
configure the number of packets that will be
|
||||
collected from the network before being
|
||||
transmitted via USB (this is used for USB
|
||||
communication only)
|
||||
|
||||
device name of the device the link is to be attached to
|
||||
|
||||
channel name of the channel the link is to be attached to
|
||||
|
||||
comp_params pass parameters needed by some components
|
||||
|
||||
create_link write '1' to this attribute to trigger the
|
||||
creation of the link. In case of speculative
|
||||
configuration, the creation is post-poned until
|
||||
a physical device is being attached to the bus.
|
||||
|
||||
destroy_link write '1' to this attribute to destroy an
|
||||
active link
|
||||
|
||||
What: /sys/kernel/config/most_net/<link>
|
||||
Date: March 8, 2019
|
||||
KernelVersion: 5.2
|
||||
Description:
|
||||
The attributes:
|
||||
|
||||
buffer_size configure the buffer size for this channel
|
||||
|
||||
subbuffer_size configure the sub-buffer size for this channel
|
||||
(needed for synchronous and isochrnous data)
|
||||
|
||||
|
||||
num_buffers configure number of buffers used for this
|
||||
channel
|
||||
|
||||
datatype configure type of data that will travel over
|
||||
this channel
|
||||
|
||||
direction configure whether this link will be an input
|
||||
or output
|
||||
|
||||
dbr_size configure DBR data buffer size (this is used
|
||||
for MediaLB communication only)
|
||||
|
||||
packets_per_xact
|
||||
configure the number of packets that will be
|
||||
collected from the network before being
|
||||
transmitted via USB (this is used for USB
|
||||
communication only)
|
||||
|
||||
device name of the device the link is to be attached to
|
||||
|
||||
channel name of the channel the link is to be attached to
|
||||
|
||||
comp_params pass parameters needed by some components
|
||||
|
||||
create_link write '1' to this attribute to trigger the
|
||||
creation of the link. In case of speculative
|
||||
configuration, the creation is post-poned until
|
||||
a physical device is being attached to the bus.
|
||||
|
||||
destroy_link write '1' to this attribute to destroy an
|
||||
active link
|
||||
|
||||
What: /sys/kernel/config/most_sound/<card>
|
||||
Date: March 8, 2019
|
||||
KernelVersion: 5.2
|
||||
Description:
|
||||
The attributes:
|
||||
|
||||
create_card write '1' to this attribute to trigger the
|
||||
registration of the sound card with the ALSA
|
||||
subsystem.
|
||||
|
||||
What: /sys/kernel/config/most_sound/<card>/<link>
|
||||
Date: March 8, 2019
|
||||
KernelVersion: 5.2
|
||||
Description:
|
||||
The attributes:
|
||||
|
||||
buffer_size configure the buffer size for this channel
|
||||
|
||||
subbuffer_size configure the sub-buffer size for this channel
|
||||
(needed for synchronous and isochrnous data)
|
||||
|
||||
|
||||
num_buffers configure number of buffers used for this
|
||||
channel
|
||||
|
||||
datatype configure type of data that will travel over
|
||||
this channel
|
||||
|
||||
direction configure whether this link will be an input
|
||||
or output
|
||||
|
||||
dbr_size configure DBR data buffer size (this is used
|
||||
for MediaLB communication only)
|
||||
|
||||
packets_per_xact
|
||||
configure the number of packets that will be
|
||||
collected from the network before being
|
||||
transmitted via USB (this is used for USB
|
||||
communication only)
|
||||
|
||||
device name of the device the link is to be attached to
|
||||
|
||||
channel name of the channel the link is to be attached to
|
||||
|
||||
comp_params pass parameters needed by some components
|
||||
|
||||
create_link write '1' to this attribute to trigger the
|
||||
creation of the link. In case of speculative
|
||||
configuration, the creation is post-poned until
|
||||
a physical device is being attached to the bus.
|
||||
|
||||
destroy_link write '1' to this attribute to destroy an
|
||||
active link
|
||||
@@ -43,6 +43,20 @@ Description: Allows the root user to read or write directly through the
|
||||
If the IOMMU is disabled, it also allows the root user to read
|
||||
or write from the host a device VA of a host mapped memory
|
||||
|
||||
What: /sys/kernel/debug/habanalabs/hl<n>/data64
|
||||
Date: Jan 2020
|
||||
KernelVersion: 5.6
|
||||
Contact: oded.gabbay@gmail.com
|
||||
Description: Allows the root user to read or write 64 bit data directly
|
||||
through the device's PCI bar. Writing to this file generates a
|
||||
write transaction while reading from the file generates a read
|
||||
transaction. This custom interface is needed (instead of using
|
||||
the generic Linux user-space PCI mapping) because the DDR bar
|
||||
is very small compared to the DDR memory and only the driver can
|
||||
move the bar before and after the transaction.
|
||||
If the IOMMU is disabled, it also allows the root user to read
|
||||
or write from the host a device VA of a host mapped memory
|
||||
|
||||
What: /sys/kernel/debug/habanalabs/hl<n>/device
|
||||
Date: Jan 2019
|
||||
KernelVersion: 5.1
|
||||
|
||||
@@ -56,6 +56,11 @@ Description: The /dev/kmsg character device node provides userspace access
|
||||
seek after the last record available at the time
|
||||
the last SYSLOG_ACTION_CLEAR was issued.
|
||||
|
||||
Due to the record nature of this interface with a "read all"
|
||||
behavior and the specific positions each seek operation sets,
|
||||
SEEK_CUR is not supported, returning -ESPIPE (invalid seek) to
|
||||
errno whenever requested.
|
||||
|
||||
The output format consists of a prefix carrying the syslog
|
||||
prefix including priority and facility, the 64 bit message
|
||||
sequence number and the monotonic timestamp in microseconds,
|
||||
|
||||
@@ -33,6 +33,14 @@ Description:
|
||||
Requires a separate RTC_PIE_ON call to enable the periodic
|
||||
interrupts.
|
||||
|
||||
* RTC_VL_READ: Read the voltage inputs status of the RTC when
|
||||
supported. The value is a bit field of RTC_VL_*, giving the
|
||||
status of the main and backup voltages.
|
||||
|
||||
* RTC_VL_CLEAR: Clear the voltage status of the RTC. Some RTCs
|
||||
need user interaction when the backup power provider is
|
||||
replaced or charged to be able to clear the status.
|
||||
|
||||
The ioctl() calls supported by the older /dev/rtc interface are
|
||||
also supported by the newer RTC class framework. However,
|
||||
because the chips and systems are not standardized, some PC/AT
|
||||
|
||||
@@ -0,0 +1,241 @@
|
||||
What: /sys/bus/coresight/devices/<cti-name>/enable
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (RW) Enable/Disable the CTI hardware.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/powered
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (R) Indicate if the CTI hardware is powered.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/ctmid
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (R) Display the associated CTM ID
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/nr_trigger_cons
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (R) Number of devices connected to triggers on this CTI
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/triggers<N>/name
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (R) Name of connected device <N>
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/triggers<N>/in_signals
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (R) Input trigger signals from connected device <N>
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/triggers<N>/in_types
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (R) Functional types for the input trigger signals
|
||||
from connected device <N>
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/triggers<N>/out_signals
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (R) Output trigger signals to connected device <N>
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/triggers<N>/out_types
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (R) Functional types for the output trigger signals
|
||||
to connected device <N>
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/regs/inout_sel
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (RW) Select the index for inen and outen registers.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/regs/inen
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (RW) Read or write the CTIINEN register selected by inout_sel.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/regs/outen
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (RW) Read or write the CTIOUTEN register selected by inout_sel.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/regs/gate
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (RW) Read or write CTIGATE register.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/regs/asicctl
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (RW) Read or write ASICCTL register.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/regs/intack
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (W) Write the INTACK register.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/regs/appset
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (RW) Set CTIAPPSET register to activate channel. Read back to
|
||||
determine current value of register.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/regs/appclear
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (W) Write APPCLEAR register to deactivate channel.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/regs/apppulse
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (W) Write APPPULSE to pulse a channel active for one clock
|
||||
cycle.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/regs/chinstatus
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (R) Read current status of channel inputs.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/regs/choutstatus
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (R) read current status of channel outputs.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/regs/triginstatus
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (R) read current status of input trigger signals
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/regs/trigoutstatus
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (R) read current status of output trigger signals.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/channels/trigin_attach
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (W) Attach a CTI input trigger to a CTM channel.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/channels/trigin_detach
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (W) Detach a CTI input trigger from a CTM channel.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/channels/trigout_attach
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (W) Attach a CTI output trigger to a CTM channel.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/channels/trigout_detach
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (W) Detach a CTI output trigger from a CTM channel.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/channels/chan_gate_enable
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (RW) Enable CTIGATE for single channel (W) or list enabled
|
||||
channels through the gate (R).
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/channels/chan_gate_disable
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (W) Disable CTIGATE for single channel.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/channels/chan_set
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (W) Activate a single channel.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/channels/chan_clear
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (W) Deactivate a single channel.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/channels/chan_pulse
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (W) Pulse a single channel - activate for a single clock cycle.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/channels/trigout_filtered
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (R) List of output triggers filtered across all connections.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/channels/trig_filter_enable
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (RW) Enable or disable trigger output signal filtering.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/channels/chan_inuse
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (R) show channels with at least one attached trigger signal.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/channels/chan_free
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (R) show channels with no attached trigger signals.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/channels/chan_xtrigs_sel
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (RW) Write channel number to select a channel to view, read to
|
||||
see selected channel number.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/channels/chan_xtrigs_in
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (R) Read to see input triggers connected to selected view
|
||||
channel.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/channels/chan_xtrigs_out
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (R) Read to see output triggers connected to selected view
|
||||
channel.
|
||||
|
||||
What: /sys/bus/coresight/devices/<cti-name>/channels/chan_xtrigs_reset
|
||||
Date: March 2020
|
||||
KernelVersion 5.7
|
||||
Contact: Mike Leach or Mathieu Poirier
|
||||
Description: (W) Clear all channel / trigger programming.
|
||||
@@ -1,3 +1,28 @@
|
||||
What: /sys/bus/counter/devices/counterX/signalY/cable_fault
|
||||
KernelVersion: 5.7
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Read-only attribute that indicates whether a differential
|
||||
encoder cable fault (not connected or loose wires) is detected
|
||||
for the respective channel of Signal Y. Valid attribute values
|
||||
are boolean. Detection must first be enabled via the
|
||||
corresponding cable_fault_enable attribute.
|
||||
|
||||
What: /sys/bus/counter/devices/counterX/signalY/cable_fault_enable
|
||||
KernelVersion: 5.7
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Whether detection of differential encoder cable faults for the
|
||||
respective channel of Signal Y is enabled. Valid attribute
|
||||
values are boolean.
|
||||
|
||||
What: /sys/bus/counter/devices/counterX/signalY/filter_clock_prescaler
|
||||
KernelVersion: 5.7
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Filter clock factor for input Signal Y. This prescaler value
|
||||
affects the inputs of both quadrature pair signals.
|
||||
|
||||
What: /sys/bus/counter/devices/counterX/signalY/index_polarity
|
||||
KernelVersion: 5.2
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
|
||||
@@ -2,17 +2,22 @@ What: /sys/bus/iio/devices/iio:deviceX/ac_excitation_en
|
||||
KernelVersion:
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Reading gives the state of AC excitation.
|
||||
Writing '1' enables AC excitation.
|
||||
This attribute, if available, is used to enable the AC
|
||||
excitation mode found on some converters. In ac excitation mode,
|
||||
the polarity of the excitation voltage is reversed on
|
||||
alternate cycles, to eliminate DC errors.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/bridge_switch_en
|
||||
KernelVersion:
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
This bridge switch is used to disconnect it when there is a
|
||||
need to minimize the system current consumption.
|
||||
Reading gives the state of the bridge switch.
|
||||
Writing '1' enables the bridge switch.
|
||||
This attribute, if available, is used to close or open the
|
||||
bridge power down switch found on some converters.
|
||||
In bridge applications, such as strain gauges and load cells,
|
||||
the bridge itself consumes the majority of the current in the
|
||||
system. To minimize the current consumption of the system,
|
||||
the bridge can be disconnected (when it is not being used
|
||||
using the bridge_switch_en attribute.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_voltagex_sys_calibration
|
||||
KernelVersion:
|
||||
@@ -21,6 +26,13 @@ Description:
|
||||
Initiates the system calibration procedure. This is done on a
|
||||
single channel at a time. Write '1' to start the calibration.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_voltage2-voltage2_shorted_raw
|
||||
KernelVersion:
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Measure voltage from AIN2 pin connected to AIN(+)
|
||||
and AIN(-) shorted.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_voltagex_sys_calibration_mode_available
|
||||
KernelVersion:
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
|
||||
@@ -40,3 +40,11 @@ Description: (RW) Trigger window switch for the MSC's buffer, in
|
||||
triggering a window switch for the buffer. Returns an error in any
|
||||
other operating mode or attempts to write something other than "1".
|
||||
|
||||
What: /sys/bus/intel_th/devices/<intel_th_id>-msc<msc-id>/stop_on_full
|
||||
Date: March 2020
|
||||
KernelVersion: 5.7
|
||||
Contact: Alexander Shishkin <alexander.shishkin@linux.intel.com>
|
||||
Description: (RW) Configure whether trace stops when the last available window
|
||||
becomes full (1/y/Y) or wraps around and continues until the next
|
||||
window becomes available again (0/n/N).
|
||||
|
||||
|
||||
@@ -0,0 +1,295 @@
|
||||
What: /sys/bus/most/devices/.../description
|
||||
Date: March 2017
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
Provides information about the interface type and the physical
|
||||
location of the device. Hardware attached via USB, for instance,
|
||||
might return <1-1.1:1.0>
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../interface
|
||||
Date: March 2017
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
Indicates the type of peripheral interface the device uses.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../dci
|
||||
Date: June 2016
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
If the network interface controller is attached via USB, a dci
|
||||
directory is created that allows applications to read and
|
||||
write the controller's DCI registers.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../dci/arb_address
|
||||
Date: June 2016
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
This is used to set an arbitrary DCI register address an
|
||||
application wants to read from or write to.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../dci/arb_value
|
||||
Date: June 2016
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
This is used to read and write the DCI register whose address
|
||||
is stored in arb_address.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../dci/mep_eui48_hi
|
||||
Date: June 2016
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
This is used to check and configure the MAC address.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../dci/mep_eui48_lo
|
||||
Date: June 2016
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
This is used to check and configure the MAC address.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../dci/mep_eui48_mi
|
||||
Date: June 2016
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
This is used to check and configure the MAC address.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../dci/mep_filter
|
||||
Date: June 2016
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
This is used to check and configure the MEP filter address.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../dci/mep_hash0
|
||||
Date: June 2016
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
This is used to check and configure the MEP hash table.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../dci/mep_hash1
|
||||
Date: June 2016
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
This is used to check and configure the MEP hash table.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../dci/mep_hash2
|
||||
Date: June 2016
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
This is used to check and configure the MEP hash table.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../dci/mep_hash3
|
||||
Date: June 2016
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
This is used to check and configure the MEP hash table.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../dci/ni_state
|
||||
Date: June 2016
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
Indicates the current network interface state.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../dci/node_address
|
||||
Date: June 2016
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
Indicates the current node address.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../dci/node_position
|
||||
Date: June 2016
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
Indicates the current node position.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../dci/packet_bandwidth
|
||||
Date: June 2016
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
Indicates the configured packet bandwidth.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../dci/sync_ep
|
||||
Date: June 2016
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
Triggers the controller's synchronization process for a certain
|
||||
endpoint.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../<channel>/
|
||||
Date: March 2017
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
For every channel of the device a directory is created, whose
|
||||
name is dictated by the HDM. This enables an application to
|
||||
collect information about the channel's capabilities and
|
||||
configure it.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../<channel>/available_datatypes
|
||||
Date: March 2017
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
Indicates the data types the current channel can transport.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../<channel>/available_directions
|
||||
Date: March 2017
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
Indicates the directions the current channel is capable of.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../<channel>/number_of_packet_buffers
|
||||
Date: March 2017
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
Indicates the number of packet buffers the current channel can
|
||||
handle.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../<channel>/number_of_stream_buffers
|
||||
Date: March 2017
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
Indicates the number of streaming buffers the current channel can
|
||||
handle.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../<channel>/size_of_packet_buffer
|
||||
Date: March 2017
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
Indicates the size of a packet buffer the current channel can
|
||||
handle.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../<channel>/size_of_stream_buffer
|
||||
Date: March 2017
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
Indicates the size of a streaming buffer the current channel can
|
||||
handle.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../<channel>/set_number_of_buffers
|
||||
Date: March 2017
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
This is to configure the number of buffers of the current channel.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../<channel>/set_buffer_size
|
||||
Date: March 2017
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
This is to configure the size of a buffer of the current channel.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../<channel>/set_direction
|
||||
Date: March 2017
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
This is to configure the direction of the current channel.
|
||||
The following strings will be accepted:
|
||||
'dir_tx',
|
||||
'dir_rx'
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../<channel>/set_datatype
|
||||
Date: March 2017
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
This is to configure the data type of the current channel.
|
||||
The following strings will be accepted:
|
||||
'control',
|
||||
'async',
|
||||
'sync',
|
||||
'isoc_avp'
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../<channel>/set_subbuffer_size
|
||||
Date: March 2017
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
This is to configure the subbuffer size of the current channel.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../<channel>/set_packets_per_xact
|
||||
Date: March 2017
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
This is to configure the number of packets per transaction of
|
||||
the current channel. This is only needed network interface
|
||||
controller is attached via USB.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/devices/.../<channel>/channel_starving
|
||||
Date: March 2017
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
Indicates whether current channel ran out of buffers.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/drivers/most_core/components
|
||||
Date: March 2017
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
This is used to retrieve a list of registered components.
|
||||
Users:
|
||||
|
||||
What: /sys/bus/most/drivers/most_core/links
|
||||
Date: March 2017
|
||||
KernelVersion: 4.15
|
||||
Contact: Christian Gromm <christian.gromm@microchip.com>
|
||||
Description:
|
||||
This is used to retrieve a list of established links.
|
||||
Users:
|
||||
@@ -189,7 +189,8 @@ Description:
|
||||
Access: Read
|
||||
Valid values: "Unknown", "Good", "Overheat", "Dead",
|
||||
"Over voltage", "Unspecified failure", "Cold",
|
||||
"Watchdog timer expire", "Safety timer expire"
|
||||
"Watchdog timer expire", "Safety timer expire",
|
||||
"Over current"
|
||||
|
||||
What: /sys/class/power_supply/<supply_name>/precharge_current
|
||||
Date: June 2017
|
||||
|
||||
@@ -20,13 +20,13 @@ Date: April 2017
|
||||
Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
|
||||
Description:
|
||||
The supported power roles. This attribute can be used to request
|
||||
power role swap on the port when the port supports USB Power
|
||||
Delivery. Swapping is supported as synchronous operation, so
|
||||
write(2) to the attribute will not return until the operation
|
||||
has finished. The attribute is notified about role changes so
|
||||
that poll(2) on the attribute wakes up. Change on the role will
|
||||
also generate uevent KOBJ_CHANGE. The current role is show in
|
||||
brackets, for example "[source] sink" when in source mode.
|
||||
power role swap on the port. Swapping is supported as
|
||||
synchronous operation, so write(2) to the attribute will not
|
||||
return until the operation has finished. The attribute is
|
||||
notified about role changes so that poll(2) on the attribute
|
||||
wakes up. Change on the role will also generate uevent
|
||||
KOBJ_CHANGE. The current role is show in brackets, for example
|
||||
"[source] sink" when in source mode.
|
||||
|
||||
Valid values: source, sink
|
||||
|
||||
@@ -108,6 +108,15 @@ Contact: Heikki Krogerus <heikki.krogerus@linux.intel.com>
|
||||
Description:
|
||||
Revision number of the supported USB Type-C specification.
|
||||
|
||||
What: /sys/class/typec/<port>/orientation
|
||||
Date: February 2020
|
||||
Contact: Badhri Jagan Sridharan <badhri@google.com>
|
||||
Description:
|
||||
Indicates the active orientation of the Type-C connector.
|
||||
Valid values:
|
||||
- "normal": CC1 orientation
|
||||
- "reverse": CC2 orientation
|
||||
- "unknown": Orientation cannot be determined.
|
||||
|
||||
USB Type-C partner devices (eg. /sys/class/typec/port0-partner/)
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
What: /sys/devices/*/<our-device>/nvmem
|
||||
Date: December 2017
|
||||
Contact: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
|
||||
Description: read-only access to the efuse on the Ingenic JZ4780 SoC
|
||||
The SoC has a one time programmable 8K efuse that is
|
||||
split into segments. The driver supports read only.
|
||||
The segments are
|
||||
0x000 64 bit Random Number
|
||||
0x008 128 bit Ingenic Chip ID
|
||||
0x018 128 bit Customer ID
|
||||
0x028 3520 bit Reserved
|
||||
0x1E0 8 bit Protect Segment
|
||||
0x1E1 2296 bit HDMI Key
|
||||
0x300 2048 bit Security boot key
|
||||
Users: any user space application which wants to read the Chip
|
||||
and Customer ID
|
||||
@@ -11,3 +11,16 @@ Description:
|
||||
#echo 00:19.0-E0:2:FF > /sys/bus/pci/drivers/pciback/quirks
|
||||
will allow the guest to read and write to the configuration
|
||||
register 0x0E.
|
||||
|
||||
What: /sys/bus/pci/drivers/pciback/allow_interrupt_control
|
||||
Date: Jan 2020
|
||||
KernelVersion: 5.6
|
||||
Contact: xen-devel@lists.xenproject.org
|
||||
Description:
|
||||
List of devices which can have interrupt control flag (INTx,
|
||||
MSI, MSI-X) set by a connected guest. It is meant to be set
|
||||
only when the guest is a stubdomain hosting device model (qemu)
|
||||
and the actual device is assigned to a HVM. It is not safe
|
||||
(similar to permissive attribute) to set for a devices assigned
|
||||
to a PV guest. The device is automatically removed from this
|
||||
list when the connected pcifront terminates.
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
What: /sys/class/uacce/<dev_name>/api
|
||||
Date: Feb 2020
|
||||
KernelVersion: 5.7
|
||||
Contact: linux-accelerators@lists.ozlabs.org
|
||||
Description: Api of the device
|
||||
Can be any string and up to userspace to parse.
|
||||
Application use the api to match the correct driver
|
||||
|
||||
What: /sys/class/uacce/<dev_name>/flags
|
||||
Date: Feb 2020
|
||||
KernelVersion: 5.7
|
||||
Contact: linux-accelerators@lists.ozlabs.org
|
||||
Description: Attributes of the device, see UACCE_DEV_xxx flag defined in uacce.h
|
||||
|
||||
What: /sys/class/uacce/<dev_name>/available_instances
|
||||
Date: Feb 2020
|
||||
KernelVersion: 5.7
|
||||
Contact: linux-accelerators@lists.ozlabs.org
|
||||
Description: Available instances left of the device
|
||||
Return -ENODEV if uacce_ops get_available_instances is not provided
|
||||
|
||||
What: /sys/class/uacce/<dev_name>/algorithms
|
||||
Date: Feb 2020
|
||||
KernelVersion: 5.7
|
||||
Contact: linux-accelerators@lists.ozlabs.org
|
||||
Description: Algorithms supported by this accelerator, separated by new line.
|
||||
Can be any string and up to userspace to parse.
|
||||
|
||||
What: /sys/class/uacce/<dev_name>/region_mmio_size
|
||||
Date: Feb 2020
|
||||
KernelVersion: 5.7
|
||||
Contact: linux-accelerators@lists.ozlabs.org
|
||||
Description: Size (bytes) of mmio region queue file
|
||||
|
||||
What: /sys/class/uacce/<dev_name>/region_dus_size
|
||||
Date: Feb 2020
|
||||
KernelVersion: 5.7
|
||||
Contact: linux-accelerators@lists.ozlabs.org
|
||||
Description: Size (bytes) of dus region queue file
|
||||
@@ -25,3 +25,13 @@ Description:
|
||||
allocated without being in use. The time is in
|
||||
seconds, 0 means indefinitely long.
|
||||
The default is 60 seconds.
|
||||
|
||||
What: /sys/module/xen_blkback/parameters/buffer_squeeze_duration_ms
|
||||
Date: December 2019
|
||||
KernelVersion: 5.6
|
||||
Contact: SeongJae Park <sjpark@amazon.de>
|
||||
Description:
|
||||
When memory pressure is reported to blkback this option
|
||||
controls the duration in milliseconds that blkback will not
|
||||
cache any page not backed by a grant mapping.
|
||||
The default is 10ms.
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
What: /sys/firmware/opal/sensor_groups
|
||||
Date: August 2017
|
||||
Contact: Linux for PowerPC mailing list <linuxppc-dev@ozlabs.org>
|
||||
Description: Sensor groups directory for POWER9 powernv servers
|
||||
|
||||
Each folder in this directory contains a sensor group
|
||||
which are classified based on type of the sensor
|
||||
like power, temperature, frequency, current, etc. They
|
||||
can also indicate the group of sensors belonging to
|
||||
different owners like CSM, Profiler, Job-Scheduler
|
||||
|
||||
What: /sys/firmware/opal/sensor_groups/<sensor_group_name>/clear
|
||||
Date: August 2017
|
||||
Contact: Linux for PowerPC mailing list <linuxppc-dev@ozlabs.org>
|
||||
Description: Sysfs file to clear the min-max of all the sensors
|
||||
belonging to the group.
|
||||
|
||||
Writing 1 to this file will clear the minimum and
|
||||
maximum values of all the sensors in the group.
|
||||
In POWER9, the min-max of a sensor is the historical minimum
|
||||
and maximum value of the sensor cached by OCC.
|
||||
@@ -1,37 +1,40 @@
|
||||
What: /sys/fs/f2fs/<disk>/gc_max_sleep_time
|
||||
Date: July 2013
|
||||
Contact: "Namjae Jeon" <namjae.jeon@samsung.com>
|
||||
Description:
|
||||
Controls the maximun sleep time for gc_thread. Time
|
||||
is in milliseconds.
|
||||
Description: Controls the maximum sleep time for gc_thread. Time
|
||||
is in milliseconds.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/gc_min_sleep_time
|
||||
Date: July 2013
|
||||
Contact: "Namjae Jeon" <namjae.jeon@samsung.com>
|
||||
Description:
|
||||
Controls the minimum sleep time for gc_thread. Time
|
||||
is in milliseconds.
|
||||
Description: Controls the minimum sleep time for gc_thread. Time
|
||||
is in milliseconds.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/gc_no_gc_sleep_time
|
||||
Date: July 2013
|
||||
Contact: "Namjae Jeon" <namjae.jeon@samsung.com>
|
||||
Description:
|
||||
Controls the default sleep time for gc_thread. Time
|
||||
is in milliseconds.
|
||||
Description: Controls the default sleep time for gc_thread. Time
|
||||
is in milliseconds.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/gc_idle
|
||||
Date: July 2013
|
||||
Contact: "Namjae Jeon" <namjae.jeon@samsung.com>
|
||||
Description:
|
||||
Controls the victim selection policy for garbage collection.
|
||||
Description: Controls the victim selection policy for garbage collection.
|
||||
Setting gc_idle = 0(default) will disable this option. Setting
|
||||
gc_idle = 1 will select the Cost Benefit approach & setting
|
||||
gc_idle = 2 will select the greedy approach.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/reclaim_segments
|
||||
Date: October 2013
|
||||
Contact: "Jaegeuk Kim" <jaegeuk.kim@samsung.com>
|
||||
Description:
|
||||
Controls the issue rate of segment discard commands.
|
||||
Description: This parameter controls the number of prefree segments to be
|
||||
reclaimed. If the number of prefree segments is larger than
|
||||
the number of segments in the proportion to the percentage
|
||||
over total volume size, f2fs tries to conduct checkpoint to
|
||||
reclaim the prefree segments to free segments.
|
||||
By default, 5% over total # of segments.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/max_blkaddr
|
||||
What: /sys/fs/f2fs/<disk>/main_blkaddr
|
||||
Date: November 2019
|
||||
Contact: "Ramon Pantin" <pantin@google.com>
|
||||
Description:
|
||||
@@ -40,227 +43,283 @@ Description:
|
||||
What: /sys/fs/f2fs/<disk>/ipu_policy
|
||||
Date: November 2013
|
||||
Contact: "Jaegeuk Kim" <jaegeuk.kim@samsung.com>
|
||||
Description:
|
||||
Controls the in-place-update policy.
|
||||
Description: Controls the in-place-update policy.
|
||||
updates in f2fs. User can set:
|
||||
0x01: F2FS_IPU_FORCE, 0x02: F2FS_IPU_SSR,
|
||||
0x04: F2FS_IPU_UTIL, 0x08: F2FS_IPU_SSR_UTIL,
|
||||
0x10: F2FS_IPU_FSYNC, 0x20: F2FS_IPU_ASYNC,
|
||||
0x40: F2FS_IPU_NOCACHE.
|
||||
Refer segment.h for details.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/min_ipu_util
|
||||
Date: November 2013
|
||||
Contact: "Jaegeuk Kim" <jaegeuk.kim@samsung.com>
|
||||
Description:
|
||||
Controls the FS utilization condition for the in-place-update
|
||||
policies.
|
||||
Description: Controls the FS utilization condition for the in-place-update
|
||||
policies. It is used by F2FS_IPU_UTIL and F2FS_IPU_SSR_UTIL policies.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/min_fsync_blocks
|
||||
Date: September 2014
|
||||
Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
|
||||
Description:
|
||||
Controls the dirty page count condition for the in-place-update
|
||||
policies.
|
||||
Description: Controls the dirty page count condition for the in-place-update
|
||||
policies.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/min_seq_blocks
|
||||
Date: August 2018
|
||||
Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
|
||||
Description:
|
||||
Controls the dirty page count condition for batched sequential
|
||||
writes in ->writepages.
|
||||
|
||||
Description: Controls the dirty page count condition for batched sequential
|
||||
writes in writepages.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/min_hot_blocks
|
||||
Date: March 2017
|
||||
Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
|
||||
Description:
|
||||
Controls the dirty page count condition for redefining hot data.
|
||||
Description: Controls the dirty page count condition for redefining hot data.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/min_ssr_sections
|
||||
Date: October 2017
|
||||
Contact: "Chao Yu" <yuchao0@huawei.com>
|
||||
Description:
|
||||
Controls the fee section threshold to trigger SSR allocation.
|
||||
Description: Controls the free section threshold to trigger SSR allocation.
|
||||
If this is large, SSR mode will be enabled early.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/max_small_discards
|
||||
Date: November 2013
|
||||
Contact: "Jaegeuk Kim" <jaegeuk.kim@samsung.com>
|
||||
Description:
|
||||
Controls the issue rate of small discard commands.
|
||||
Description: Controls the issue rate of discard commands that consist of small
|
||||
blocks less than 2MB. The candidates to be discarded are cached until
|
||||
checkpoint is triggered, and issued during the checkpoint.
|
||||
By default, it is disabled with 0.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/discard_granularity
|
||||
Date: July 2017
|
||||
Contact: "Chao Yu" <yuchao0@huawei.com>
|
||||
Description:
|
||||
Controls discard granularity of inner discard thread, inner thread
|
||||
What: /sys/fs/f2fs/<disk>/discard_granularity
|
||||
Date: July 2017
|
||||
Contact: "Chao Yu" <yuchao0@huawei.com>
|
||||
Description: Controls discard granularity of inner discard thread. Inner thread
|
||||
will not issue discards with size that is smaller than granularity.
|
||||
The unit size is one block, now only support configuring in range
|
||||
of [1, 512].
|
||||
The unit size is one block(4KB), now only support configuring
|
||||
in range of [1, 512]. Default value is 4(=16KB).
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/umount_discard_timeout
|
||||
Date: January 2019
|
||||
Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
|
||||
Description:
|
||||
Set timeout to issue discard commands during umount.
|
||||
Default: 5 secs
|
||||
What: /sys/fs/f2fs/<disk>/umount_discard_timeout
|
||||
Date: January 2019
|
||||
Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
|
||||
Description: Set timeout to issue discard commands during umount.
|
||||
Default: 5 secs
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/max_victim_search
|
||||
Date: January 2014
|
||||
Contact: "Jaegeuk Kim" <jaegeuk.kim@samsung.com>
|
||||
Description:
|
||||
Controls the number of trials to find a victim segment.
|
||||
Description: Controls the number of trials to find a victim segment
|
||||
when conducting SSR and cleaning operations. The default value
|
||||
is 4096 which covers 8GB block address range.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/migration_granularity
|
||||
Date: October 2018
|
||||
Contact: "Chao Yu" <yuchao0@huawei.com>
|
||||
Description:
|
||||
Controls migration granularity of garbage collection on large
|
||||
section, it can let GC move partial segment{s} of one section
|
||||
in one GC cycle, so that dispersing heavy overhead GC to
|
||||
multiple lightweight one.
|
||||
Description: Controls migration granularity of garbage collection on large
|
||||
section, it can let GC move partial segment{s} of one section
|
||||
in one GC cycle, so that dispersing heavy overhead GC to
|
||||
multiple lightweight one.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/dir_level
|
||||
Date: March 2014
|
||||
Contact: "Jaegeuk Kim" <jaegeuk.kim@samsung.com>
|
||||
Description:
|
||||
Controls the directory level for large directory.
|
||||
Description: Controls the directory level for large directory. If a
|
||||
directory has a number of files, it can reduce the file lookup
|
||||
latency by increasing this dir_level value. Otherwise, it
|
||||
needs to decrease this value to reduce the space overhead.
|
||||
The default value is 0.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/ram_thresh
|
||||
Date: March 2014
|
||||
Contact: "Jaegeuk Kim" <jaegeuk.kim@samsung.com>
|
||||
Description:
|
||||
Controls the memory footprint used by f2fs.
|
||||
Description: Controls the memory footprint used by free nids and cached
|
||||
nat entries. By default, 1 is set, which indicates
|
||||
10 MB / 1 GB RAM.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/batched_trim_sections
|
||||
Date: February 2015
|
||||
Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
|
||||
Description:
|
||||
Controls the trimming rate in batch mode.
|
||||
<deprecated>
|
||||
Description: Controls the trimming rate in batch mode.
|
||||
<deprecated>
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/cp_interval
|
||||
Date: October 2015
|
||||
Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
|
||||
Description:
|
||||
Controls the checkpoint timing.
|
||||
Description: Controls the checkpoint timing, set to 60 seconds by default.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/idle_interval
|
||||
Date: January 2016
|
||||
Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
|
||||
Description:
|
||||
Controls the idle timing for all paths other than
|
||||
discard and gc path.
|
||||
Description: Controls the idle timing of system, if there is no FS operation
|
||||
during given interval.
|
||||
Set to 5 seconds by default.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/discard_idle_interval
|
||||
Date: September 2018
|
||||
Contact: "Chao Yu" <yuchao0@huawei.com>
|
||||
Contact: "Sahitya Tummala" <stummala@codeaurora.org>
|
||||
Description:
|
||||
Controls the idle timing for discard path.
|
||||
Description: Controls the idle timing of discard thread given
|
||||
this time interval.
|
||||
Default is 5 secs.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/gc_idle_interval
|
||||
Date: September 2018
|
||||
Contact: "Chao Yu" <yuchao0@huawei.com>
|
||||
Contact: "Sahitya Tummala" <stummala@codeaurora.org>
|
||||
Description:
|
||||
Controls the idle timing for gc path.
|
||||
Description: Controls the idle timing for gc path. Set to 5 seconds by default.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/iostat_enable
|
||||
Date: August 2017
|
||||
Contact: "Chao Yu" <yuchao0@huawei.com>
|
||||
Description:
|
||||
Controls to enable/disable IO stat.
|
||||
Description: Controls to enable/disable IO stat.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/ra_nid_pages
|
||||
Date: October 2015
|
||||
Contact: "Chao Yu" <chao2.yu@samsung.com>
|
||||
Description:
|
||||
Controls the count of nid pages to be readaheaded.
|
||||
Description: Controls the count of nid pages to be readaheaded.
|
||||
When building free nids, F2FS reads NAT blocks ahead for
|
||||
speed up. Default is 0.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/dirty_nats_ratio
|
||||
Date: January 2016
|
||||
Contact: "Chao Yu" <chao2.yu@samsung.com>
|
||||
Description:
|
||||
Controls dirty nat entries ratio threshold, if current
|
||||
ratio exceeds configured threshold, checkpoint will
|
||||
be triggered for flushing dirty nat entries.
|
||||
Description: Controls dirty nat entries ratio threshold, if current
|
||||
ratio exceeds configured threshold, checkpoint will
|
||||
be triggered for flushing dirty nat entries.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/lifetime_write_kbytes
|
||||
Date: January 2016
|
||||
Contact: "Shuoran Liu" <liushuoran@huawei.com>
|
||||
Description:
|
||||
Shows total written kbytes issued to disk.
|
||||
Description: Shows total written kbytes issued to disk.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/features
|
||||
Date: July 2017
|
||||
Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
|
||||
Description:
|
||||
Shows all enabled features in current device.
|
||||
Description: Shows all enabled features in current device.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/inject_rate
|
||||
Date: May 2016
|
||||
Contact: "Sheng Yong" <shengyong1@huawei.com>
|
||||
Description:
|
||||
Controls the injection rate.
|
||||
Description: Controls the injection rate of arbitrary faults.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/inject_type
|
||||
Date: May 2016
|
||||
Contact: "Sheng Yong" <shengyong1@huawei.com>
|
||||
Description:
|
||||
Controls the injection type.
|
||||
Description: Controls the injection type of arbitrary faults.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/dirty_segments
|
||||
Date: October 2017
|
||||
Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
|
||||
Description: Shows the number of dirty segments.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/reserved_blocks
|
||||
Date: June 2017
|
||||
Contact: "Chao Yu" <yuchao0@huawei.com>
|
||||
Description:
|
||||
Controls target reserved blocks in system, the threshold
|
||||
is soft, it could exceed current available user space.
|
||||
Description: Controls target reserved blocks in system, the threshold
|
||||
is soft, it could exceed current available user space.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/current_reserved_blocks
|
||||
Date: October 2017
|
||||
Contact: "Yunlong Song" <yunlong.song@huawei.com>
|
||||
Contact: "Chao Yu" <yuchao0@huawei.com>
|
||||
Description:
|
||||
Shows current reserved blocks in system, it may be temporarily
|
||||
smaller than target_reserved_blocks, but will gradually
|
||||
increase to target_reserved_blocks when more free blocks are
|
||||
freed by user later.
|
||||
Description: Shows current reserved blocks in system, it may be temporarily
|
||||
smaller than target_reserved_blocks, but will gradually
|
||||
increase to target_reserved_blocks when more free blocks are
|
||||
freed by user later.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/gc_urgent
|
||||
Date: August 2017
|
||||
Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
|
||||
Description:
|
||||
Do background GC agressively
|
||||
Description: Do background GC agressively when set. When gc_urgent = 1,
|
||||
background thread starts to do GC by given gc_urgent_sleep_time
|
||||
interval. It is set to 0 by default.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/gc_urgent_sleep_time
|
||||
Date: August 2017
|
||||
Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
|
||||
Description:
|
||||
Controls sleep time of GC urgent mode
|
||||
Description: Controls sleep time of GC urgent mode. Set to 500ms by default.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/readdir_ra
|
||||
Date: November 2017
|
||||
Contact: "Sheng Yong" <shengyong1@huawei.com>
|
||||
Description:
|
||||
Controls readahead inode block in readdir.
|
||||
Description: Controls readahead inode block in readdir. Enabled by default.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/gc_pin_file_thresh
|
||||
Date: January 2018
|
||||
Contact: Jaegeuk Kim <jaegeuk@kernel.org>
|
||||
Description: This indicates how many GC can be failed for the pinned
|
||||
file. If it exceeds this, F2FS doesn't guarantee its pinning
|
||||
state. 2048 trials is set by default.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/extension_list
|
||||
Date: Feburary 2018
|
||||
Contact: "Chao Yu" <yuchao0@huawei.com>
|
||||
Description:
|
||||
Used to control configure extension list:
|
||||
- Query: cat /sys/fs/f2fs/<disk>/extension_list
|
||||
- Add: echo '[h/c]extension' > /sys/fs/f2fs/<disk>/extension_list
|
||||
- Del: echo '[h/c]!extension' > /sys/fs/f2fs/<disk>/extension_list
|
||||
- [h] means add/del hot file extension
|
||||
- [c] means add/del cold file extension
|
||||
Description: Used to control configure extension list:
|
||||
- Query: cat /sys/fs/f2fs/<disk>/extension_list
|
||||
- Add: echo '[h/c]extension' > /sys/fs/f2fs/<disk>/extension_list
|
||||
- Del: echo '[h/c]!extension' > /sys/fs/f2fs/<disk>/extension_list
|
||||
- [h] means add/del hot file extension
|
||||
- [c] means add/del cold file extension
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/unusable
|
||||
Date April 2019
|
||||
Contact: "Daniel Rosenberg" <drosen@google.com>
|
||||
Description:
|
||||
If checkpoint=disable, it displays the number of blocks that are unusable.
|
||||
If checkpoint=enable it displays the enumber of blocks that would be unusable
|
||||
if checkpoint=disable were to be set.
|
||||
Description: If checkpoint=disable, it displays the number of blocks that
|
||||
are unusable.
|
||||
If checkpoint=enable it displays the enumber of blocks that
|
||||
would be unusable if checkpoint=disable were to be set.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/encoding
|
||||
Date July 2019
|
||||
Contact: "Daniel Rosenberg" <drosen@google.com>
|
||||
Description:
|
||||
Displays name and version of the encoding set for the filesystem.
|
||||
If no encoding is set, displays (none)
|
||||
Description: Displays name and version of the encoding set for the filesystem.
|
||||
If no encoding is set, displays (none)
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/free_segments
|
||||
Date: September 2019
|
||||
Contact: "Hridya Valsaraju" <hridya@google.com>
|
||||
Description: Number of free segments in disk.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/cp_foreground_calls
|
||||
Date: September 2019
|
||||
Contact: "Hridya Valsaraju" <hridya@google.com>
|
||||
Description: Number of checkpoint operations performed on demand. Available when
|
||||
CONFIG_F2FS_STAT_FS=y.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/cp_background_calls
|
||||
Date: September 2019
|
||||
Contact: "Hridya Valsaraju" <hridya@google.com>
|
||||
Description: Number of checkpoint operations performed in the background to
|
||||
free segments. Available when CONFIG_F2FS_STAT_FS=y.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/gc_foreground_calls
|
||||
Date: September 2019
|
||||
Contact: "Hridya Valsaraju" <hridya@google.com>
|
||||
Description: Number of garbage collection operations performed on demand.
|
||||
Available when CONFIG_F2FS_STAT_FS=y.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/gc_background_calls
|
||||
Date: September 2019
|
||||
Contact: "Hridya Valsaraju" <hridya@google.com>
|
||||
Description: Number of garbage collection operations triggered in background.
|
||||
Available when CONFIG_F2FS_STAT_FS=y.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/moved_blocks_foreground
|
||||
Date: September 2019
|
||||
Contact: "Hridya Valsaraju" <hridya@google.com>
|
||||
Description: Number of blocks moved by garbage collection in foreground.
|
||||
Available when CONFIG_F2FS_STAT_FS=y.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/moved_blocks_background
|
||||
Date: September 2019
|
||||
Contact: "Hridya Valsaraju" <hridya@google.com>
|
||||
Description: Number of blocks moved by garbage collection in background.
|
||||
Available when CONFIG_F2FS_STAT_FS=y.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/avg_vblocks
|
||||
Date: September 2019
|
||||
Contact: "Hridya Valsaraju" <hridya@google.com>
|
||||
Description: Average number of valid blocks.
|
||||
Available when CONFIG_F2FS_STAT_FS=y.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/mounted_time_sec
|
||||
Date: February 2020
|
||||
Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
|
||||
Description: Show the mounted time in secs of this partition.
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
What: /sys/kernel/fadump/*
|
||||
Date: Dec 2019
|
||||
Contact: linuxppc-dev@lists.ozlabs.org
|
||||
Description:
|
||||
The /sys/kernel/fadump/* is a collection of FADump sysfs
|
||||
file provide information about the configuration status
|
||||
of Firmware Assisted Dump (FADump).
|
||||
|
||||
What: /sys/kernel/fadump/enabled
|
||||
Date: Dec 2019
|
||||
Contact: linuxppc-dev@lists.ozlabs.org
|
||||
Description: read only
|
||||
Primarily used to identify whether the FADump is enabled in
|
||||
the kernel or not.
|
||||
User: Kdump service
|
||||
|
||||
What: /sys/kernel/fadump/registered
|
||||
Date: Dec 2019
|
||||
Contact: linuxppc-dev@lists.ozlabs.org
|
||||
Description: read/write
|
||||
Helps to control the dump collect feature from userspace.
|
||||
Setting 1 to this file enables the system to collect the
|
||||
dump and 0 to disable it.
|
||||
User: Kdump service
|
||||
|
||||
What: /sys/kernel/fadump/release_mem
|
||||
Date: Dec 2019
|
||||
Contact: linuxppc-dev@lists.ozlabs.org
|
||||
Description: write only
|
||||
This is a special sysfs file and only available when
|
||||
the system is booted to capture the vmcore using FADump.
|
||||
It is used to release the memory reserved by FADump to
|
||||
save the crash dump.
|
||||
|
||||
What: /sys/kernel/fadump/mem_reserved
|
||||
Date: Dec 2019
|
||||
Contact: linuxppc-dev@lists.ozlabs.org
|
||||
Description: read only
|
||||
Provide information about the amount of memory reserved by
|
||||
FADump to save the crash dump in bytes.
|
||||
@@ -2,7 +2,7 @@ What: /sys/class/leds/dell::kbd_backlight/als_enabled
|
||||
Date: December 2014
|
||||
KernelVersion: 3.19
|
||||
Contact: Gabriele Mazzotta <gabriele.mzt@gmail.com>,
|
||||
Pali Rohár <pali.rohar@gmail.com>
|
||||
Pali Rohár <pali@kernel.org>
|
||||
Description:
|
||||
This file allows to control the automatic keyboard
|
||||
illumination mode on some systems that have an ambient
|
||||
@@ -13,7 +13,7 @@ What: /sys/class/leds/dell::kbd_backlight/als_setting
|
||||
Date: December 2014
|
||||
KernelVersion: 3.19
|
||||
Contact: Gabriele Mazzotta <gabriele.mzt@gmail.com>,
|
||||
Pali Rohár <pali.rohar@gmail.com>
|
||||
Pali Rohár <pali@kernel.org>
|
||||
Description:
|
||||
This file allows to specifiy the on/off threshold value,
|
||||
as reported by the ambient light sensor.
|
||||
@@ -22,7 +22,7 @@ What: /sys/class/leds/dell::kbd_backlight/start_triggers
|
||||
Date: December 2014
|
||||
KernelVersion: 3.19
|
||||
Contact: Gabriele Mazzotta <gabriele.mzt@gmail.com>,
|
||||
Pali Rohár <pali.rohar@gmail.com>
|
||||
Pali Rohár <pali@kernel.org>
|
||||
Description:
|
||||
This file allows to control the input triggers that
|
||||
turn on the keyboard backlight illumination that is
|
||||
@@ -45,7 +45,7 @@ What: /sys/class/leds/dell::kbd_backlight/stop_timeout
|
||||
Date: December 2014
|
||||
KernelVersion: 3.19
|
||||
Contact: Gabriele Mazzotta <gabriele.mzt@gmail.com>,
|
||||
Pali Rohár <pali.rohar@gmail.com>
|
||||
Pali Rohár <pali@kernel.org>
|
||||
Description:
|
||||
This file allows to specify the interval after which the
|
||||
keyboard illumination is disabled because of inactivity.
|
||||
|
||||
@@ -154,3 +154,10 @@ Description:
|
||||
device specification. For example, when user sets 7bytes on
|
||||
16550A, which has 1/4/8/14 bytes trigger, the RX trigger is
|
||||
automatically changed to 4 bytes.
|
||||
|
||||
What: /sys/class/tty/ttyS0/console
|
||||
Date: February 2020
|
||||
Contact: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
|
||||
Description:
|
||||
Allows user to detach or attach back the given device as
|
||||
kernel console. It shows and accepts a boolean variable.
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
# Makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
subdir-y := devicetree/bindings/
|
||||
# for cleaning
|
||||
subdir- := devicetree/bindings
|
||||
|
||||
# Check for broken documentation file references
|
||||
ifeq ($(CONFIG_WARN_MISSING_DOCUMENTS),y)
|
||||
@@ -13,7 +14,7 @@ endif
|
||||
SPHINXBUILD = sphinx-build
|
||||
SPHINXOPTS =
|
||||
SPHINXDIRS = .
|
||||
_SPHINXDIRS = $(patsubst $(srctree)/Documentation/%/index.rst,%,$(wildcard $(srctree)/Documentation/*/index.rst))
|
||||
_SPHINXDIRS = $(sort $(patsubst $(srctree)/Documentation/%/index.rst,%,$(wildcard $(srctree)/Documentation/*/index.rst)))
|
||||
SPHINX_CONF = conf.py
|
||||
PAPER =
|
||||
BUILDDIR = $(obj)/output
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
===============
|
||||
Boot Interrupts
|
||||
===============
|
||||
|
||||
:Author: - Sean V Kelley <sean.v.kelley@linux.intel.com>
|
||||
|
||||
Overview
|
||||
========
|
||||
|
||||
On PCI Express, interrupts are represented with either MSI or inbound
|
||||
interrupt messages (Assert_INTx/Deassert_INTx). The integrated IO-APIC in a
|
||||
given Core IO converts the legacy interrupt messages from PCI Express to
|
||||
MSI interrupts. If the IO-APIC is disabled (via the mask bits in the
|
||||
IO-APIC table entries), the messages are routed to the legacy PCH. This
|
||||
in-band interrupt mechanism was traditionally necessary for systems that
|
||||
did not support the IO-APIC and for boot. Intel in the past has used the
|
||||
term "boot interrupts" to describe this mechanism. Further, the PCI Express
|
||||
protocol describes this in-band legacy wire-interrupt INTx mechanism for
|
||||
I/O devices to signal PCI-style level interrupts. The subsequent paragraphs
|
||||
describe problems with the Core IO handling of INTx message routing to the
|
||||
PCH and mitigation within BIOS and the OS.
|
||||
|
||||
|
||||
Issue
|
||||
=====
|
||||
|
||||
When in-band legacy INTx messages are forwarded to the PCH, they in turn
|
||||
trigger a new interrupt for which the OS likely lacks a handler. When an
|
||||
interrupt goes unhandled over time, they are tracked by the Linux kernel as
|
||||
Spurious Interrupts. The IRQ will be disabled by the Linux kernel after it
|
||||
reaches a specific count with the error "nobody cared". This disabled IRQ
|
||||
now prevents valid usage by an existing interrupt which may happen to share
|
||||
the IRQ line.
|
||||
|
||||
irq 19: nobody cared (try booting with the "irqpoll" option)
|
||||
CPU: 0 PID: 2988 Comm: irq/34-nipalk Tainted: 4.14.87-rt49-02410-g4a640ec-dirty #1
|
||||
Hardware name: National Instruments NI PXIe-8880/NI PXIe-8880, BIOS 2.1.5f1 01/09/2020
|
||||
Call Trace:
|
||||
<IRQ>
|
||||
? dump_stack+0x46/0x5e
|
||||
? __report_bad_irq+0x2e/0xb0
|
||||
? note_interrupt+0x242/0x290
|
||||
? nNIKAL100_memoryRead16+0x8/0x10 [nikal]
|
||||
? handle_irq_event_percpu+0x55/0x70
|
||||
? handle_irq_event+0x4f/0x80
|
||||
? handle_fasteoi_irq+0x81/0x180
|
||||
? handle_irq+0x1c/0x30
|
||||
? do_IRQ+0x41/0xd0
|
||||
? common_interrupt+0x84/0x84
|
||||
</IRQ>
|
||||
|
||||
handlers:
|
||||
irq_default_primary_handler threaded usb_hcd_irq
|
||||
Disabling IRQ #19
|
||||
|
||||
|
||||
Conditions
|
||||
==========
|
||||
|
||||
The use of threaded interrupts is the most likely condition to trigger
|
||||
this problem today. Threaded interrupts may not be reenabled after the IRQ
|
||||
handler wakes. These "one shot" conditions mean that the threaded interrupt
|
||||
needs to keep the interrupt line masked until the threaded handler has run.
|
||||
Especially when dealing with high data rate interrupts, the thread needs to
|
||||
run to completion; otherwise some handlers will end up in stack overflows
|
||||
since the interrupt of the issuing device is still active.
|
||||
|
||||
Affected Chipsets
|
||||
=================
|
||||
|
||||
The legacy interrupt forwarding mechanism exists today in a number of
|
||||
devices including but not limited to chipsets from AMD/ATI, Broadcom, and
|
||||
Intel. Changes made through the mitigations below have been applied to
|
||||
drivers/pci/quirks.c
|
||||
|
||||
Starting with ICX there are no longer any IO-APICs in the Core IO's
|
||||
devices. IO-APIC is only in the PCH. Devices connected to the Core IO's
|
||||
PCIe Root Ports will use native MSI/MSI-X mechanisms.
|
||||
|
||||
Mitigations
|
||||
===========
|
||||
|
||||
The mitigations take the form of PCI quirks. The preference has been to
|
||||
first identify and make use of a means to disable the routing to the PCH.
|
||||
In such a case a quirk to disable boot interrupt generation can be
|
||||
added.[1]
|
||||
|
||||
Intel® 6300ESB I/O Controller Hub
|
||||
Alternate Base Address Register:
|
||||
BIE: Boot Interrupt Enable
|
||||
0 = Boot interrupt is enabled.
|
||||
1 = Boot interrupt is disabled.
|
||||
|
||||
Intel® Sandy Bridge through Sky Lake based Xeon servers:
|
||||
Coherent Interface Protocol Interrupt Control
|
||||
dis_intx_route2pch/dis_intx_route2ich/dis_intx_route2dmi2:
|
||||
When this bit is set. Local INTx messages received from the
|
||||
Intel® Quick Data DMA/PCI Express ports are not routed to legacy
|
||||
PCH - they are either converted into MSI via the integrated IO-APIC
|
||||
(if the IO-APIC mask bit is clear in the appropriate entries)
|
||||
or cause no further action (when mask bit is set)
|
||||
|
||||
In the absence of a way to directly disable the routing, another approach
|
||||
has been to make use of PCI Interrupt pin to INTx routing tables for
|
||||
purposes of redirecting the interrupt handler to the rerouted interrupt
|
||||
line by default. Therefore, on chipsets where this INTx routing cannot be
|
||||
disabled, the Linux kernel will reroute the valid interrupt to its legacy
|
||||
interrupt. This redirection of the handler will prevent the occurrence of
|
||||
the spurious interrupt detection which would ordinarily disable the IRQ
|
||||
line due to excessive unhandled counts.[2]
|
||||
|
||||
The config option X86_REROUTE_FOR_BROKEN_BOOT_IRQS exists to enable (or
|
||||
disable) the redirection of the interrupt handler to the PCH interrupt
|
||||
line. The option can be overridden by either pci=ioapicreroute or
|
||||
pci=noioapicreroute.[3]
|
||||
|
||||
|
||||
More Documentation
|
||||
==================
|
||||
|
||||
There is an overview of the legacy interrupt handling in several datasheets
|
||||
(6300ESB and 6700PXH below). While largely the same, it provides insight
|
||||
into the evolution of its handling with chipsets.
|
||||
|
||||
Example of disabling of the boot interrupt
|
||||
------------------------------------------
|
||||
|
||||
Intel® 6300ESB I/O Controller Hub (Document # 300641-004US)
|
||||
5.7.3 Boot Interrupt
|
||||
https://www.intel.com/content/dam/doc/datasheet/6300esb-io-controller-hub-datasheet.pdf
|
||||
|
||||
Intel® Xeon® Processor E5-1600/2400/2600/4600 v3 Product Families
|
||||
Datasheet - Volume 2: Registers (Document # 330784-003)
|
||||
6.6.41 cipintrc Coherent Interface Protocol Interrupt Control
|
||||
https://www.intel.com/content/dam/www/public/us/en/documents/datasheets/xeon-e5-v3-datasheet-vol-2.pdf
|
||||
|
||||
Example of handler rerouting
|
||||
----------------------------
|
||||
|
||||
Intel® 6700PXH 64-bit PCI Hub (Document # 302628)
|
||||
2.15.2 PCI Express Legacy INTx Support and Boot Interrupt
|
||||
https://www.intel.com/content/dam/doc/datasheet/6700pxh-64-bit-pci-hub-datasheet.pdf
|
||||
|
||||
|
||||
If you have any legacy PCI interrupt questions that aren't answered, email me.
|
||||
|
||||
Cheers,
|
||||
Sean V Kelley
|
||||
sean.v.kelley@linux.intel.com
|
||||
|
||||
[1] https://lore.kernel.org/r/12131949181903-git-send-email-sassmann@suse.de/
|
||||
[2] https://lore.kernel.org/r/12131949182094-git-send-email-sassmann@suse.de/
|
||||
[3] https://lore.kernel.org/r/487C8EA7.6020205@suse.de/
|
||||
@@ -16,3 +16,4 @@ Linux PCI Bus Subsystem
|
||||
pci-error-recovery
|
||||
pcieaer-howto
|
||||
endpoint/index
|
||||
boot-interrupts
|
||||
|
||||
@@ -283,5 +283,5 @@ or disabled (0). If 0 is found in any of the msi_bus files belonging
|
||||
to bridges between the PCI root and the device, MSIs are disabled.
|
||||
|
||||
It is also worth checking the device driver to see whether it supports MSIs.
|
||||
For example, it may contain calls to pci_irq_alloc_vectors() with the
|
||||
For example, it may contain calls to pci_alloc_irq_vectors() with the
|
||||
PCI_IRQ_MSI or PCI_IRQ_MSIX flags.
|
||||
|
||||
@@ -239,7 +239,7 @@ from the PCI device config space. Use the values in the pci_dev structure
|
||||
as the PCI "bus address" might have been remapped to a "host physical"
|
||||
address by the arch/chip-set specific kernel support.
|
||||
|
||||
See Documentation/io-mapping.txt for how to access device registers
|
||||
See Documentation/driver-api/io-mapping.rst for how to access device registers
|
||||
or device memory.
|
||||
|
||||
The device driver needs to call pci_request_region() to verify
|
||||
|
||||
@@ -156,12 +156,6 @@ default reset_link function, but different upstream ports might
|
||||
have different specifications to reset pci express link, so all
|
||||
upstream ports should provide their own reset_link functions.
|
||||
|
||||
In struct pcie_port_service_driver, a new pointer, reset_link, is
|
||||
added.
|
||||
::
|
||||
|
||||
pci_ers_result_t (*reset_link) (struct pci_dev *dev);
|
||||
|
||||
Section 3.2.2.2 provides more detailed info on when to call
|
||||
reset_link.
|
||||
|
||||
@@ -212,15 +206,10 @@ error_detected(dev, pci_channel_io_frozen) to all drivers within
|
||||
a hierarchy in question. Then, performing link reset at upstream is
|
||||
necessary. As different kinds of devices might use different approaches
|
||||
to reset link, AER port service driver is required to provide the
|
||||
function to reset link. Firstly, kernel looks for if the upstream
|
||||
component has an aer driver. If it has, kernel uses the reset_link
|
||||
callback of the aer driver. If the upstream component has no aer driver
|
||||
and the port is downstream port, we will perform a hot reset as the
|
||||
default by setting the Secondary Bus Reset bit of the Bridge Control
|
||||
register associated with the downstream port. As for upstream ports,
|
||||
they should provide their own aer service drivers with reset_link
|
||||
function. If error_detected returns PCI_ERS_RESULT_CAN_RECOVER and
|
||||
reset_link returns PCI_ERS_RESULT_RECOVERED, the error handling goes
|
||||
function to reset link via callback parameter of pcie_do_recovery()
|
||||
function. If reset_link is not NULL, recovery function will use it
|
||||
to reset the link. If error_detected returns PCI_ERS_RESULT_CAN_RECOVER
|
||||
and reset_link returns PCI_ERS_RESULT_RECOVERED, the error handling goes
|
||||
to mmio_enabled.
|
||||
|
||||
helper functions
|
||||
@@ -243,9 +232,9 @@ messages to root port when an error is detected.
|
||||
|
||||
::
|
||||
|
||||
int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev);`
|
||||
int pci_aer_clear_nonfatal_status(struct pci_dev *dev);`
|
||||
|
||||
pci_cleanup_aer_uncorrect_error_status cleanups the uncorrectable
|
||||
pci_aer_clear_nonfatal_status clears non-fatal errors in the uncorrectable
|
||||
error status register.
|
||||
|
||||
Frequent Asked Questions
|
||||
|
||||
@@ -4,7 +4,7 @@ A Tour Through TREE_RCU's Grace-Period Memory Ordering
|
||||
|
||||
August 8, 2017
|
||||
|
||||
This article was contributed by Paul E. McKenney
|
||||
This article was contributed by Paul E. McKenney
|
||||
|
||||
Introduction
|
||||
============
|
||||
@@ -48,7 +48,7 @@ Tree RCU Grace Period Memory Ordering Building Blocks
|
||||
|
||||
The workhorse for RCU's grace-period memory ordering is the
|
||||
critical section for the ``rcu_node`` structure's
|
||||
``->lock``. These critical sections use helper functions for lock
|
||||
``->lock``. These critical sections use helper functions for lock
|
||||
acquisition, including ``raw_spin_lock_rcu_node()``,
|
||||
``raw_spin_lock_irq_rcu_node()``, and ``raw_spin_lock_irqsave_rcu_node()``.
|
||||
Their lock-release counterparts are ``raw_spin_unlock_rcu_node()``,
|
||||
@@ -102,9 +102,9 @@ lock-acquisition and lock-release functions::
|
||||
23 r3 = READ_ONCE(x);
|
||||
24 }
|
||||
25
|
||||
26 WARN_ON(r1 == 0 && r2 == 0 && r3 == 0);
|
||||
26 WARN_ON(r1 == 0 && r2 == 0 && r3 == 0);
|
||||
|
||||
The ``WARN_ON()`` is evaluated at “the end of time”,
|
||||
The ``WARN_ON()`` is evaluated at "the end of time",
|
||||
after all changes have propagated throughout the system.
|
||||
Without the ``smp_mb__after_unlock_lock()`` provided by the
|
||||
acquisition functions, this ``WARN_ON()`` could trigger, for example
|
||||
|
||||
+214
-67
@@ -4,12 +4,61 @@ Using RCU to Protect Read-Mostly Linked Lists
|
||||
=============================================
|
||||
|
||||
One of the best applications of RCU is to protect read-mostly linked lists
|
||||
("struct list_head" in list.h). One big advantage of this approach
|
||||
(``struct list_head`` in list.h). One big advantage of this approach
|
||||
is that all of the required memory barriers are included for you in
|
||||
the list macros. This document describes several applications of RCU,
|
||||
with the best fits first.
|
||||
|
||||
Example 1: Read-Side Action Taken Outside of Lock, No In-Place Updates
|
||||
|
||||
Example 1: Read-mostly list: Deferred Destruction
|
||||
-------------------------------------------------
|
||||
|
||||
A widely used usecase for RCU lists in the kernel is lockless iteration over
|
||||
all processes in the system. ``task_struct::tasks`` represents the list node that
|
||||
links all the processes. The list can be traversed in parallel to any list
|
||||
additions or removals.
|
||||
|
||||
The traversal of the list is done using ``for_each_process()`` which is defined
|
||||
by the 2 macros::
|
||||
|
||||
#define next_task(p) \
|
||||
list_entry_rcu((p)->tasks.next, struct task_struct, tasks)
|
||||
|
||||
#define for_each_process(p) \
|
||||
for (p = &init_task ; (p = next_task(p)) != &init_task ; )
|
||||
|
||||
The code traversing the list of all processes typically looks like::
|
||||
|
||||
rcu_read_lock();
|
||||
for_each_process(p) {
|
||||
/* Do something with p */
|
||||
}
|
||||
rcu_read_unlock();
|
||||
|
||||
The simplified code for removing a process from a task list is::
|
||||
|
||||
void release_task(struct task_struct *p)
|
||||
{
|
||||
write_lock(&tasklist_lock);
|
||||
list_del_rcu(&p->tasks);
|
||||
write_unlock(&tasklist_lock);
|
||||
call_rcu(&p->rcu, delayed_put_task_struct);
|
||||
}
|
||||
|
||||
When a process exits, ``release_task()`` calls ``list_del_rcu(&p->tasks)`` under
|
||||
``tasklist_lock`` writer lock protection, to remove the task from the list of
|
||||
all tasks. The ``tasklist_lock`` prevents concurrent list additions/removals
|
||||
from corrupting the list. Readers using ``for_each_process()`` are not protected
|
||||
with the ``tasklist_lock``. To prevent readers from noticing changes in the list
|
||||
pointers, the ``task_struct`` object is freed only after one or more grace
|
||||
periods elapse (with the help of call_rcu()). This deferring of destruction
|
||||
ensures that any readers traversing the list will see valid ``p->tasks.next``
|
||||
pointers and deletion/freeing can happen in parallel with traversal of the list.
|
||||
This pattern is also called an **existence lock**, since RCU pins the object in
|
||||
memory until all existing readers finish.
|
||||
|
||||
|
||||
Example 2: Read-Side Action Taken Outside of Lock: No In-Place Updates
|
||||
----------------------------------------------------------------------
|
||||
|
||||
The best applications are cases where, if reader-writer locking were
|
||||
@@ -26,7 +75,7 @@ added or deleted, rather than being modified in place.
|
||||
|
||||
A straightforward example of this use of RCU may be found in the
|
||||
system-call auditing support. For example, a reader-writer locked
|
||||
implementation of audit_filter_task() might be as follows::
|
||||
implementation of ``audit_filter_task()`` might be as follows::
|
||||
|
||||
static enum audit_state audit_filter_task(struct task_struct *tsk)
|
||||
{
|
||||
@@ -34,7 +83,7 @@ implementation of audit_filter_task() might be as follows::
|
||||
enum audit_state state;
|
||||
|
||||
read_lock(&auditsc_lock);
|
||||
/* Note: audit_netlink_sem held by caller. */
|
||||
/* Note: audit_filter_mutex held by caller. */
|
||||
list_for_each_entry(e, &audit_tsklist, list) {
|
||||
if (audit_filter_rules(tsk, &e->rule, NULL, &state)) {
|
||||
read_unlock(&auditsc_lock);
|
||||
@@ -58,7 +107,7 @@ This means that RCU can be easily applied to the read side, as follows::
|
||||
enum audit_state state;
|
||||
|
||||
rcu_read_lock();
|
||||
/* Note: audit_netlink_sem held by caller. */
|
||||
/* Note: audit_filter_mutex held by caller. */
|
||||
list_for_each_entry_rcu(e, &audit_tsklist, list) {
|
||||
if (audit_filter_rules(tsk, &e->rule, NULL, &state)) {
|
||||
rcu_read_unlock();
|
||||
@@ -69,18 +118,18 @@ This means that RCU can be easily applied to the read side, as follows::
|
||||
return AUDIT_BUILD_CONTEXT;
|
||||
}
|
||||
|
||||
The read_lock() and read_unlock() calls have become rcu_read_lock()
|
||||
The ``read_lock()`` and ``read_unlock()`` calls have become rcu_read_lock()
|
||||
and rcu_read_unlock(), respectively, and the list_for_each_entry() has
|
||||
become list_for_each_entry_rcu(). The _rcu() list-traversal primitives
|
||||
become list_for_each_entry_rcu(). The **_rcu()** list-traversal primitives
|
||||
insert the read-side memory barriers that are required on DEC Alpha CPUs.
|
||||
|
||||
The changes to the update side are also straightforward. A reader-writer
|
||||
lock might be used as follows for deletion and insertion::
|
||||
The changes to the update side are also straightforward. A reader-writer lock
|
||||
might be used as follows for deletion and insertion::
|
||||
|
||||
static inline int audit_del_rule(struct audit_rule *rule,
|
||||
struct list_head *list)
|
||||
{
|
||||
struct audit_entry *e;
|
||||
struct audit_entry *e;
|
||||
|
||||
write_lock(&auditsc_lock);
|
||||
list_for_each_entry(e, list, list) {
|
||||
@@ -113,9 +162,9 @@ Following are the RCU equivalents for these two functions::
|
||||
static inline int audit_del_rule(struct audit_rule *rule,
|
||||
struct list_head *list)
|
||||
{
|
||||
struct audit_entry *e;
|
||||
struct audit_entry *e;
|
||||
|
||||
/* Do not use the _rcu iterator here, since this is the only
|
||||
/* No need to use the _rcu iterator here, since this is the only
|
||||
* deletion routine. */
|
||||
list_for_each_entry(e, list, list) {
|
||||
if (!audit_compare_rule(rule, &e->rule)) {
|
||||
@@ -139,45 +188,45 @@ Following are the RCU equivalents for these two functions::
|
||||
return 0;
|
||||
}
|
||||
|
||||
Normally, the write_lock() and write_unlock() would be replaced by
|
||||
a spin_lock() and a spin_unlock(), but in this case, all callers hold
|
||||
audit_netlink_sem, so no additional locking is required. The auditsc_lock
|
||||
can therefore be eliminated, since use of RCU eliminates the need for
|
||||
writers to exclude readers. Normally, the write_lock() calls would
|
||||
be converted into spin_lock() calls.
|
||||
Normally, the ``write_lock()`` and ``write_unlock()`` would be replaced by a
|
||||
spin_lock() and a spin_unlock(). But in this case, all callers hold
|
||||
``audit_filter_mutex``, so no additional locking is required. The
|
||||
``auditsc_lock`` can therefore be eliminated, since use of RCU eliminates the
|
||||
need for writers to exclude readers.
|
||||
|
||||
The list_del(), list_add(), and list_add_tail() primitives have been
|
||||
replaced by list_del_rcu(), list_add_rcu(), and list_add_tail_rcu().
|
||||
The _rcu() list-manipulation primitives add memory barriers that are
|
||||
needed on weakly ordered CPUs (most of them!). The list_del_rcu()
|
||||
primitive omits the pointer poisoning debug-assist code that would
|
||||
otherwise cause concurrent readers to fail spectacularly.
|
||||
The **_rcu()** list-manipulation primitives add memory barriers that are needed on
|
||||
weakly ordered CPUs (most of them!). The list_del_rcu() primitive omits the
|
||||
pointer poisoning debug-assist code that would otherwise cause concurrent
|
||||
readers to fail spectacularly.
|
||||
|
||||
So, when readers can tolerate stale data and when entries are either added
|
||||
or deleted, without in-place modification, it is very easy to use RCU!
|
||||
So, when readers can tolerate stale data and when entries are either added or
|
||||
deleted, without in-place modification, it is very easy to use RCU!
|
||||
|
||||
Example 2: Handling In-Place Updates
|
||||
|
||||
Example 3: Handling In-Place Updates
|
||||
------------------------------------
|
||||
|
||||
The system-call auditing code does not update auditing rules in place.
|
||||
However, if it did, reader-writer-locked code to do so might look as
|
||||
follows (presumably, the field_count is only permitted to decrease,
|
||||
otherwise, the added fields would need to be filled in)::
|
||||
The system-call auditing code does not update auditing rules in place. However,
|
||||
if it did, the reader-writer-locked code to do so might look as follows
|
||||
(assuming only ``field_count`` is updated, otherwise, the added fields would
|
||||
need to be filled in)::
|
||||
|
||||
static inline int audit_upd_rule(struct audit_rule *rule,
|
||||
struct list_head *list,
|
||||
__u32 newaction,
|
||||
__u32 newfield_count)
|
||||
{
|
||||
struct audit_entry *e;
|
||||
struct audit_newentry *ne;
|
||||
struct audit_entry *e;
|
||||
struct audit_entry *ne;
|
||||
|
||||
write_lock(&auditsc_lock);
|
||||
/* Note: audit_netlink_sem held by caller. */
|
||||
/* Note: audit_filter_mutex held by caller. */
|
||||
list_for_each_entry(e, list, list) {
|
||||
if (!audit_compare_rule(rule, &e->rule)) {
|
||||
e->rule.action = newaction;
|
||||
e->rule.file_count = newfield_count;
|
||||
e->rule.field_count = newfield_count;
|
||||
write_unlock(&auditsc_lock);
|
||||
return 0;
|
||||
}
|
||||
@@ -188,16 +237,16 @@ otherwise, the added fields would need to be filled in)::
|
||||
|
||||
The RCU version creates a copy, updates the copy, then replaces the old
|
||||
entry with the newly updated entry. This sequence of actions, allowing
|
||||
concurrent reads while doing a copy to perform an update, is what gives
|
||||
RCU ("read-copy update") its name. The RCU code is as follows::
|
||||
concurrent reads while making a copy to perform an update, is what gives
|
||||
RCU (*read-copy update*) its name. The RCU code is as follows::
|
||||
|
||||
static inline int audit_upd_rule(struct audit_rule *rule,
|
||||
struct list_head *list,
|
||||
__u32 newaction,
|
||||
__u32 newfield_count)
|
||||
{
|
||||
struct audit_entry *e;
|
||||
struct audit_newentry *ne;
|
||||
struct audit_entry *e;
|
||||
struct audit_entry *ne;
|
||||
|
||||
list_for_each_entry(e, list, list) {
|
||||
if (!audit_compare_rule(rule, &e->rule)) {
|
||||
@@ -206,7 +255,7 @@ RCU ("read-copy update") its name. The RCU code is as follows::
|
||||
return -ENOMEM;
|
||||
audit_copy_rule(&ne->rule, &e->rule);
|
||||
ne->rule.action = newaction;
|
||||
ne->rule.file_count = newfield_count;
|
||||
ne->rule.field_count = newfield_count;
|
||||
list_replace_rcu(&e->list, &ne->list);
|
||||
call_rcu(&e->rcu, audit_free_rule);
|
||||
return 0;
|
||||
@@ -215,34 +264,45 @@ RCU ("read-copy update") its name. The RCU code is as follows::
|
||||
return -EFAULT; /* No matching rule */
|
||||
}
|
||||
|
||||
Again, this assumes that the caller holds audit_netlink_sem. Normally,
|
||||
the reader-writer lock would become a spinlock in this sort of code.
|
||||
Again, this assumes that the caller holds ``audit_filter_mutex``. Normally, the
|
||||
writer lock would become a spinlock in this sort of code.
|
||||
|
||||
Example 3: Eliminating Stale Data
|
||||
Another use of this pattern can be found in the openswitch driver's *connection
|
||||
tracking table* code in ``ct_limit_set()``. The table holds connection tracking
|
||||
entries and has a limit on the maximum entries. There is one such table
|
||||
per-zone and hence one *limit* per zone. The zones are mapped to their limits
|
||||
through a hashtable using an RCU-managed hlist for the hash chains. When a new
|
||||
limit is set, a new limit object is allocated and ``ct_limit_set()`` is called
|
||||
to replace the old limit object with the new one using list_replace_rcu().
|
||||
The old limit object is then freed after a grace period using kfree_rcu().
|
||||
|
||||
|
||||
Example 4: Eliminating Stale Data
|
||||
---------------------------------
|
||||
|
||||
The auditing examples above tolerate stale data, as do most algorithms
|
||||
The auditing example above tolerates stale data, as do most algorithms
|
||||
that are tracking external state. Because there is a delay from the
|
||||
time the external state changes before Linux becomes aware of the change,
|
||||
additional RCU-induced staleness is normally not a problem.
|
||||
additional RCU-induced staleness is generally not a problem.
|
||||
|
||||
However, there are many examples where stale data cannot be tolerated.
|
||||
One example in the Linux kernel is the System V IPC (see the ipc_lock()
|
||||
function in ipc/util.c). This code checks a "deleted" flag under a
|
||||
per-entry spinlock, and, if the "deleted" flag is set, pretends that the
|
||||
One example in the Linux kernel is the System V IPC (see the shm_lock()
|
||||
function in ipc/shm.c). This code checks a *deleted* flag under a
|
||||
per-entry spinlock, and, if the *deleted* flag is set, pretends that the
|
||||
entry does not exist. For this to be helpful, the search function must
|
||||
return holding the per-entry spinlock, as ipc_lock() does in fact do.
|
||||
return holding the per-entry spinlock, as shm_lock() does in fact do.
|
||||
|
||||
.. _quick_quiz:
|
||||
|
||||
Quick Quiz:
|
||||
Why does the search function need to return holding the per-entry lock for
|
||||
this deleted-flag technique to be helpful?
|
||||
For the deleted-flag technique to be helpful, why is it necessary
|
||||
to hold the per-entry lock while returning from the search function?
|
||||
|
||||
:ref:`Answer to Quick Quiz <answer_quick_quiz_list>`
|
||||
:ref:`Answer to Quick Quiz <quick_quiz_answer>`
|
||||
|
||||
If the system-call audit module were to ever need to reject stale data,
|
||||
one way to accomplish this would be to add a "deleted" flag and a "lock"
|
||||
spinlock to the audit_entry structure, and modify audit_filter_task()
|
||||
as follows::
|
||||
If the system-call audit module were to ever need to reject stale data, one way
|
||||
to accomplish this would be to add a ``deleted`` flag and a ``lock`` spinlock to the
|
||||
audit_entry structure, and modify ``audit_filter_task()`` as follows::
|
||||
|
||||
static enum audit_state audit_filter_task(struct task_struct *tsk)
|
||||
{
|
||||
@@ -267,20 +327,20 @@ as follows::
|
||||
}
|
||||
|
||||
Note that this example assumes that entries are only added and deleted.
|
||||
Additional mechanism is required to deal correctly with the
|
||||
update-in-place performed by audit_upd_rule(). For one thing,
|
||||
audit_upd_rule() would need additional memory barriers to ensure
|
||||
that the list_add_rcu() was really executed before the list_del_rcu().
|
||||
Additional mechanism is required to deal correctly with the update-in-place
|
||||
performed by ``audit_upd_rule()``. For one thing, ``audit_upd_rule()`` would
|
||||
need additional memory barriers to ensure that the list_add_rcu() was really
|
||||
executed before the list_del_rcu().
|
||||
|
||||
The audit_del_rule() function would need to set the "deleted"
|
||||
flag under the spinlock as follows::
|
||||
The ``audit_del_rule()`` function would need to set the ``deleted`` flag under the
|
||||
spinlock as follows::
|
||||
|
||||
static inline int audit_del_rule(struct audit_rule *rule,
|
||||
struct list_head *list)
|
||||
{
|
||||
struct audit_entry *e;
|
||||
struct audit_entry *e;
|
||||
|
||||
/* Do not need to use the _rcu iterator here, since this
|
||||
/* No need to use the _rcu iterator here, since this
|
||||
* is the only deletion routine. */
|
||||
list_for_each_entry(e, list, list) {
|
||||
if (!audit_compare_rule(rule, &e->rule)) {
|
||||
@@ -295,6 +355,91 @@ flag under the spinlock as follows::
|
||||
return -EFAULT; /* No matching rule */
|
||||
}
|
||||
|
||||
This too assumes that the caller holds ``audit_filter_mutex``.
|
||||
|
||||
|
||||
Example 5: Skipping Stale Objects
|
||||
---------------------------------
|
||||
|
||||
For some usecases, reader performance can be improved by skipping stale objects
|
||||
during read-side list traversal if the object in concern is pending destruction
|
||||
after one or more grace periods. One such example can be found in the timerfd
|
||||
subsystem. When a ``CLOCK_REALTIME`` clock is reprogrammed - for example due to
|
||||
setting of the system time, then all programmed timerfds that depend on this
|
||||
clock get triggered and processes waiting on them to expire are woken up in
|
||||
advance of their scheduled expiry. To facilitate this, all such timers are added
|
||||
to an RCU-managed ``cancel_list`` when they are setup in
|
||||
``timerfd_setup_cancel()``::
|
||||
|
||||
static void timerfd_setup_cancel(struct timerfd_ctx *ctx, int flags)
|
||||
{
|
||||
spin_lock(&ctx->cancel_lock);
|
||||
if ((ctx->clockid == CLOCK_REALTIME &&
|
||||
(flags & TFD_TIMER_ABSTIME) && (flags & TFD_TIMER_CANCEL_ON_SET)) {
|
||||
if (!ctx->might_cancel) {
|
||||
ctx->might_cancel = true;
|
||||
spin_lock(&cancel_lock);
|
||||
list_add_rcu(&ctx->clist, &cancel_list);
|
||||
spin_unlock(&cancel_lock);
|
||||
}
|
||||
}
|
||||
spin_unlock(&ctx->cancel_lock);
|
||||
}
|
||||
|
||||
When a timerfd is freed (fd is closed), then the ``might_cancel`` flag of the
|
||||
timerfd object is cleared, the object removed from the ``cancel_list`` and
|
||||
destroyed::
|
||||
|
||||
int timerfd_release(struct inode *inode, struct file *file)
|
||||
{
|
||||
struct timerfd_ctx *ctx = file->private_data;
|
||||
|
||||
spin_lock(&ctx->cancel_lock);
|
||||
if (ctx->might_cancel) {
|
||||
ctx->might_cancel = false;
|
||||
spin_lock(&cancel_lock);
|
||||
list_del_rcu(&ctx->clist);
|
||||
spin_unlock(&cancel_lock);
|
||||
}
|
||||
spin_unlock(&ctx->cancel_lock);
|
||||
|
||||
hrtimer_cancel(&ctx->t.tmr);
|
||||
kfree_rcu(ctx, rcu);
|
||||
return 0;
|
||||
}
|
||||
|
||||
If the ``CLOCK_REALTIME`` clock is set, for example by a time server, the
|
||||
hrtimer framework calls ``timerfd_clock_was_set()`` which walks the
|
||||
``cancel_list`` and wakes up processes waiting on the timerfd. While iterating
|
||||
the ``cancel_list``, the ``might_cancel`` flag is consulted to skip stale
|
||||
objects::
|
||||
|
||||
void timerfd_clock_was_set(void)
|
||||
{
|
||||
struct timerfd_ctx *ctx;
|
||||
unsigned long flags;
|
||||
|
||||
rcu_read_lock();
|
||||
list_for_each_entry_rcu(ctx, &cancel_list, clist) {
|
||||
if (!ctx->might_cancel)
|
||||
continue;
|
||||
spin_lock_irqsave(&ctx->wqh.lock, flags);
|
||||
if (ctx->moffs != ktime_mono_to_real(0)) {
|
||||
ctx->moffs = KTIME_MAX;
|
||||
ctx->ticks++;
|
||||
wake_up_locked_poll(&ctx->wqh, EPOLLIN);
|
||||
}
|
||||
spin_unlock_irqrestore(&ctx->wqh.lock, flags);
|
||||
}
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
The key point here is, because RCU-traversal of the ``cancel_list`` happens
|
||||
while objects are being added and removed to the list, sometimes the traversal
|
||||
can step on an object that has been removed from the list. In this example, it
|
||||
is seen that it is better to skip such objects using a flag.
|
||||
|
||||
|
||||
Summary
|
||||
-------
|
||||
|
||||
@@ -303,19 +448,21 @@ the most amenable to use of RCU. The simplest case is where entries are
|
||||
either added or deleted from the data structure (or atomically modified
|
||||
in place), but non-atomic in-place modifications can be handled by making
|
||||
a copy, updating the copy, then replacing the original with the copy.
|
||||
If stale data cannot be tolerated, then a "deleted" flag may be used
|
||||
If stale data cannot be tolerated, then a *deleted* flag may be used
|
||||
in conjunction with a per-entry spinlock in order to allow the search
|
||||
function to reject newly deleted data.
|
||||
|
||||
.. _answer_quick_quiz_list:
|
||||
.. _quick_quiz_answer:
|
||||
|
||||
Answer to Quick Quiz:
|
||||
Why does the search function need to return holding the per-entry
|
||||
lock for this deleted-flag technique to be helpful?
|
||||
For the deleted-flag technique to be helpful, why is it necessary
|
||||
to hold the per-entry lock while returning from the search function?
|
||||
|
||||
If the search function drops the per-entry lock before returning,
|
||||
then the caller will be processing stale data in any case. If it
|
||||
is really OK to be processing stale data, then you don't need a
|
||||
"deleted" flag. If processing stale data really is a problem,
|
||||
*deleted* flag. If processing stale data really is a problem,
|
||||
then you need to hold the per-entry lock across all of the code
|
||||
that uses the value that was returned.
|
||||
|
||||
:ref:`Back to Quick Quiz <quick_quiz>`
|
||||
|
||||
@@ -11,8 +11,8 @@ must be long enough that any readers accessing the item being deleted have
|
||||
since dropped their references. For example, an RCU-protected deletion
|
||||
from a linked list would first remove the item from the list, wait for
|
||||
a grace period to elapse, then free the element. See the
|
||||
Documentation/RCU/listRCU.rst file for more information on using RCU with
|
||||
linked lists.
|
||||
:ref:`Documentation/RCU/listRCU.rst <list_rcu_doc>` for more information on
|
||||
using RCU with linked lists.
|
||||
|
||||
Frequently Asked Questions
|
||||
--------------------------
|
||||
@@ -50,7 +50,7 @@ Frequently Asked Questions
|
||||
- If I am running on a uniprocessor kernel, which can only do one
|
||||
thing at a time, why should I wait for a grace period?
|
||||
|
||||
See the Documentation/RCU/UP.rst file for more information.
|
||||
See :ref:`Documentation/RCU/UP.rst <up_doc>` for more information.
|
||||
|
||||
- How can I see where RCU is currently used in the Linux kernel?
|
||||
|
||||
@@ -68,18 +68,18 @@ Frequently Asked Questions
|
||||
|
||||
- Why the name "RCU"?
|
||||
|
||||
"RCU" stands for "read-copy update". The file Documentation/RCU/listRCU.rst
|
||||
has more information on where this name came from, search for
|
||||
"read-copy update" to find it.
|
||||
"RCU" stands for "read-copy update".
|
||||
:ref:`Documentation/RCU/listRCU.rst <list_rcu_doc>` has more information on where
|
||||
this name came from, search for "read-copy update" to find it.
|
||||
|
||||
- I hear that RCU is patented? What is with that?
|
||||
|
||||
Yes, it is. There are several known patents related to RCU,
|
||||
search for the string "Patent" in RTFP.txt to find them.
|
||||
search for the string "Patent" in Documentation/RCU/RTFP.txt to find them.
|
||||
Of these, one was allowed to lapse by the assignee, and the
|
||||
others have been contributed to the Linux kernel under GPL.
|
||||
There are now also LGPL implementations of user-level RCU
|
||||
available (http://liburcu.org/).
|
||||
available (https://liburcu.org/).
|
||||
|
||||
- I hear that RCU needs work in order to support realtime kernels?
|
||||
|
||||
@@ -88,5 +88,5 @@ Frequently Asked Questions
|
||||
|
||||
- Where can I find more information on RCU?
|
||||
|
||||
See the RTFP.txt file in this directory.
|
||||
See the Documentation/RCU/RTFP.txt file.
|
||||
Or point your browser at (http://www.rdrop.com/users/paulmck/RCU/).
|
||||
|
||||
@@ -124,9 +124,14 @@ using a dynamically allocated srcu_struct (hence "srcud-" rather than
|
||||
debugging. The final "T" entry contains the totals of the counters.
|
||||
|
||||
|
||||
USAGE
|
||||
USAGE ON SPECIFIC KERNEL BUILDS
|
||||
|
||||
The following script may be used to torture RCU:
|
||||
It is sometimes desirable to torture RCU on a specific kernel build,
|
||||
for example, when preparing to put that kernel build into production.
|
||||
In that case, the kernel should be built with CONFIG_RCU_TORTURE_TEST=m
|
||||
so that the test can be started using modprobe and terminated using rmmod.
|
||||
|
||||
For example, the following script may be used to torture RCU:
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
@@ -142,8 +147,136 @@ checked for such errors. The "rmmod" command forces a "SUCCESS",
|
||||
two are self-explanatory, while the last indicates that while there
|
||||
were no RCU failures, CPU-hotplug problems were detected.
|
||||
|
||||
However, the tools/testing/selftests/rcutorture/bin/kvm.sh script
|
||||
provides better automation, including automatic failure analysis.
|
||||
It assumes a qemu/kvm-enabled platform, and runs guest OSes out of initrd.
|
||||
See tools/testing/selftests/rcutorture/doc/initrd.txt for instructions
|
||||
on setting up such an initrd.
|
||||
|
||||
USAGE ON MAINLINE KERNELS
|
||||
|
||||
When using rcutorture to test changes to RCU itself, it is often
|
||||
necessary to build a number of kernels in order to test that change
|
||||
across a broad range of combinations of the relevant Kconfig options
|
||||
and of the relevant kernel boot parameters. In this situation, use
|
||||
of modprobe and rmmod can be quite time-consuming and error-prone.
|
||||
|
||||
Therefore, the tools/testing/selftests/rcutorture/bin/kvm.sh
|
||||
script is available for mainline testing for x86, arm64, and
|
||||
powerpc. By default, it will run the series of tests specified by
|
||||
tools/testing/selftests/rcutorture/configs/rcu/CFLIST, with each test
|
||||
running for 30 minutes within a guest OS using a minimal userspace
|
||||
supplied by an automatically generated initrd. After the tests are
|
||||
complete, the resulting build products and console output are analyzed
|
||||
for errors and the results of the runs are summarized.
|
||||
|
||||
On larger systems, rcutorture testing can be accelerated by passing the
|
||||
--cpus argument to kvm.sh. For example, on a 64-CPU system, "--cpus 43"
|
||||
would use up to 43 CPUs to run tests concurrently, which as of v5.4 would
|
||||
complete all the scenarios in two batches, reducing the time to complete
|
||||
from about eight hours to about one hour (not counting the time to build
|
||||
the sixteen kernels). The "--dryrun sched" argument will not run tests,
|
||||
but rather tell you how the tests would be scheduled into batches. This
|
||||
can be useful when working out how many CPUs to specify in the --cpus
|
||||
argument.
|
||||
|
||||
Not all changes require that all scenarios be run. For example, a change
|
||||
to Tree SRCU might run only the SRCU-N and SRCU-P scenarios using the
|
||||
--configs argument to kvm.sh as follows: "--configs 'SRCU-N SRCU-P'".
|
||||
Large systems can run multiple copies of of the full set of scenarios,
|
||||
for example, a system with 448 hardware threads can run five instances
|
||||
of the full set concurrently. To make this happen:
|
||||
|
||||
kvm.sh --cpus 448 --configs '5*CFLIST'
|
||||
|
||||
Alternatively, such a system can run 56 concurrent instances of a single
|
||||
eight-CPU scenario:
|
||||
|
||||
kvm.sh --cpus 448 --configs '56*TREE04'
|
||||
|
||||
Or 28 concurrent instances of each of two eight-CPU scenarios:
|
||||
|
||||
kvm.sh --cpus 448 --configs '28*TREE03 28*TREE04'
|
||||
|
||||
Of course, each concurrent instance will use memory, which can be
|
||||
limited using the --memory argument, which defaults to 512M. Small
|
||||
values for memory may require disabling the callback-flooding tests
|
||||
using the --bootargs parameter discussed below.
|
||||
|
||||
Sometimes additional debugging is useful, and in such cases the --kconfig
|
||||
parameter to kvm.sh may be used, for example, "--kconfig 'CONFIG_KASAN=y'".
|
||||
|
||||
Kernel boot arguments can also be supplied, for example, to control
|
||||
rcutorture's module parameters. For example, to test a change to RCU's
|
||||
CPU stall-warning code, use "--bootargs 'rcutorture.stall_cpu=30'".
|
||||
This will of course result in the scripting reporting a failure, namely
|
||||
the resuling RCU CPU stall warning. As noted above, reducing memory may
|
||||
require disabling rcutorture's callback-flooding tests:
|
||||
|
||||
kvm.sh --cpus 448 --configs '56*TREE04' --memory 128M \
|
||||
--bootargs 'rcutorture.fwd_progress=0'
|
||||
|
||||
Sometimes all that is needed is a full set of kernel builds. This is
|
||||
what the --buildonly argument does.
|
||||
|
||||
Finally, the --trust-make argument allows each kernel build to reuse what
|
||||
it can from the previous kernel build.
|
||||
|
||||
There are additional more arcane arguments that are documented in the
|
||||
source code of the kvm.sh script.
|
||||
|
||||
If a run contains failures, the number of buildtime and runtime failures
|
||||
is listed at the end of the kvm.sh output, which you really should redirect
|
||||
to a file. The build products and console output of each run is kept in
|
||||
tools/testing/selftests/rcutorture/res in timestamped directories. A
|
||||
given directory can be supplied to kvm-find-errors.sh in order to have
|
||||
it cycle you through summaries of errors and full error logs. For example:
|
||||
|
||||
tools/testing/selftests/rcutorture/bin/kvm-find-errors.sh \
|
||||
tools/testing/selftests/rcutorture/res/2020.01.20-15.54.23
|
||||
|
||||
However, it is often more convenient to access the files directly.
|
||||
Files pertaining to all scenarios in a run reside in the top-level
|
||||
directory (2020.01.20-15.54.23 in the example above), while per-scenario
|
||||
files reside in a subdirectory named after the scenario (for example,
|
||||
"TREE04"). If a given scenario ran more than once (as in "--configs
|
||||
'56*TREE04'" above), the directories corresponding to the second and
|
||||
subsequent runs of that scenario include a sequence number, for example,
|
||||
"TREE04.2", "TREE04.3", and so on.
|
||||
|
||||
The most frequently used file in the top-level directory is testid.txt.
|
||||
If the test ran in a git repository, then this file contains the commit
|
||||
that was tested and any uncommitted changes in diff format.
|
||||
|
||||
The most frequently used files in each per-scenario-run directory are:
|
||||
|
||||
.config: This file contains the Kconfig options.
|
||||
|
||||
Make.out: This contains build output for a specific scenario.
|
||||
|
||||
console.log: This contains the console output for a specific scenario.
|
||||
This file may be examined once the kernel has booted, but
|
||||
it might not exist if the build failed.
|
||||
|
||||
vmlinux: This contains the kernel, which can be useful with tools like
|
||||
objdump and gdb.
|
||||
|
||||
A number of additional files are available, but are less frequently used.
|
||||
Many are intended for debugging of rcutorture itself or of its scripting.
|
||||
|
||||
As of v5.4, a successful run with the default set of scenarios produces
|
||||
the following summary at the end of the run on a 12-CPU system:
|
||||
|
||||
SRCU-N ------- 804233 GPs (148.932/s) [srcu: g10008272 f0x0 ]
|
||||
SRCU-P ------- 202320 GPs (37.4667/s) [srcud: g1809476 f0x0 ]
|
||||
SRCU-t ------- 1122086 GPs (207.794/s) [srcu: g0 f0x0 ]
|
||||
SRCU-u ------- 1111285 GPs (205.794/s) [srcud: g1 f0x0 ]
|
||||
TASKS01 ------- 19666 GPs (3.64185/s) [tasks: g0 f0x0 ]
|
||||
TASKS02 ------- 20541 GPs (3.80389/s) [tasks: g0 f0x0 ]
|
||||
TASKS03 ------- 19416 GPs (3.59556/s) [tasks: g0 f0x0 ]
|
||||
TINY01 ------- 836134 GPs (154.84/s) [rcu: g0 f0x0 ] n_max_cbs: 34198
|
||||
TINY02 ------- 850371 GPs (157.476/s) [rcu: g0 f0x0 ] n_max_cbs: 2631
|
||||
TREE01 ------- 162625 GPs (30.1157/s) [rcu: g1124169 f0x0 ]
|
||||
TREE02 ------- 333003 GPs (61.6672/s) [rcu: g2647753 f0x0 ] n_max_cbs: 35844
|
||||
TREE03 ------- 306623 GPs (56.782/s) [rcu: g2975325 f0x0 ] n_max_cbs: 1496497
|
||||
CPU count limited from 16 to 12
|
||||
TREE04 ------- 246149 GPs (45.5831/s) [rcu: g1695737 f0x0 ] n_max_cbs: 434961
|
||||
TREE05 ------- 314603 GPs (58.2598/s) [rcu: g2257741 f0x2 ] n_max_cbs: 193997
|
||||
TREE07 ------- 167347 GPs (30.9902/s) [rcu: g1079021 f0x0 ] n_max_cbs: 478732
|
||||
CPU count limited from 16 to 12
|
||||
TREE09 ------- 752238 GPs (139.303/s) [rcu: g13075057 f0x0 ] n_max_cbs: 99011
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
.. _psi:
|
||||
|
||||
================================
|
||||
PSI - Pressure Stall Information
|
||||
================================
|
||||
|
||||
@@ -18,7 +18,7 @@ may look as follows::
|
||||
|
||||
$ ls -l /sys/bus/acpi/devices/INT3404:00/
|
||||
total 0
|
||||
...
|
||||
...
|
||||
-r--r--r-- 1 root root 4096 Dec 13 20:38 state0
|
||||
-r--r--r-- 1 root root 4096 Dec 13 20:38 state1
|
||||
-r--r--r-- 1 root root 4096 Dec 13 20:38 state10
|
||||
@@ -38,7 +38,7 @@ where each of the "state*" files represents one performance state of the fan
|
||||
and contains a colon-separated list of 5 integer numbers (fields) with the
|
||||
following interpretation::
|
||||
|
||||
control_percent:trip_point_index:speed_rpm:noise_level_mdb:power_mw
|
||||
control_percent:trip_point_index:speed_rpm:noise_level_mdb:power_mw
|
||||
|
||||
* ``control_percent``: The percent value to be used to set the fan speed to a
|
||||
specific level using the _FSL object (0-100).
|
||||
|
||||
@@ -33,6 +33,12 @@ max
|
||||
a per-instance limit. If ``max=<count>`` is set then only ``<count>`` number
|
||||
of binder devices can be allocated in this binderfs instance.
|
||||
|
||||
stats
|
||||
Using ``stats=global`` enables global binder statistics.
|
||||
``stats=global`` is only available for a binderfs instance mounted in the
|
||||
initial user namespace. An attempt to use the option to mount a binderfs
|
||||
instance in another user namespace will return a permission error.
|
||||
|
||||
Allocating binder Devices
|
||||
-------------------------
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Kernel Support for miscellaneous (your favourite) Binary Formats v1.1
|
||||
=====================================================================
|
||||
Kernel Support for miscellaneous Binary Formats (binfmt_misc)
|
||||
=============================================================
|
||||
|
||||
This Kernel feature allows you to invoke almost (for restrictions see below)
|
||||
every program by simply typing its name in the shell.
|
||||
@@ -140,8 +140,8 @@ Hints
|
||||
-----
|
||||
|
||||
If you want to pass special arguments to your interpreter, you can
|
||||
write a wrapper script for it. See Documentation/admin-guide/java.rst for an
|
||||
example.
|
||||
write a wrapper script for it.
|
||||
See :doc:`Documentation/admin-guide/java.rst <./java>` for an example.
|
||||
|
||||
Your interpreter should NOT look in the PATH for the filename; the kernel
|
||||
passes it the full filename (or the file descriptor) to use. Using ``$PATH`` can
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
========================================
|
||||
zram: Compressed RAM based block devices
|
||||
zram: Compressed RAM-based block devices
|
||||
========================================
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
The zram module creates RAM based block devices named /dev/zram<id>
|
||||
The zram module creates RAM-based block devices named /dev/zram<id>
|
||||
(<id> = 0, 1, ...). Pages written to these disks are compressed and stored
|
||||
in memory itself. These disks allow very fast I/O and compression provides
|
||||
good amounts of memory savings. Some of the usecases include /tmp storage,
|
||||
use as swap disks, various caches under /var and maybe many more :)
|
||||
good amounts of memory savings. Some of the use cases include /tmp storage,
|
||||
use as swap disks, various caches under /var and maybe many more. :)
|
||||
|
||||
Statistics for individual zram devices are exported through sysfs nodes at
|
||||
/sys/block/zram<id>/
|
||||
@@ -43,17 +43,17 @@ The list of possible return codes:
|
||||
|
||||
======== =============================================================
|
||||
-EBUSY an attempt to modify an attribute that cannot be changed once
|
||||
the device has been initialised. Please reset device first;
|
||||
the device has been initialised. Please reset device first.
|
||||
-ENOMEM zram was not able to allocate enough memory to fulfil your
|
||||
needs;
|
||||
needs.
|
||||
-EINVAL invalid input has been provided.
|
||||
======== =============================================================
|
||||
|
||||
If you use 'echo', the returned value that is changed by 'echo' utility,
|
||||
If you use 'echo', the returned value is set by the 'echo' utility,
|
||||
and, in general case, something like::
|
||||
|
||||
echo 3 > /sys/block/zram0/max_comp_streams
|
||||
if [ $? -ne 0 ];
|
||||
if [ $? -ne 0 ]; then
|
||||
handle_error
|
||||
fi
|
||||
|
||||
@@ -65,7 +65,8 @@ should suffice.
|
||||
::
|
||||
|
||||
modprobe zram num_devices=4
|
||||
This creates 4 devices: /dev/zram{0,1,2,3}
|
||||
|
||||
This creates 4 devices: /dev/zram{0,1,2,3}
|
||||
|
||||
num_devices parameter is optional and tells zram how many devices should be
|
||||
pre-created. Default: 1.
|
||||
@@ -73,12 +74,12 @@ pre-created. Default: 1.
|
||||
2) Set max number of compression streams
|
||||
========================================
|
||||
|
||||
Regardless the value passed to this attribute, ZRAM will always
|
||||
allocate multiple compression streams - one per online CPUs - thus
|
||||
Regardless of the value passed to this attribute, ZRAM will always
|
||||
allocate multiple compression streams - one per online CPU - thus
|
||||
allowing several concurrent compression operations. The number of
|
||||
allocated compression streams goes down when some of the CPUs
|
||||
become offline. There is no single-compression-stream mode anymore,
|
||||
unless you are running a UP system or has only 1 CPU online.
|
||||
unless you are running a UP system or have only 1 CPU online.
|
||||
|
||||
To find out how many streams are currently available::
|
||||
|
||||
@@ -89,7 +90,7 @@ To find out how many streams are currently available::
|
||||
|
||||
Using comp_algorithm device attribute one can see available and
|
||||
currently selected (shown in square brackets) compression algorithms,
|
||||
change selected compression algorithm (once the device is initialised
|
||||
or change the selected compression algorithm (once the device is initialised
|
||||
there is no way to change compression algorithm).
|
||||
|
||||
Examples::
|
||||
@@ -167,9 +168,9 @@ Examples::
|
||||
zram provides a control interface, which enables dynamic (on-demand) device
|
||||
addition and removal.
|
||||
|
||||
In order to add a new /dev/zramX device, perform read operation on hot_add
|
||||
attribute. This will return either new device's device id (meaning that you
|
||||
can use /dev/zram<id>) or error code.
|
||||
In order to add a new /dev/zramX device, perform a read operation on the hot_add
|
||||
attribute. This will return either the new device's device id (meaning that you
|
||||
can use /dev/zram<id>) or an error code.
|
||||
|
||||
Example::
|
||||
|
||||
@@ -186,8 +187,8 @@ execute::
|
||||
|
||||
Per-device statistics are exported as various nodes under /sys/block/zram<id>/
|
||||
|
||||
A brief description of exported device attributes. For more details please
|
||||
read Documentation/ABI/testing/sysfs-block-zram.
|
||||
A brief description of exported device attributes follows. For more details
|
||||
please read Documentation/ABI/testing/sysfs-block-zram.
|
||||
|
||||
====================== ====== ===============================================
|
||||
Name access description
|
||||
@@ -245,13 +246,11 @@ whitespace:
|
||||
|
||||
File /sys/block/zram<id>/mm_stat
|
||||
|
||||
The stat file represents device's mm statistics. It consists of a single
|
||||
The mm_stat file represents the device's mm statistics. It consists of a single
|
||||
line of text and contains the following stats separated by whitespace:
|
||||
|
||||
================ =============================================================
|
||||
orig_data_size uncompressed size of data stored in this disk.
|
||||
This excludes same-element-filled pages (same_pages) since
|
||||
no memory is allocated for them.
|
||||
Unit: bytes
|
||||
compr_data_size compressed size of data stored in this disk
|
||||
mem_used_total the amount of memory allocated for this disk. This
|
||||
@@ -261,7 +260,7 @@ line of text and contains the following stats separated by whitespace:
|
||||
Unit: bytes
|
||||
mem_limit the maximum amount of memory ZRAM can use to store
|
||||
the compressed data
|
||||
mem_used_max the maximum amount of memory zram have consumed to
|
||||
mem_used_max the maximum amount of memory zram has consumed to
|
||||
store the data
|
||||
same_pages the number of same element filled pages written to this disk.
|
||||
No memory is allocated for such pages.
|
||||
@@ -271,7 +270,7 @@ line of text and contains the following stats separated by whitespace:
|
||||
|
||||
File /sys/block/zram<id>/bd_stat
|
||||
|
||||
The stat file represents device's backing device statistics. It consists of
|
||||
The bd_stat file represents a device's backing device statistics. It consists of
|
||||
a single line of text and contains the following stats separated by whitespace:
|
||||
|
||||
============== =============================================================
|
||||
@@ -316,9 +315,9 @@ To use the feature, admin should set up backing device via::
|
||||
echo /dev/sda5 > /sys/block/zramX/backing_dev
|
||||
|
||||
before disksize setting. It supports only partition at this moment.
|
||||
If admin want to use incompressible page writeback, they could do via::
|
||||
If admin wants to use incompressible page writeback, they could do via::
|
||||
|
||||
echo huge > /sys/block/zramX/write
|
||||
echo huge > /sys/block/zramX/writeback
|
||||
|
||||
To use idle page writeback, first, user need to declare zram pages
|
||||
as idle::
|
||||
@@ -326,7 +325,7 @@ as idle::
|
||||
echo all > /sys/block/zramX/idle
|
||||
|
||||
From now on, any pages on zram are idle pages. The idle mark
|
||||
will be removed until someone request access of the block.
|
||||
will be removed until someone requests access of the block.
|
||||
IOW, unless there is access request, those pages are still idle pages.
|
||||
|
||||
Admin can request writeback of those idle pages at right timing via::
|
||||
@@ -341,16 +340,16 @@ to guarantee storage health for entire product life.
|
||||
|
||||
To overcome the concern, zram supports "writeback_limit" feature.
|
||||
The "writeback_limit_enable"'s default value is 0 so that it doesn't limit
|
||||
any writeback. IOW, if admin want to apply writeback budget, he should
|
||||
any writeback. IOW, if admin wants to apply writeback budget, he should
|
||||
enable writeback_limit_enable via::
|
||||
|
||||
$ echo 1 > /sys/block/zramX/writeback_limit_enable
|
||||
|
||||
Once writeback_limit_enable is set, zram doesn't allow any writeback
|
||||
until admin set the budget via /sys/block/zramX/writeback_limit.
|
||||
until admin sets the budget via /sys/block/zramX/writeback_limit.
|
||||
|
||||
(If admin doesn't enable writeback_limit_enable, writeback_limit's value
|
||||
assigned via /sys/block/zramX/writeback_limit is meaninless.)
|
||||
assigned via /sys/block/zramX/writeback_limit is meaningless.)
|
||||
|
||||
If admin want to limit writeback as per-day 400M, he could do it
|
||||
like below::
|
||||
@@ -361,13 +360,13 @@ like below::
|
||||
/sys/block/zram0/writeback_limit.
|
||||
$ echo 1 > /sys/block/zram0/writeback_limit_enable
|
||||
|
||||
If admin want to allow further write again once the bugdet is exausted,
|
||||
If admins want to allow further write again once the bugdet is exhausted,
|
||||
he could do it like below::
|
||||
|
||||
$ echo $((400<<MB_SHIFT>>4K_SHIFT)) > \
|
||||
/sys/block/zram0/writeback_limit
|
||||
|
||||
If admin want to see remaining writeback budget since he set::
|
||||
If admin wants to see remaining writeback budget since last set::
|
||||
|
||||
$ cat /sys/block/zramX/writeback_limit
|
||||
|
||||
@@ -375,12 +374,12 @@ If admin want to disable writeback limit, he could do::
|
||||
|
||||
$ echo 0 > /sys/block/zramX/writeback_limit_enable
|
||||
|
||||
The writeback_limit count will reset whenever you reset zram(e.g.,
|
||||
The writeback_limit count will reset whenever you reset zram (e.g.,
|
||||
system reboot, echo 1 > /sys/block/zramX/reset) so keeping how many of
|
||||
writeback happened until you reset the zram to allocate extra writeback
|
||||
budget in next setting is user's job.
|
||||
|
||||
If admin want to measure writeback count in a certain period, he could
|
||||
If admin wants to measure writeback count in a certain period, he could
|
||||
know it via /sys/block/zram0/bd_stat's 3rd column.
|
||||
|
||||
memory tracking
|
||||
|
||||
@@ -0,0 +1,218 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
.. _bootconfig:
|
||||
|
||||
==================
|
||||
Boot Configuration
|
||||
==================
|
||||
|
||||
:Author: Masami Hiramatsu <mhiramat@kernel.org>
|
||||
|
||||
Overview
|
||||
========
|
||||
|
||||
The boot configuration expands the current kernel command line to support
|
||||
additional key-value data when booting the kernel in an efficient way.
|
||||
This allows administrators to pass a structured-Key config file.
|
||||
|
||||
Config File Syntax
|
||||
==================
|
||||
|
||||
The boot config syntax is a simple structured key-value. Each key consists
|
||||
of dot-connected-words, and key and value are connected by ``=``. The value
|
||||
has to be terminated by semi-colon (``;``) or newline (``\n``).
|
||||
For array value, array entries are separated by comma (``,``). ::
|
||||
|
||||
KEY[.WORD[...]] = VALUE[, VALUE2[...]][;]
|
||||
|
||||
Unlike the kernel command line syntax, spaces are OK around the comma and ``=``.
|
||||
|
||||
Each key word must contain only alphabets, numbers, dash (``-``) or underscore
|
||||
(``_``). And each value only contains printable characters or spaces except
|
||||
for delimiters such as semi-colon (``;``), new-line (``\n``), comma (``,``),
|
||||
hash (``#``) and closing brace (``}``).
|
||||
|
||||
If you want to use those delimiters in a value, you can use either double-
|
||||
quotes (``"VALUE"``) or single-quotes (``'VALUE'``) to quote it. Note that
|
||||
you can not escape these quotes.
|
||||
|
||||
There can be a key which doesn't have value or has an empty value. Those keys
|
||||
are used for checking if the key exists or not (like a boolean).
|
||||
|
||||
Key-Value Syntax
|
||||
----------------
|
||||
|
||||
The boot config file syntax allows user to merge partially same word keys
|
||||
by brace. For example::
|
||||
|
||||
foo.bar.baz = value1
|
||||
foo.bar.qux.quux = value2
|
||||
|
||||
These can be written also in::
|
||||
|
||||
foo.bar {
|
||||
baz = value1
|
||||
qux.quux = value2
|
||||
}
|
||||
|
||||
Or more shorter, written as following::
|
||||
|
||||
foo.bar { baz = value1; qux.quux = value2 }
|
||||
|
||||
In both styles, same key words are automatically merged when parsing it
|
||||
at boot time. So you can append similar trees or key-values.
|
||||
|
||||
Same-key Values
|
||||
---------------
|
||||
|
||||
It is prohibited that two or more values or arrays share a same-key.
|
||||
For example,::
|
||||
|
||||
foo = bar, baz
|
||||
foo = qux # !ERROR! we can not re-define same key
|
||||
|
||||
If you want to append the value to existing key as an array member,
|
||||
you can use ``+=`` operator. For example::
|
||||
|
||||
foo = bar, baz
|
||||
foo += qux
|
||||
|
||||
In this case, the key ``foo`` has ``bar``, ``baz`` and ``qux``.
|
||||
|
||||
However, a sub-key and a value can not co-exist under a parent key.
|
||||
For example, following config is NOT allowed.::
|
||||
|
||||
foo = value1
|
||||
foo.bar = value2 # !ERROR! subkey "bar" and value "value1" can NOT co-exist
|
||||
|
||||
|
||||
Comments
|
||||
--------
|
||||
|
||||
The config syntax accepts shell-script style comments. The comments starting
|
||||
with hash ("#") until newline ("\n") will be ignored.
|
||||
|
||||
::
|
||||
|
||||
# comment line
|
||||
foo = value # value is set to foo.
|
||||
bar = 1, # 1st element
|
||||
2, # 2nd element
|
||||
3 # 3rd element
|
||||
|
||||
This is parsed as below::
|
||||
|
||||
foo = value
|
||||
bar = 1, 2, 3
|
||||
|
||||
Note that you can not put a comment between value and delimiter(``,`` or
|
||||
``;``). This means following config has a syntax error ::
|
||||
|
||||
key = 1 # comment
|
||||
,2
|
||||
|
||||
|
||||
/proc/bootconfig
|
||||
================
|
||||
|
||||
/proc/bootconfig is a user-space interface of the boot config.
|
||||
Unlike /proc/cmdline, this file shows the key-value style list.
|
||||
Each key-value pair is shown in each line with following style::
|
||||
|
||||
KEY[.WORDS...] = "[VALUE]"[,"VALUE2"...]
|
||||
|
||||
|
||||
Boot Kernel With a Boot Config
|
||||
==============================
|
||||
|
||||
Since the boot configuration file is loaded with initrd, it will be added
|
||||
to the end of the initrd (initramfs) image file with size, checksum and
|
||||
12-byte magic word as below.
|
||||
|
||||
[initrd][bootconfig][size(u32)][checksum(u32)][#BOOTCONFIG\n]
|
||||
|
||||
The Linux kernel decodes the last part of the initrd image in memory to
|
||||
get the boot configuration data.
|
||||
Because of this "piggyback" method, there is no need to change or
|
||||
update the boot loader and the kernel image itself.
|
||||
|
||||
To do this operation, Linux kernel provides "bootconfig" command under
|
||||
tools/bootconfig, which allows admin to apply or delete the config file
|
||||
to/from initrd image. You can build it by the following command::
|
||||
|
||||
# make -C tools/bootconfig
|
||||
|
||||
To add your boot config file to initrd image, run bootconfig as below
|
||||
(Old data is removed automatically if exists)::
|
||||
|
||||
# tools/bootconfig/bootconfig -a your-config /boot/initrd.img-X.Y.Z
|
||||
|
||||
To remove the config from the image, you can use -d option as below::
|
||||
|
||||
# tools/bootconfig/bootconfig -d /boot/initrd.img-X.Y.Z
|
||||
|
||||
Then add "bootconfig" on the normal kernel command line to tell the
|
||||
kernel to look for the bootconfig at the end of the initrd file.
|
||||
|
||||
Config File Limitation
|
||||
======================
|
||||
|
||||
Currently the maximum config size size is 32KB and the total key-words (not
|
||||
key-value entries) must be under 1024 nodes.
|
||||
Note: this is not the number of entries but nodes, an entry must consume
|
||||
more than 2 nodes (a key-word and a value). So theoretically, it will be
|
||||
up to 512 key-value pairs. If keys contains 3 words in average, it can
|
||||
contain 256 key-value pairs. In most cases, the number of config items
|
||||
will be under 100 entries and smaller than 8KB, so it would be enough.
|
||||
If the node number exceeds 1024, parser returns an error even if the file
|
||||
size is smaller than 32KB.
|
||||
Anyway, since bootconfig command verifies it when appending a boot config
|
||||
to initrd image, user can notice it before boot.
|
||||
|
||||
|
||||
Bootconfig APIs
|
||||
===============
|
||||
|
||||
User can query or loop on key-value pairs, also it is possible to find
|
||||
a root (prefix) key node and find key-values under that node.
|
||||
|
||||
If you have a key string, you can query the value directly with the key
|
||||
using xbc_find_value(). If you want to know what keys exist in the boot
|
||||
config, you can use xbc_for_each_key_value() to iterate key-value pairs.
|
||||
Note that you need to use xbc_array_for_each_value() for accessing
|
||||
each array's value, e.g.::
|
||||
|
||||
vnode = NULL;
|
||||
xbc_find_value("key.word", &vnode);
|
||||
if (vnode && xbc_node_is_array(vnode))
|
||||
xbc_array_for_each_value(vnode, value) {
|
||||
printk("%s ", value);
|
||||
}
|
||||
|
||||
If you want to focus on keys which have a prefix string, you can use
|
||||
xbc_find_node() to find a node by the prefix string, and iterate
|
||||
keys under the prefix node with xbc_node_for_each_key_value().
|
||||
|
||||
But the most typical usage is to get the named value under prefix
|
||||
or get the named array under prefix as below::
|
||||
|
||||
root = xbc_find_node("key.prefix");
|
||||
value = xbc_node_find_value(root, "option", &vnode);
|
||||
...
|
||||
xbc_node_for_each_array_value(root, "array-option", value, anode) {
|
||||
...
|
||||
}
|
||||
|
||||
This accesses a value of "key.prefix.option" and an array of
|
||||
"key.prefix.array-option".
|
||||
|
||||
Locking is not needed, since after initialization, the config becomes
|
||||
read-only. All data and keys must be copied if you need to modify it.
|
||||
|
||||
|
||||
Functions and structures
|
||||
========================
|
||||
|
||||
.. kernel-doc:: include/linux/bootconfig.h
|
||||
.. kernel-doc:: lib/bootconfig.c
|
||||
|
||||
@@ -223,6 +223,17 @@ cpu_online_mask using a CPU hotplug notifier, and the mems file
|
||||
automatically tracks the value of node_states[N_MEMORY]--i.e.,
|
||||
nodes with memory--using the cpuset_track_online_nodes() hook.
|
||||
|
||||
The cpuset.effective_cpus and cpuset.effective_mems files are
|
||||
normally read-only copies of cpuset.cpus and cpuset.mems files
|
||||
respectively. If the cpuset cgroup filesystem is mounted with the
|
||||
special "cpuset_v2_mode" option, the behavior of these files will become
|
||||
similar to the corresponding files in cpuset v2. In other words, hotplug
|
||||
events will not change cpuset.cpus and cpuset.mems. Those events will
|
||||
only affect cpuset.effective_cpus and cpuset.effective_mems which show
|
||||
the actual cpus and memory nodes that are currently used by this cpuset.
|
||||
See Documentation/admin-guide/cgroup-v2.rst for more information about
|
||||
cpuset v2 behavior.
|
||||
|
||||
|
||||
1.4 What are exclusive cpusets ?
|
||||
--------------------------------
|
||||
|
||||
@@ -2,13 +2,6 @@
|
||||
HugeTLB Controller
|
||||
==================
|
||||
|
||||
The HugeTLB controller allows to limit the HugeTLB usage per control group and
|
||||
enforces the controller limit during page fault. Since HugeTLB doesn't
|
||||
support page reclaim, enforcing the limit at page fault time implies that,
|
||||
the application will get SIGBUS signal if it tries to access HugeTLB pages
|
||||
beyond its limit. This requires the application to know beforehand how much
|
||||
HugeTLB pages it would require for its use.
|
||||
|
||||
HugeTLB controller can be created by first mounting the cgroup filesystem.
|
||||
|
||||
# mount -t cgroup -o hugetlb none /sys/fs/cgroup
|
||||
@@ -28,10 +21,14 @@ process (bash) into it.
|
||||
|
||||
Brief summary of control files::
|
||||
|
||||
hugetlb.<hugepagesize>.limit_in_bytes # set/show limit of "hugepagesize" hugetlb usage
|
||||
hugetlb.<hugepagesize>.max_usage_in_bytes # show max "hugepagesize" hugetlb usage recorded
|
||||
hugetlb.<hugepagesize>.usage_in_bytes # show current usage for "hugepagesize" hugetlb
|
||||
hugetlb.<hugepagesize>.failcnt # show the number of allocation failure due to HugeTLB limit
|
||||
hugetlb.<hugepagesize>.rsvd.limit_in_bytes # set/show limit of "hugepagesize" hugetlb reservations
|
||||
hugetlb.<hugepagesize>.rsvd.max_usage_in_bytes # show max "hugepagesize" hugetlb reservations and no-reserve faults
|
||||
hugetlb.<hugepagesize>.rsvd.usage_in_bytes # show current reservations and no-reserve faults for "hugepagesize" hugetlb
|
||||
hugetlb.<hugepagesize>.rsvd.failcnt # show the number of allocation failure due to HugeTLB reservation limit
|
||||
hugetlb.<hugepagesize>.limit_in_bytes # set/show limit of "hugepagesize" hugetlb faults
|
||||
hugetlb.<hugepagesize>.max_usage_in_bytes # show max "hugepagesize" hugetlb usage recorded
|
||||
hugetlb.<hugepagesize>.usage_in_bytes # show current usage for "hugepagesize" hugetlb
|
||||
hugetlb.<hugepagesize>.failcnt # show the number of allocation failure due to HugeTLB usage limit
|
||||
|
||||
For a system supporting three hugepage sizes (64k, 32M and 1G), the control
|
||||
files include::
|
||||
@@ -40,11 +37,95 @@ files include::
|
||||
hugetlb.1GB.max_usage_in_bytes
|
||||
hugetlb.1GB.usage_in_bytes
|
||||
hugetlb.1GB.failcnt
|
||||
hugetlb.1GB.rsvd.limit_in_bytes
|
||||
hugetlb.1GB.rsvd.max_usage_in_bytes
|
||||
hugetlb.1GB.rsvd.usage_in_bytes
|
||||
hugetlb.1GB.rsvd.failcnt
|
||||
hugetlb.64KB.limit_in_bytes
|
||||
hugetlb.64KB.max_usage_in_bytes
|
||||
hugetlb.64KB.usage_in_bytes
|
||||
hugetlb.64KB.failcnt
|
||||
hugetlb.64KB.rsvd.limit_in_bytes
|
||||
hugetlb.64KB.rsvd.max_usage_in_bytes
|
||||
hugetlb.64KB.rsvd.usage_in_bytes
|
||||
hugetlb.64KB.rsvd.failcnt
|
||||
hugetlb.32MB.limit_in_bytes
|
||||
hugetlb.32MB.max_usage_in_bytes
|
||||
hugetlb.32MB.usage_in_bytes
|
||||
hugetlb.32MB.failcnt
|
||||
hugetlb.32MB.rsvd.limit_in_bytes
|
||||
hugetlb.32MB.rsvd.max_usage_in_bytes
|
||||
hugetlb.32MB.rsvd.usage_in_bytes
|
||||
hugetlb.32MB.rsvd.failcnt
|
||||
|
||||
|
||||
1. Page fault accounting
|
||||
|
||||
hugetlb.<hugepagesize>.limit_in_bytes
|
||||
hugetlb.<hugepagesize>.max_usage_in_bytes
|
||||
hugetlb.<hugepagesize>.usage_in_bytes
|
||||
hugetlb.<hugepagesize>.failcnt
|
||||
|
||||
The HugeTLB controller allows users to limit the HugeTLB usage (page fault) per
|
||||
control group and enforces the limit during page fault. Since HugeTLB
|
||||
doesn't support page reclaim, enforcing the limit at page fault time implies
|
||||
that, the application will get SIGBUS signal if it tries to fault in HugeTLB
|
||||
pages beyond its limit. Therefore the application needs to know exactly how many
|
||||
HugeTLB pages it uses before hand, and the sysadmin needs to make sure that
|
||||
there are enough available on the machine for all the users to avoid processes
|
||||
getting SIGBUS.
|
||||
|
||||
|
||||
2. Reservation accounting
|
||||
|
||||
hugetlb.<hugepagesize>.rsvd.limit_in_bytes
|
||||
hugetlb.<hugepagesize>.rsvd.max_usage_in_bytes
|
||||
hugetlb.<hugepagesize>.rsvd.usage_in_bytes
|
||||
hugetlb.<hugepagesize>.rsvd.failcnt
|
||||
|
||||
The HugeTLB controller allows to limit the HugeTLB reservations per control
|
||||
group and enforces the controller limit at reservation time and at the fault of
|
||||
HugeTLB memory for which no reservation exists. Since reservation limits are
|
||||
enforced at reservation time (on mmap or shget), reservation limits never causes
|
||||
the application to get SIGBUS signal if the memory was reserved before hand. For
|
||||
MAP_NORESERVE allocations, the reservation limit behaves the same as the fault
|
||||
limit, enforcing memory usage at fault time and causing the application to
|
||||
receive a SIGBUS if it's crossing its limit.
|
||||
|
||||
Reservation limits are superior to page fault limits described above, since
|
||||
reservation limits are enforced at reservation time (on mmap or shget), and
|
||||
never causes the application to get SIGBUS signal if the memory was reserved
|
||||
before hand. This allows for easier fallback to alternatives such as
|
||||
non-HugeTLB memory for example. In the case of page fault accounting, it's very
|
||||
hard to avoid processes getting SIGBUS since the sysadmin needs precisely know
|
||||
the HugeTLB usage of all the tasks in the system and make sure there is enough
|
||||
pages to satisfy all requests. Avoiding tasks getting SIGBUS on overcommited
|
||||
systems is practically impossible with page fault accounting.
|
||||
|
||||
|
||||
3. Caveats with shared memory
|
||||
|
||||
For shared HugeTLB memory, both HugeTLB reservation and page faults are charged
|
||||
to the first task that causes the memory to be reserved or faulted, and all
|
||||
subsequent uses of this reserved or faulted memory is done without charging.
|
||||
|
||||
Shared HugeTLB memory is only uncharged when it is unreserved or deallocated.
|
||||
This is usually when the HugeTLB file is deleted, and not when the task that
|
||||
caused the reservation or fault has exited.
|
||||
|
||||
|
||||
4. Caveats with HugeTLB cgroup offline.
|
||||
|
||||
When a HugeTLB cgroup goes offline with some reservations or faults still
|
||||
charged to it, the behavior is as follows:
|
||||
|
||||
- The fault charges are charged to the parent HugeTLB cgroup (reparented),
|
||||
- the reservation charges remain on the offline HugeTLB cgroup.
|
||||
|
||||
This means that if a HugeTLB cgroup gets offlined while there is still HugeTLB
|
||||
reservations charged to it, that cgroup persists as a zombie until all HugeTLB
|
||||
reservations are uncharged. HugeTLB reservations behave in this manner to match
|
||||
the memory controller whose cgroups also persist as zombie until all charged
|
||||
memory is uncharged. Also, the tracking of HugeTLB reservations is a bit more
|
||||
complex compared to the tracking of HugeTLB faults, so it is significantly
|
||||
harder to reparent reservations at offline time.
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
.. _cgroup-v1:
|
||||
|
||||
========================
|
||||
Control Groups version 1
|
||||
========================
|
||||
|
||||
@@ -9,7 +9,7 @@ This is the authoritative documentation on the design, interface and
|
||||
conventions of cgroup v2. It describes all userland-visible aspects
|
||||
of cgroup including core and specific controller behaviors. All
|
||||
future changes must be reflected in this document. Documentation for
|
||||
v1 is available under Documentation/admin-guide/cgroup-v1/.
|
||||
v1 is available under :ref:`Documentation/admin-guide/cgroup-v1/index.rst <cgroup-v1>`.
|
||||
|
||||
.. CONTENTS
|
||||
|
||||
@@ -188,6 +188,17 @@ cgroup v2 currently supports the following mount options.
|
||||
modified through remount from the init namespace. The mount
|
||||
option is ignored on non-init namespace mounts.
|
||||
|
||||
memory_recursiveprot
|
||||
|
||||
Recursively apply memory.min and memory.low protection to
|
||||
entire subtrees, without requiring explicit downward
|
||||
propagation into leaf cgroups. This allows protecting entire
|
||||
subtrees from one another, while retaining free competition
|
||||
within those subtrees. This should have been the default
|
||||
behavior but is a mount-option to avoid regressing setups
|
||||
relying on the original semantics (e.g. specifying bogusly
|
||||
high 'bypass' protection values at higher tree levels).
|
||||
|
||||
|
||||
Organizing Processes and Threads
|
||||
--------------------------------
|
||||
@@ -1023,7 +1034,7 @@ All time durations are in microseconds.
|
||||
A read-only nested-key file which exists on non-root cgroups.
|
||||
|
||||
Shows pressure stall information for CPU. See
|
||||
Documentation/accounting/psi.rst for details.
|
||||
:ref:`Documentation/accounting/psi.rst <psi>` for details.
|
||||
|
||||
cpu.uclamp.min
|
||||
A read-write single value file which exists on non-root cgroups.
|
||||
@@ -1103,7 +1114,7 @@ PAGE_SIZE multiple when read back.
|
||||
proportionally to the overage, reducing reclaim pressure for
|
||||
smaller overages.
|
||||
|
||||
Effective min boundary is limited by memory.min values of
|
||||
Effective min boundary is limited by memory.min values of
|
||||
all ancestor cgroups. If there is memory.min overcommitment
|
||||
(child cgroup or cgroups are requiring more protected memory
|
||||
than parent will allow), then each child cgroup will get
|
||||
@@ -1313,53 +1324,41 @@ PAGE_SIZE multiple when read back.
|
||||
Number of major page faults incurred
|
||||
|
||||
workingset_refault
|
||||
|
||||
Number of refaults of previously evicted pages
|
||||
|
||||
workingset_activate
|
||||
|
||||
Number of refaulted pages that were immediately activated
|
||||
|
||||
workingset_nodereclaim
|
||||
|
||||
Number of times a shadow node has been reclaimed
|
||||
|
||||
pgrefill
|
||||
|
||||
Amount of scanned pages (in an active LRU list)
|
||||
|
||||
pgscan
|
||||
|
||||
Amount of scanned pages (in an inactive LRU list)
|
||||
|
||||
pgsteal
|
||||
|
||||
Amount of reclaimed pages
|
||||
|
||||
pgactivate
|
||||
|
||||
Amount of pages moved to the active LRU list
|
||||
|
||||
pgdeactivate
|
||||
|
||||
Amount of pages moved to the inactive LRU list
|
||||
|
||||
pglazyfree
|
||||
|
||||
Amount of pages postponed to be freed under memory pressure
|
||||
|
||||
pglazyfreed
|
||||
|
||||
Amount of reclaimed lazyfree pages
|
||||
|
||||
thp_fault_alloc
|
||||
|
||||
Number of transparent hugepages which were allocated to satisfy
|
||||
a page fault, including COW faults. This counter is not present
|
||||
when CONFIG_TRANSPARENT_HUGEPAGE is not set.
|
||||
|
||||
thp_collapse_alloc
|
||||
|
||||
Number of transparent hugepages which were allocated to allow
|
||||
collapsing an existing range of pages. This counter is not
|
||||
present when CONFIG_TRANSPARENT_HUGEPAGE is not set.
|
||||
@@ -1403,7 +1402,7 @@ PAGE_SIZE multiple when read back.
|
||||
A read-only nested-key file which exists on non-root cgroups.
|
||||
|
||||
Shows pressure stall information for memory. See
|
||||
Documentation/accounting/psi.rst for details.
|
||||
:ref:`Documentation/accounting/psi.rst <psi>` for details.
|
||||
|
||||
|
||||
Usage Guidelines
|
||||
@@ -1478,7 +1477,7 @@ IO Interface Files
|
||||
dios Number of discard IOs
|
||||
====== =====================
|
||||
|
||||
An example read output follows:
|
||||
An example read output follows::
|
||||
|
||||
8:16 rbytes=1459200 wbytes=314773504 rios=192 wios=353 dbytes=0 dios=0
|
||||
8:0 rbytes=90430464 wbytes=299008000 rios=8950 wios=1252 dbytes=50331648 dios=3021
|
||||
@@ -1643,7 +1642,7 @@ IO Interface Files
|
||||
A read-only nested-key file which exists on non-root cgroups.
|
||||
|
||||
Shows pressure stall information for IO. See
|
||||
Documentation/accounting/psi.rst for details.
|
||||
:ref:`Documentation/accounting/psi.rst <psi>` for details.
|
||||
|
||||
|
||||
Writeback
|
||||
@@ -1853,7 +1852,7 @@ Cpuset Interface Files
|
||||
from the requested CPUs.
|
||||
|
||||
The CPU numbers are comma-separated numbers or ranges.
|
||||
For example:
|
||||
For example::
|
||||
|
||||
# cat cpuset.cpus
|
||||
0-4,6,8-10
|
||||
@@ -1892,7 +1891,7 @@ Cpuset Interface Files
|
||||
from the requested memory nodes.
|
||||
|
||||
The memory node numbers are comma-separated numbers or ranges.
|
||||
For example:
|
||||
For example::
|
||||
|
||||
# cat cpuset.mems
|
||||
0-1,3
|
||||
|
||||
@@ -419,3 +419,5 @@ Version History
|
||||
rebuild errors.
|
||||
1.15.0 Fix size extensions not being synchronized in case of new MD bitmap
|
||||
pages allocated; also fix those not occuring after previous reductions
|
||||
1.15.1 Fix argument count and arguments for rebuild/write_mostly/journal_(dev|mode)
|
||||
on the status line.
|
||||
|
||||
@@ -54,6 +54,9 @@ If you make a mistake with the syntax, the write will fail thus::
|
||||
<debugfs>/dynamic_debug/control
|
||||
-bash: echo: write error: Invalid argument
|
||||
|
||||
Note, for systems without 'debugfs' enabled, the control file can be
|
||||
found in ``/proc/dynamic_debug/control``.
|
||||
|
||||
Viewing Dynamic Debug Behaviour
|
||||
===============================
|
||||
|
||||
|
||||
@@ -11,11 +11,13 @@ Today, with the advent of Kernel Mode Setting, a graphics board is
|
||||
either correctly working because all components follow the standards -
|
||||
or the computer is unusable, because the screen remains dark after
|
||||
booting or it displays the wrong area. Cases when this happens are:
|
||||
|
||||
- The graphics board does not recognize the monitor.
|
||||
- The graphics board is unable to detect any EDID data.
|
||||
- The graphics board incorrectly forwards EDID data to the driver.
|
||||
- The monitor sends no or bogus EDID data.
|
||||
- A KVM sends its own EDID data instead of querying the connected monitor.
|
||||
|
||||
Adding the kernel parameter "nomodeset" helps in most cases, but causes
|
||||
restrictions later on.
|
||||
|
||||
@@ -32,7 +34,7 @@ individual data for a specific misbehaving monitor, commented sources
|
||||
and a Makefile environment are given here.
|
||||
|
||||
To create binary EDID and C source code files from the existing data
|
||||
material, simply type "make".
|
||||
material, simply type "make" in tools/edid/.
|
||||
|
||||
If you want to create your own EDID file, copy the file 1024x768.S,
|
||||
replace the settings with your own data and add a new target to the
|
||||
@@ -92,6 +92,8 @@ Currently Available
|
||||
* efficient new ordered mode in JBD2 and ext4 (avoid using buffer head to force
|
||||
the ordering)
|
||||
* Case-insensitive file name lookups
|
||||
* file-based encryption support (fscrypt)
|
||||
* file-based verity support (fsverity)
|
||||
|
||||
[1] Filesystems with a block size of 1k may see a limit imposed by the
|
||||
directory hash tree having a maximum depth of two.
|
||||
|
||||
@@ -136,8 +136,6 @@ enables the mitigation by default.
|
||||
The mitigation can be controlled at boot time via a kernel command line option.
|
||||
See :ref:`taa_mitigation_control_command_line`.
|
||||
|
||||
.. _virt_mechanism:
|
||||
|
||||
Virtualization mitigation
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ configure specific aspects of kernel behavior to your liking.
|
||||
binderfs
|
||||
binfmt-misc
|
||||
blockdev/index
|
||||
bootconfig
|
||||
braille-console
|
||||
btmrvl
|
||||
cgroup-v1/index
|
||||
@@ -74,8 +75,10 @@ configure specific aspects of kernel behavior to your liking.
|
||||
cputopology
|
||||
dell_rbu
|
||||
device-mapper/index
|
||||
edid
|
||||
efi-stub
|
||||
ext4
|
||||
nfs/index
|
||||
gpio/index
|
||||
highuid
|
||||
hw_random
|
||||
|
||||
@@ -100,7 +100,7 @@ Field 10 -- # of milliseconds spent doing I/Os (unsigned int)
|
||||
|
||||
Since 5.0 this field counts jiffies when at least one request was
|
||||
started or completed. If request runs more than 2 jiffies then some
|
||||
I/O time will not be accounted unless there are other requests.
|
||||
I/O time might be not accounted in case of concurrent requests.
|
||||
|
||||
Field 11 -- weighted # of milliseconds spent doing I/Os (unsigned int)
|
||||
This field is incremented at each I/O start, I/O completion, I/O
|
||||
@@ -143,6 +143,9 @@ are summed (possibly overflowing the unsigned long variable they are
|
||||
summed to) and the result given to the user. There is no convenient
|
||||
user interface for accessing the per-CPU counters themselves.
|
||||
|
||||
Since 4.19 request times are measured with nanoseconds precision and
|
||||
truncated to milliseconds before showing in this interface.
|
||||
|
||||
Disks vs Partitions
|
||||
-------------------
|
||||
|
||||
|
||||
@@ -22,11 +22,13 @@
|
||||
default: 0
|
||||
|
||||
acpi_backlight= [HW,ACPI]
|
||||
acpi_backlight=vendor
|
||||
acpi_backlight=video
|
||||
If set to vendor, prefer vendor specific driver
|
||||
{ vendor | video | native | none }
|
||||
If set to vendor, prefer vendor-specific driver
|
||||
(e.g. thinkpad_acpi, sony_acpi, etc.) instead
|
||||
of the ACPI video.ko driver.
|
||||
If set to video, use the ACPI video.ko driver.
|
||||
If set to native, use the device's native backlight mode.
|
||||
If set to none, disable the ACPI backlight interface.
|
||||
|
||||
acpi_force_32bit_fadt_addr
|
||||
force FADT to use 32 bit addresses rather than the
|
||||
@@ -136,6 +138,10 @@
|
||||
dynamic table installation which will install SSDT
|
||||
tables to /sys/firmware/acpi/tables/dynamic.
|
||||
|
||||
acpi_no_watchdog [HW,ACPI,WDT]
|
||||
Ignore the ACPI-based watchdog interface (WDAT) and let
|
||||
a native driver control the watchdog device instead.
|
||||
|
||||
acpi_rsdp= [ACPI,EFI,KEXEC]
|
||||
Pass the RSDP address to the kernel, mostly used
|
||||
on machines running EFI runtime service to boot the
|
||||
@@ -437,9 +443,18 @@
|
||||
no delay (0).
|
||||
Format: integer
|
||||
|
||||
bootconfig [KNL]
|
||||
Extended command line options can be added to an initrd
|
||||
and this will cause the kernel to look for it.
|
||||
|
||||
See Documentation/admin-guide/bootconfig.rst
|
||||
|
||||
bert_disable [ACPI]
|
||||
Disable BERT OS support on buggy BIOSes.
|
||||
|
||||
bgrt_disable [ACPI][X86]
|
||||
Disable BGRT to avoid flickering OEM logo.
|
||||
|
||||
bttv.card= [HW,V4L] bttv (bt848 + bt878 based grabber cards)
|
||||
bttv.radio= Most important insmod options are available as
|
||||
kernel args too.
|
||||
@@ -512,6 +527,7 @@
|
||||
Default value is set via a kernel config option.
|
||||
Value can be changed at runtime via
|
||||
/sys/fs/selinux/checkreqprot.
|
||||
Setting checkreqprot to 1 is deprecated.
|
||||
|
||||
cio_ignore= [S390]
|
||||
See Documentation/s390/common_io.rst for details.
|
||||
@@ -669,7 +685,7 @@
|
||||
coredump_filter=
|
||||
[KNL] Change the default value for
|
||||
/proc/<pid>/coredump_filter.
|
||||
See also Documentation/filesystems/proc.txt.
|
||||
See also Documentation/filesystems/proc.rst.
|
||||
|
||||
coresight_cpu_debug.enable
|
||||
[ARM,ARM64]
|
||||
@@ -834,6 +850,18 @@
|
||||
dump out devices still on the deferred probe list after
|
||||
retrying.
|
||||
|
||||
dfltcc= [HW,S390]
|
||||
Format: { on | off | def_only | inf_only | always }
|
||||
on: s390 zlib hardware support for compression on
|
||||
level 1 and decompression (default)
|
||||
off: No s390 zlib hardware support
|
||||
def_only: s390 zlib hardware support for deflate
|
||||
only (compression on level 1)
|
||||
inf_only: s390 zlib hardware support for inflate
|
||||
only (decompression)
|
||||
always: Same as 'on' but ignores the selected compression
|
||||
level always using hardware support (used for debugging)
|
||||
|
||||
dhash_entries= [KNL]
|
||||
Set number of hash buckets for dentry cache.
|
||||
|
||||
@@ -934,7 +962,7 @@
|
||||
edid/1680x1050.bin, or edid/1920x1080.bin is given
|
||||
and no file with the same name exists. Details and
|
||||
instructions how to build your own EDID data are
|
||||
available in Documentation/driver-api/edid.rst. An EDID
|
||||
available in Documentation/admin-guide/edid.rst. An EDID
|
||||
data set will only be used for a particular connector,
|
||||
if its name and a colon are prepended to the EDID
|
||||
name. Each connector may use a unique EDID data
|
||||
@@ -964,10 +992,6 @@
|
||||
Documentation/admin-guide/dynamic-debug-howto.rst
|
||||
for details.
|
||||
|
||||
nompx [X86] Disables Intel Memory Protection Extensions.
|
||||
See Documentation/x86/intel_mpx.rst for more
|
||||
information about the feature.
|
||||
|
||||
nopku [X86] Disable Memory Protection Keys CPU feature found
|
||||
in some Intel CPUs.
|
||||
|
||||
@@ -1077,6 +1101,12 @@
|
||||
A valid base address must be provided, and the serial
|
||||
port must already be setup and configured.
|
||||
|
||||
ec_imx21,<addr>
|
||||
ec_imx6q,<addr>
|
||||
Start an early, polled-mode, output-only console on the
|
||||
Freescale i.MX UART at the specified address. The UART
|
||||
must already be setup and configured.
|
||||
|
||||
ar3700_uart,<addr>
|
||||
Start an early, polled-mode console on the
|
||||
Armada 3700 serial port at the specified
|
||||
@@ -1332,6 +1362,24 @@
|
||||
can be changed at run time by the max_graph_depth file
|
||||
in the tracefs tracing directory. default: 0 (no limit)
|
||||
|
||||
fw_devlink= [KNL] Create device links between consumer and supplier
|
||||
devices by scanning the firmware to infer the
|
||||
consumer/supplier relationships. This feature is
|
||||
especially useful when drivers are loaded as modules as
|
||||
it ensures proper ordering of tasks like device probing
|
||||
(suppliers first, then consumers), supplier boot state
|
||||
clean up (only after all consumers have probed),
|
||||
suspend/resume & runtime PM (consumers first, then
|
||||
suppliers).
|
||||
Format: { off | permissive | on | rpm }
|
||||
off -- Don't create device links from firmware info.
|
||||
permissive -- Create device links from firmware info
|
||||
but use it only for ordering boot state clean
|
||||
up (sync_state() calls).
|
||||
on -- Create device links from firmware info and use it
|
||||
to enforce probe and suspend/resume ordering.
|
||||
rpm -- Like "on", but also use to order runtime PM.
|
||||
|
||||
gamecon.map[2|3]=
|
||||
[HW,JOY] Multisystem joystick and NES/SNES/PSX pad
|
||||
support via parallel port (up to 5 devices per port)
|
||||
@@ -1423,6 +1471,14 @@
|
||||
hpet_mmap= [X86, HPET_MMAP] Allow userspace to mmap HPET
|
||||
registers. Default set by CONFIG_HPET_MMAP_DEFAULT.
|
||||
|
||||
hugetlb_cma= [HW] The size of a cma area used for allocation
|
||||
of gigantic hugepages.
|
||||
Format: nn[KMGTPE]
|
||||
|
||||
Reserve a cma area of given size and allocate gigantic
|
||||
hugepages using the cma allocator. If enabled, the
|
||||
boot-time allocation of gigantic hugepages is skipped.
|
||||
|
||||
hugepages= [HW,X86-32,IA-64] HugeTLB pages to allocate at boot.
|
||||
hugepagesz= [HW,IA-64,PPC,X86-64] The size of the HugeTLB pages.
|
||||
On x86-64 and powerpc, this option can be specified
|
||||
@@ -1757,7 +1813,7 @@
|
||||
provided by tboot because it makes the system
|
||||
vulnerable to DMA attacks.
|
||||
nobounce [Default off]
|
||||
Disable bounce buffer for unstrusted devices such as
|
||||
Disable bounce buffer for untrusted devices such as
|
||||
the Thunderbolt devices. This will treat the untrusted
|
||||
devices as the trusted ones, hence might expose security
|
||||
risks of DMA attacks.
|
||||
@@ -1861,7 +1917,7 @@
|
||||
No delay
|
||||
|
||||
ip= [IP_PNP]
|
||||
See Documentation/filesystems/nfs/nfsroot.txt.
|
||||
See Documentation/admin-guide/nfs/nfsroot.rst.
|
||||
|
||||
ipcmni_extend [KNL] Extend the maximum number of unique System V
|
||||
IPC identifiers from 32,768 to 16,777,216.
|
||||
@@ -2521,13 +2577,22 @@
|
||||
For details see: Documentation/admin-guide/hw-vuln/mds.rst
|
||||
|
||||
mem=nn[KMG] [KNL,BOOT] Force usage of a specific amount of memory
|
||||
Amount of memory to be used when the kernel is not able
|
||||
to see the whole system memory or for test.
|
||||
Amount of memory to be used in cases as follows:
|
||||
|
||||
1 for test;
|
||||
2 when the kernel is not able to see the whole system memory;
|
||||
3 memory that lies after 'mem=' boundary is excluded from
|
||||
the hypervisor, then assigned to KVM guests.
|
||||
|
||||
[X86] Work as limiting max address. Use together
|
||||
with memmap= to avoid physical address space collisions.
|
||||
Without memmap= PCI devices could be placed at addresses
|
||||
belonging to unused RAM.
|
||||
|
||||
Note that this only takes effects during boot time since
|
||||
in above case 3, memory may need be hot added after boot
|
||||
if system memory of hypervisor is not sufficient.
|
||||
|
||||
mem=nopentium [BUGS=X86-32] Disable usage of 4MB pages for kernel
|
||||
memory.
|
||||
|
||||
@@ -2773,7 +2838,7 @@
|
||||
<name>,<region-number>[,<base>,<size>,<buswidth>,<altbuswidth>]
|
||||
|
||||
mtdparts= [MTD]
|
||||
See drivers/mtd/cmdlinepart.c.
|
||||
See drivers/mtd/parsers/cmdlinepart.c
|
||||
|
||||
multitce=off [PPC] This parameter disables the use of the pSeries
|
||||
firmware feature for updating multiple TCE entries
|
||||
@@ -2831,13 +2896,13 @@
|
||||
Default value is 0.
|
||||
|
||||
nfsaddrs= [NFS] Deprecated. Use ip= instead.
|
||||
See Documentation/filesystems/nfs/nfsroot.txt.
|
||||
See Documentation/admin-guide/nfs/nfsroot.rst.
|
||||
|
||||
nfsroot= [NFS] nfs root filesystem for disk-less boxes.
|
||||
See Documentation/filesystems/nfs/nfsroot.txt.
|
||||
See Documentation/admin-guide/nfs/nfsroot.rst.
|
||||
|
||||
nfsrootdebug [NFS] enable nfsroot debugging messages.
|
||||
See Documentation/filesystems/nfs/nfsroot.txt.
|
||||
See Documentation/admin-guide/nfs/nfsroot.rst.
|
||||
|
||||
nfs.callback_nr_threads=
|
||||
[NFSv4] set the total number of threads that the
|
||||
@@ -3152,7 +3217,7 @@
|
||||
[X86,PV_OPS] Disable paravirtualized VMware scheduler
|
||||
clock and use the default one.
|
||||
|
||||
no-steal-acc [X86,KVM,ARM64] Disable paravirtualized steal time
|
||||
no-steal-acc [X86,PV_OPS,ARM64] Disable paravirtualized steal time
|
||||
accounting. steal time is computed, but won't
|
||||
influence scheduler behaviour
|
||||
|
||||
@@ -3263,12 +3328,6 @@
|
||||
This can be set from sysctl after boot.
|
||||
See Documentation/admin-guide/sysctl/vm.rst for details.
|
||||
|
||||
of_devlink [OF, KNL] Create device links between consumer and
|
||||
supplier devices by scanning the devictree to infer the
|
||||
consumer/supplier relationships. A consumer device
|
||||
will not be probed until all the supplier devices have
|
||||
probed successfully.
|
||||
|
||||
ohci1394_dma=early [HW] enable debugging via the ohci1394 driver.
|
||||
See Documentation/debugging-via-ohci1394.txt for more
|
||||
info.
|
||||
@@ -3676,6 +3735,9 @@
|
||||
Override pmtimer IOPort with a hex value.
|
||||
e.g. pmtmr=0x508
|
||||
|
||||
pm_debug_messages [SUSPEND,KNL]
|
||||
Enable suspend/resume debug messages during boot up.
|
||||
|
||||
pnp.debug=1 [PNP]
|
||||
Enable PNP debug messages (depends on the
|
||||
CONFIG_PNP_DEBUG_MESSAGES option). Change at run-time
|
||||
@@ -3777,6 +3839,11 @@
|
||||
before loading.
|
||||
See Documentation/admin-guide/blockdev/ramdisk.rst.
|
||||
|
||||
prot_virt= [S390] enable hosting protected virtual machines
|
||||
isolated from the hypervisor (if hardware supports
|
||||
that).
|
||||
Format: <bool>
|
||||
|
||||
psi= [KNL] Enable or disable pressure stall information
|
||||
tracking.
|
||||
Format: <bool>
|
||||
@@ -3962,6 +4029,15 @@
|
||||
Set threshold of queued RCU callbacks below which
|
||||
batch limiting is re-enabled.
|
||||
|
||||
rcutree.qovld= [KNL]
|
||||
Set threshold of queued RCU callbacks beyond which
|
||||
RCU's force-quiescent-state scan will aggressively
|
||||
enlist help from cond_resched() and sched IPIs to
|
||||
help CPUs more quickly reach quiescent states.
|
||||
Set to less than zero to make this be set based
|
||||
on rcutree.qhimark at boot time and to zero to
|
||||
disable more aggressive help enlistment.
|
||||
|
||||
rcutree.rcu_idle_gp_delay= [KNL]
|
||||
Set wakeup interval for idle CPUs that have
|
||||
RCU callbacks (RCU_FAST_NO_HZ=y).
|
||||
@@ -4177,6 +4253,12 @@
|
||||
rcupdate.rcu_cpu_stall_suppress= [KNL]
|
||||
Suppress RCU CPU stall warning messages.
|
||||
|
||||
rcupdate.rcu_cpu_stall_suppress_at_boot= [KNL]
|
||||
Suppress RCU CPU stall warning messages and
|
||||
rcutorture writer stall warnings that occur
|
||||
during early boot, that is, during the time
|
||||
before the init task is spawned.
|
||||
|
||||
rcupdate.rcu_cpu_stall_timeout= [KNL]
|
||||
Set timeout for RCU CPU stall warning messages.
|
||||
|
||||
@@ -4370,6 +4452,22 @@
|
||||
incurs a small amount of overhead in the scheduler
|
||||
but is useful for debugging and performance tuning.
|
||||
|
||||
sched_thermal_decay_shift=
|
||||
[KNL, SMP] Set a decay shift for scheduler thermal
|
||||
pressure signal. Thermal pressure signal follows the
|
||||
default decay period of other scheduler pelt
|
||||
signals(usually 32 ms but configurable). Setting
|
||||
sched_thermal_decay_shift will left shift the decay
|
||||
period for the thermal pressure signal by the shift
|
||||
value.
|
||||
i.e. with the default pelt decay period of 32 ms
|
||||
sched_thermal_decay_shift thermal pressure decay pr
|
||||
1 64 ms
|
||||
2 128 ms
|
||||
and so on.
|
||||
Format: integer between 0 and 10
|
||||
Default is 0.
|
||||
|
||||
skew_tick= [KNL] Offset the periodic timer tick per cpu to mitigate
|
||||
xtime_lock contention on larger systems, and/or RCU lock
|
||||
contention on all systems with CONFIG_MAXSMP set.
|
||||
@@ -4492,10 +4590,10 @@
|
||||
Format: <integer>
|
||||
|
||||
A nonzero value instructs the soft-lockup detector
|
||||
to panic the machine when a soft-lockup occurs. This
|
||||
is also controlled by CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC
|
||||
which is the respective build-time switch to that
|
||||
functionality.
|
||||
to panic the machine when a soft-lockup occurs. It is
|
||||
also controlled by the kernel.softlockup_panic sysctl
|
||||
and CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC, which is the
|
||||
respective build-time switch to that functionality.
|
||||
|
||||
softlockup_all_cpu_backtrace=
|
||||
[KNL] Should the soft-lockup detector generate
|
||||
@@ -4637,6 +4735,28 @@
|
||||
spia_pedr=
|
||||
spia_peddr=
|
||||
|
||||
split_lock_detect=
|
||||
[X86] Enable split lock detection
|
||||
|
||||
When enabled (and if hardware support is present), atomic
|
||||
instructions that access data across cache line
|
||||
boundaries will result in an alignment check exception.
|
||||
|
||||
off - not enabled
|
||||
|
||||
warn - the kernel will emit rate limited warnings
|
||||
about applications triggering the #AC
|
||||
exception. This mode is the default on CPUs
|
||||
that supports split lock detection.
|
||||
|
||||
fatal - the kernel will send SIGBUS to applications
|
||||
that trigger the #AC exception.
|
||||
|
||||
If an #AC exception is hit in the kernel or in
|
||||
firmware (i.e. not while executing in user mode)
|
||||
the kernel will oops in either "warn" or "fatal"
|
||||
mode.
|
||||
|
||||
srcutree.counter_wrap_check [KNL]
|
||||
Specifies how frequently to check for
|
||||
grace-period sequence counter wrap for the
|
||||
@@ -4849,6 +4969,10 @@
|
||||
topology updates sent by the hypervisor to this
|
||||
LPAR.
|
||||
|
||||
torture.disable_onoff_at_boot= [KNL]
|
||||
Prevent the CPU-hotplug component of torturing
|
||||
until after init has spawned.
|
||||
|
||||
tp720= [HW,PS2]
|
||||
|
||||
tpm_suspend_pcr=[HW,TPM]
|
||||
|
||||
@@ -234,7 +234,7 @@ To reduce its OS jitter, do any of the following:
|
||||
Such a workqueue can be confined to a given subset of the
|
||||
CPUs using the ``/sys/devices/virtual/workqueue/*/cpumask`` sysfs
|
||||
files. The set of WQ_SYSFS workqueues can be displayed using
|
||||
"ls sys/devices/virtual/workqueue". That said, the workqueues
|
||||
"ls /sys/devices/virtual/workqueue". That said, the workqueues
|
||||
maintainer would like to caution people against indiscriminately
|
||||
sprinkling WQ_SYSFS across all the workqueues. The reason for
|
||||
caution is that it is easy to add WQ_SYSFS, but because sysfs is
|
||||
|
||||
@@ -310,6 +310,11 @@ thp_fault_fallback
|
||||
is incremented if a page fault fails to allocate
|
||||
a huge page and instead falls back to using small pages.
|
||||
|
||||
thp_fault_fallback_charge
|
||||
is incremented if a page fault fails to charge a huge page and
|
||||
instead falls back to using small pages even though the
|
||||
allocation was successful.
|
||||
|
||||
thp_collapse_alloc_failed
|
||||
is incremented if khugepaged found a range
|
||||
of pages that should be collapsed into one huge page but failed
|
||||
@@ -319,6 +324,15 @@ thp_file_alloc
|
||||
is incremented every time a file huge page is successfully
|
||||
allocated.
|
||||
|
||||
thp_file_fallback
|
||||
is incremented if a file huge page is attempted to be allocated
|
||||
but fails and instead falls back to using small pages.
|
||||
|
||||
thp_file_fallback_charge
|
||||
is incremented if a file huge page cannot be charged and instead
|
||||
falls back to using small pages even though the allocation was
|
||||
successful.
|
||||
|
||||
thp_file_mapped
|
||||
is incremented every time a file huge page is mapped into
|
||||
user address space.
|
||||
|
||||
@@ -108,6 +108,57 @@ UFFDIO_COPY. They're atomic as in guaranteeing that nothing can see an
|
||||
half copied page since it'll keep userfaulting until the copy has
|
||||
finished.
|
||||
|
||||
Notes:
|
||||
|
||||
- If you requested UFFDIO_REGISTER_MODE_MISSING when registering then
|
||||
you must provide some kind of page in your thread after reading from
|
||||
the uffd. You must provide either UFFDIO_COPY or UFFDIO_ZEROPAGE.
|
||||
The normal behavior of the OS automatically providing a zero page on
|
||||
an annonymous mmaping is not in place.
|
||||
|
||||
- None of the page-delivering ioctls default to the range that you
|
||||
registered with. You must fill in all fields for the appropriate
|
||||
ioctl struct including the range.
|
||||
|
||||
- You get the address of the access that triggered the missing page
|
||||
event out of a struct uffd_msg that you read in the thread from the
|
||||
uffd. You can supply as many pages as you want with UFFDIO_COPY or
|
||||
UFFDIO_ZEROPAGE. Keep in mind that unless you used DONTWAKE then
|
||||
the first of any of those IOCTLs wakes up the faulting thread.
|
||||
|
||||
- Be sure to test for all errors including (pollfd[0].revents &
|
||||
POLLERR). This can happen, e.g. when ranges supplied were
|
||||
incorrect.
|
||||
|
||||
Write Protect Notifications
|
||||
---------------------------
|
||||
|
||||
This is equivalent to (but faster than) using mprotect and a SIGSEGV
|
||||
signal handler.
|
||||
|
||||
Firstly you need to register a range with UFFDIO_REGISTER_MODE_WP.
|
||||
Instead of using mprotect(2) you use ioctl(uffd, UFFDIO_WRITEPROTECT,
|
||||
struct *uffdio_writeprotect) while mode = UFFDIO_WRITEPROTECT_MODE_WP
|
||||
in the struct passed in. The range does not default to and does not
|
||||
have to be identical to the range you registered with. You can write
|
||||
protect as many ranges as you like (inside the registered range).
|
||||
Then, in the thread reading from uffd the struct will have
|
||||
msg.arg.pagefault.flags & UFFD_PAGEFAULT_FLAG_WP set. Now you send
|
||||
ioctl(uffd, UFFDIO_WRITEPROTECT, struct *uffdio_writeprotect) again
|
||||
while pagefault.mode does not have UFFDIO_WRITEPROTECT_MODE_WP set.
|
||||
This wakes up the thread which will continue to run with writes. This
|
||||
allows you to do the bookkeeping about the write in the uffd reading
|
||||
thread before the ioctl.
|
||||
|
||||
If you registered with both UFFDIO_REGISTER_MODE_MISSING and
|
||||
UFFDIO_REGISTER_MODE_WP then you need to think about the sequence in
|
||||
which you supply a page and undo write protect. Note that there is a
|
||||
difference between writes into a WP area and into a !WP area. The
|
||||
former will have UFFD_PAGEFAULT_FLAG_WP set, the latter
|
||||
UFFD_PAGEFAULT_FLAG_WRITE. The latter did not fail on protection but
|
||||
you still need to supply a page when UFFDIO_REGISTER_MODE_MISSING was
|
||||
used.
|
||||
|
||||
QEMU/KVM
|
||||
========
|
||||
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
===================
|
||||
NFS Fault Injection
|
||||
===================
|
||||
|
||||
Fault injection is a method for forcing errors that may not normally occur, or
|
||||
may be difficult to reproduce. Forcing these errors in a controlled environment
|
||||
can help the developer find and fix bugs before their code is shipped in a
|
||||
production system. Injecting an error on the Linux NFS server will allow us to
|
||||
observe how the client reacts and if it manages to recover its state correctly.
|
||||
|
||||
NFSD_FAULT_INJECTION must be selected when configuring the kernel to use this
|
||||
feature.
|
||||
|
||||
|
||||
Using Fault Injection
|
||||
=====================
|
||||
On the client, mount the fault injection server through NFS v4.0+ and do some
|
||||
work over NFS (open files, take locks, ...).
|
||||
|
||||
On the server, mount the debugfs filesystem to <debug_dir> and ls
|
||||
<debug_dir>/nfsd. This will show a list of files that will be used for
|
||||
injecting faults on the NFS server. As root, write a number n to the file
|
||||
corresponding to the action you want the server to take. The server will then
|
||||
process the first n items it finds. So if you want to forget 5 locks, echo '5'
|
||||
to <debug_dir>/nfsd/forget_locks. A value of 0 will tell the server to forget
|
||||
all corresponding items. A log message will be created containing the number
|
||||
of items forgotten (check dmesg).
|
||||
|
||||
Go back to work on the client and check if the client recovered from the error
|
||||
correctly.
|
||||
|
||||
|
||||
Available Faults
|
||||
================
|
||||
forget_clients:
|
||||
The NFS server keeps a list of clients that have placed a mount call. If
|
||||
this list is cleared, the server will have no knowledge of who the client
|
||||
is, forcing the client to reauthenticate with the server.
|
||||
|
||||
forget_openowners:
|
||||
The NFS server keeps a list of what files are currently opened and who
|
||||
they were opened by. Clearing this list will force the client to reopen
|
||||
its files.
|
||||
|
||||
forget_locks:
|
||||
The NFS server keeps a list of what files are currently locked in the VFS.
|
||||
Clearing this list will force the client to reclaim its locks (files are
|
||||
unlocked through the VFS as they are cleared from this list).
|
||||
|
||||
forget_delegations:
|
||||
A delegation is used to assure the client that a file, or part of a file,
|
||||
has not changed since the delegation was awarded. Clearing this list will
|
||||
force the client to reacquire its delegation before accessing the file
|
||||
again.
|
||||
|
||||
recall_delegations:
|
||||
Delegations can be recalled by the server when another client attempts to
|
||||
access a file. This test will notify the client that its delegation has
|
||||
been revoked, forcing the client to reacquire the delegation before using
|
||||
the file again.
|
||||
|
||||
|
||||
tools/nfs/inject_faults.sh script
|
||||
=================================
|
||||
This script has been created to ease the fault injection process. This script
|
||||
will detect the mounted debugfs directory and write to the files located there
|
||||
based on the arguments passed by the user. For example, running
|
||||
`inject_faults.sh forget_locks 1` as root will instruct the server to forget
|
||||
one lock. Running `inject_faults forget_locks` will instruct the server to
|
||||
forgetall locks.
|
||||
@@ -0,0 +1,15 @@
|
||||
=============
|
||||
NFS
|
||||
=============
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
nfs-client
|
||||
nfsroot
|
||||
nfs-rdma
|
||||
nfsd-admin-interfaces
|
||||
nfs-idmapper
|
||||
pnfs-block-server
|
||||
pnfs-scsi-server
|
||||
fault_injection
|
||||
@@ -0,0 +1,141 @@
|
||||
==========
|
||||
NFS Client
|
||||
==========
|
||||
|
||||
The NFS client
|
||||
==============
|
||||
|
||||
The NFS version 2 protocol was first documented in RFC1094 (March 1989).
|
||||
Since then two more major releases of NFS have been published, with NFSv3
|
||||
being documented in RFC1813 (June 1995), and NFSv4 in RFC3530 (April
|
||||
2003).
|
||||
|
||||
The Linux NFS client currently supports all the above published versions,
|
||||
and work is in progress on adding support for minor version 1 of the NFSv4
|
||||
protocol.
|
||||
|
||||
The purpose of this document is to provide information on some of the
|
||||
special features of the NFS client that can be configured by system
|
||||
administrators.
|
||||
|
||||
|
||||
The nfs4_unique_id parameter
|
||||
============================
|
||||
|
||||
NFSv4 requires clients to identify themselves to servers with a unique
|
||||
string. File open and lock state shared between one client and one server
|
||||
is associated with this identity. To support robust NFSv4 state recovery
|
||||
and transparent state migration, this identity string must not change
|
||||
across client reboots.
|
||||
|
||||
Without any other intervention, the Linux client uses a string that contains
|
||||
the local system's node name. System administrators, however, often do not
|
||||
take care to ensure that node names are fully qualified and do not change
|
||||
over the lifetime of a client system. Node names can have other
|
||||
administrative requirements that require particular behavior that does not
|
||||
work well as part of an nfs_client_id4 string.
|
||||
|
||||
The nfs.nfs4_unique_id boot parameter specifies a unique string that can be
|
||||
used instead of a system's node name when an NFS client identifies itself to
|
||||
a server. Thus, if the system's node name is not unique, or it changes, its
|
||||
nfs.nfs4_unique_id stays the same, preventing collision with other clients
|
||||
or loss of state during NFS reboot recovery or transparent state migration.
|
||||
|
||||
The nfs.nfs4_unique_id string is typically a UUID, though it can contain
|
||||
anything that is believed to be unique across all NFS clients. An
|
||||
nfs4_unique_id string should be chosen when a client system is installed,
|
||||
just as a system's root file system gets a fresh UUID in its label at
|
||||
install time.
|
||||
|
||||
The string should remain fixed for the lifetime of the client. It can be
|
||||
changed safely if care is taken that the client shuts down cleanly and all
|
||||
outstanding NFSv4 state has expired, to prevent loss of NFSv4 state.
|
||||
|
||||
This string can be stored in an NFS client's grub.conf, or it can be provided
|
||||
via a net boot facility such as PXE. It may also be specified as an nfs.ko
|
||||
module parameter. Specifying a uniquifier string is not support for NFS
|
||||
clients running in containers.
|
||||
|
||||
|
||||
The DNS resolver
|
||||
================
|
||||
|
||||
NFSv4 allows for one server to refer the NFS client to data that has been
|
||||
migrated onto another server by means of the special "fs_locations"
|
||||
attribute. See `RFC3530 Section 6: Filesystem Migration and Replication`_ and
|
||||
`Implementation Guide for Referrals in NFSv4`_.
|
||||
|
||||
.. _RFC3530 Section 6\: Filesystem Migration and Replication: http://tools.ietf.org/html/rfc3530#section-6
|
||||
.. _Implementation Guide for Referrals in NFSv4: http://tools.ietf.org/html/draft-ietf-nfsv4-referrals-00
|
||||
|
||||
The fs_locations information can take the form of either an ip address and
|
||||
a path, or a DNS hostname and a path. The latter requires the NFS client to
|
||||
do a DNS lookup in order to mount the new volume, and hence the need for an
|
||||
upcall to allow userland to provide this service.
|
||||
|
||||
Assuming that the user has the 'rpc_pipefs' filesystem mounted in the usual
|
||||
/var/lib/nfs/rpc_pipefs, the upcall consists of the following steps:
|
||||
|
||||
(1) The process checks the dns_resolve cache to see if it contains a
|
||||
valid entry. If so, it returns that entry and exits.
|
||||
|
||||
(2) If no valid entry exists, the helper script '/sbin/nfs_cache_getent'
|
||||
(may be changed using the 'nfs.cache_getent' kernel boot parameter)
|
||||
is run, with two arguments:
|
||||
- the cache name, "dns_resolve"
|
||||
- the hostname to resolve
|
||||
|
||||
(3) After looking up the corresponding ip address, the helper script
|
||||
writes the result into the rpc_pipefs pseudo-file
|
||||
'/var/lib/nfs/rpc_pipefs/cache/dns_resolve/channel'
|
||||
in the following (text) format:
|
||||
|
||||
"<ip address> <hostname> <ttl>\n"
|
||||
|
||||
Where <ip address> is in the usual IPv4 (123.456.78.90) or IPv6
|
||||
(ffee:ddcc:bbaa:9988:7766:5544:3322:1100, ffee::1100, ...) format.
|
||||
<hostname> is identical to the second argument of the helper
|
||||
script, and <ttl> is the 'time to live' of this cache entry (in
|
||||
units of seconds).
|
||||
|
||||
.. note::
|
||||
If <ip address> is invalid, say the string "0", then a negative
|
||||
entry is created, which will cause the kernel to treat the hostname
|
||||
as having no valid DNS translation.
|
||||
|
||||
|
||||
|
||||
|
||||
A basic sample /sbin/nfs_cache_getent
|
||||
=====================================
|
||||
.. code-block:: sh
|
||||
|
||||
#!/bin/bash
|
||||
#
|
||||
ttl=600
|
||||
#
|
||||
cut=/usr/bin/cut
|
||||
getent=/usr/bin/getent
|
||||
rpc_pipefs=/var/lib/nfs/rpc_pipefs
|
||||
#
|
||||
die()
|
||||
{
|
||||
echo "Usage: $0 cache_name entry_name"
|
||||
exit 1
|
||||
}
|
||||
|
||||
[ $# -lt 2 ] && die
|
||||
cachename="$1"
|
||||
cache_path=${rpc_pipefs}/cache/${cachename}/channel
|
||||
|
||||
case "${cachename}" in
|
||||
dns_resolve)
|
||||
name="$2"
|
||||
result="$(${getent} hosts ${name} | ${cut} -f1 -d\ )"
|
||||
[ -z "${result}" ] && result="0"
|
||||
;;
|
||||
*)
|
||||
die
|
||||
;;
|
||||
esac
|
||||
echo "${result} ${name} ${ttl}" >${cache_path}
|
||||
@@ -0,0 +1,78 @@
|
||||
=============
|
||||
NFS ID Mapper
|
||||
=============
|
||||
|
||||
Id mapper is used by NFS to translate user and group ids into names, and to
|
||||
translate user and group names into ids. Part of this translation involves
|
||||
performing an upcall to userspace to request the information. There are two
|
||||
ways NFS could obtain this information: placing a call to /sbin/request-key
|
||||
or by placing a call to the rpc.idmap daemon.
|
||||
|
||||
NFS will attempt to call /sbin/request-key first. If this succeeds, the
|
||||
result will be cached using the generic request-key cache. This call should
|
||||
only fail if /etc/request-key.conf is not configured for the id_resolver key
|
||||
type, see the "Configuring" section below if you wish to use the request-key
|
||||
method.
|
||||
|
||||
If the call to /sbin/request-key fails (if /etc/request-key.conf is not
|
||||
configured with the id_resolver key type), then the idmapper will ask the
|
||||
legacy rpc.idmap daemon for the id mapping. This result will be stored
|
||||
in a custom NFS idmap cache.
|
||||
|
||||
|
||||
Configuring
|
||||
===========
|
||||
|
||||
The file /etc/request-key.conf will need to be modified so /sbin/request-key can
|
||||
direct the upcall. The following line should be added:
|
||||
|
||||
``#OP TYPE DESCRIPTION CALLOUT INFO PROGRAM ARG1 ARG2 ARG3 ...``
|
||||
``#====== ======= =============== =============== ===============================``
|
||||
``create id_resolver * * /usr/sbin/nfs.idmap %k %d 600``
|
||||
|
||||
|
||||
This will direct all id_resolver requests to the program /usr/sbin/nfs.idmap.
|
||||
The last parameter, 600, defines how many seconds into the future the key will
|
||||
expire. This parameter is optional for /usr/sbin/nfs.idmap. When the timeout
|
||||
is not specified, nfs.idmap will default to 600 seconds.
|
||||
|
||||
id mapper uses for key descriptions::
|
||||
|
||||
uid: Find the UID for the given user
|
||||
gid: Find the GID for the given group
|
||||
user: Find the user name for the given UID
|
||||
group: Find the group name for the given GID
|
||||
|
||||
You can handle any of these individually, rather than using the generic upcall
|
||||
program. If you would like to use your own program for a uid lookup then you
|
||||
would edit your request-key.conf so it look similar to this:
|
||||
|
||||
``#OP TYPE DESCRIPTION CALLOUT INFO PROGRAM ARG1 ARG2 ARG3 ...``
|
||||
``#====== ======= =============== =============== ===============================``
|
||||
``create id_resolver uid:* * /some/other/program %k %d 600``
|
||||
``create id_resolver * * /usr/sbin/nfs.idmap %k %d 600``
|
||||
|
||||
|
||||
Notice that the new line was added above the line for the generic program.
|
||||
request-key will find the first matching line and corresponding program. In
|
||||
this case, /some/other/program will handle all uid lookups and
|
||||
/usr/sbin/nfs.idmap will handle gid, user, and group lookups.
|
||||
|
||||
See Documentation/security/keys/request-key.rst for more information
|
||||
about the request-key function.
|
||||
|
||||
|
||||
nfs.idmap
|
||||
=========
|
||||
|
||||
nfs.idmap is designed to be called by request-key, and should not be run "by
|
||||
hand". This program takes two arguments, a serialized key and a key
|
||||
description. The serialized key is first converted into a key_serial_t, and
|
||||
then passed as an argument to keyctl_instantiate (both are part of keyutils.h).
|
||||
|
||||
The actual lookups are performed by functions found in nfsidmap.h. nfs.idmap
|
||||
determines the correct function to call by looking at the first part of the
|
||||
description string. For example, a uid lookup description will appear as
|
||||
"uid:user@domain".
|
||||
|
||||
nfs.idmap will return 0 if the key was instantiated, and non-zero otherwise.
|
||||
@@ -0,0 +1,292 @@
|
||||
===================
|
||||
Setting up NFS/RDMA
|
||||
===================
|
||||
|
||||
:Author:
|
||||
NetApp and Open Grid Computing (May 29, 2008)
|
||||
|
||||
.. warning::
|
||||
This document is probably obsolete.
|
||||
|
||||
Overview
|
||||
========
|
||||
|
||||
This document describes how to install and setup the Linux NFS/RDMA client
|
||||
and server software.
|
||||
|
||||
The NFS/RDMA client was first included in Linux 2.6.24. The NFS/RDMA server
|
||||
was first included in the following release, Linux 2.6.25.
|
||||
|
||||
In our testing, we have obtained excellent performance results (full 10Gbit
|
||||
wire bandwidth at minimal client CPU) under many workloads. The code passes
|
||||
the full Connectathon test suite and operates over both Infiniband and iWARP
|
||||
RDMA adapters.
|
||||
|
||||
Getting Help
|
||||
============
|
||||
|
||||
If you get stuck, you can ask questions on the
|
||||
nfs-rdma-devel@lists.sourceforge.net mailing list.
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
These instructions are a step by step guide to building a machine for
|
||||
use with NFS/RDMA.
|
||||
|
||||
- Install an RDMA device
|
||||
|
||||
Any device supported by the drivers in drivers/infiniband/hw is acceptable.
|
||||
|
||||
Testing has been performed using several Mellanox-based IB cards, the
|
||||
Ammasso AMS1100 iWARP adapter, and the Chelsio cxgb3 iWARP adapter.
|
||||
|
||||
- Install a Linux distribution and tools
|
||||
|
||||
The first kernel release to contain both the NFS/RDMA client and server was
|
||||
Linux 2.6.25 Therefore, a distribution compatible with this and subsequent
|
||||
Linux kernel release should be installed.
|
||||
|
||||
The procedures described in this document have been tested with
|
||||
distributions from Red Hat's Fedora Project (http://fedora.redhat.com/).
|
||||
|
||||
- Install nfs-utils-1.1.2 or greater on the client
|
||||
|
||||
An NFS/RDMA mount point can be obtained by using the mount.nfs command in
|
||||
nfs-utils-1.1.2 or greater (nfs-utils-1.1.1 was the first nfs-utils
|
||||
version with support for NFS/RDMA mounts, but for various reasons we
|
||||
recommend using nfs-utils-1.1.2 or greater). To see which version of
|
||||
mount.nfs you are using, type:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
$ /sbin/mount.nfs -V
|
||||
|
||||
If the version is less than 1.1.2 or the command does not exist,
|
||||
you should install the latest version of nfs-utils.
|
||||
|
||||
Download the latest package from: http://www.kernel.org/pub/linux/utils/nfs
|
||||
|
||||
Uncompress the package and follow the installation instructions.
|
||||
|
||||
If you will not need the idmapper and gssd executables (you do not need
|
||||
these to create an NFS/RDMA enabled mount command), the installation
|
||||
process can be simplified by disabling these features when running
|
||||
configure:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
$ ./configure --disable-gss --disable-nfsv4
|
||||
|
||||
To build nfs-utils you will need the tcp_wrappers package installed. For
|
||||
more information on this see the package's README and INSTALL files.
|
||||
|
||||
After building the nfs-utils package, there will be a mount.nfs binary in
|
||||
the utils/mount directory. This binary can be used to initiate NFS v2, v3,
|
||||
or v4 mounts. To initiate a v4 mount, the binary must be called
|
||||
mount.nfs4. The standard technique is to create a symlink called
|
||||
mount.nfs4 to mount.nfs.
|
||||
|
||||
This mount.nfs binary should be installed at /sbin/mount.nfs as follows:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
$ sudo cp utils/mount/mount.nfs /sbin/mount.nfs
|
||||
|
||||
In this location, mount.nfs will be invoked automatically for NFS mounts
|
||||
by the system mount command.
|
||||
|
||||
.. note::
|
||||
mount.nfs and therefore nfs-utils-1.1.2 or greater is only needed
|
||||
on the NFS client machine. You do not need this specific version of
|
||||
nfs-utils on the server. Furthermore, only the mount.nfs command from
|
||||
nfs-utils-1.1.2 is needed on the client.
|
||||
|
||||
- Install a Linux kernel with NFS/RDMA
|
||||
|
||||
The NFS/RDMA client and server are both included in the mainline Linux
|
||||
kernel version 2.6.25 and later. This and other versions of the Linux
|
||||
kernel can be found at: https://www.kernel.org/pub/linux/kernel/
|
||||
|
||||
Download the sources and place them in an appropriate location.
|
||||
|
||||
- Configure the RDMA stack
|
||||
|
||||
Make sure your kernel configuration has RDMA support enabled. Under
|
||||
Device Drivers -> InfiniBand support, update the kernel configuration
|
||||
to enable InfiniBand support [NOTE: the option name is misleading. Enabling
|
||||
InfiniBand support is required for all RDMA devices (IB, iWARP, etc.)].
|
||||
|
||||
Enable the appropriate IB HCA support (mlx4, mthca, ehca, ipath, etc.) or
|
||||
iWARP adapter support (amso, cxgb3, etc.).
|
||||
|
||||
If you are using InfiniBand, be sure to enable IP-over-InfiniBand support.
|
||||
|
||||
- Configure the NFS client and server
|
||||
|
||||
Your kernel configuration must also have NFS file system support and/or
|
||||
NFS server support enabled. These and other NFS related configuration
|
||||
options can be found under File Systems -> Network File Systems.
|
||||
|
||||
- Build, install, reboot
|
||||
|
||||
The NFS/RDMA code will be enabled automatically if NFS and RDMA
|
||||
are turned on. The NFS/RDMA client and server are configured via the hidden
|
||||
SUNRPC_XPRT_RDMA config option that depends on SUNRPC and INFINIBAND. The
|
||||
value of SUNRPC_XPRT_RDMA will be:
|
||||
|
||||
#. N if either SUNRPC or INFINIBAND are N, in this case the NFS/RDMA client
|
||||
and server will not be built
|
||||
|
||||
#. M if both SUNRPC and INFINIBAND are on (M or Y) and at least one is M,
|
||||
in this case the NFS/RDMA client and server will be built as modules
|
||||
|
||||
#. Y if both SUNRPC and INFINIBAND are Y, in this case the NFS/RDMA client
|
||||
and server will be built into the kernel
|
||||
|
||||
Therefore, if you have followed the steps above and turned no NFS and RDMA,
|
||||
the NFS/RDMA client and server will be built.
|
||||
|
||||
Build a new kernel, install it, boot it.
|
||||
|
||||
Check RDMA and NFS Setup
|
||||
========================
|
||||
|
||||
Before configuring the NFS/RDMA software, it is a good idea to test
|
||||
your new kernel to ensure that the kernel is working correctly.
|
||||
In particular, it is a good idea to verify that the RDMA stack
|
||||
is functioning as expected and standard NFS over TCP/IP and/or UDP/IP
|
||||
is working properly.
|
||||
|
||||
- Check RDMA Setup
|
||||
|
||||
If you built the RDMA components as modules, load them at
|
||||
this time. For example, if you are using a Mellanox Tavor/Sinai/Arbel
|
||||
card:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
$ modprobe ib_mthca
|
||||
$ modprobe ib_ipoib
|
||||
|
||||
If you are using InfiniBand, make sure there is a Subnet Manager (SM)
|
||||
running on the network. If your IB switch has an embedded SM, you can
|
||||
use it. Otherwise, you will need to run an SM, such as OpenSM, on one
|
||||
of your end nodes.
|
||||
|
||||
If an SM is running on your network, you should see the following:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
$ cat /sys/class/infiniband/driverX/ports/1/state
|
||||
4: ACTIVE
|
||||
|
||||
where driverX is mthca0, ipath5, ehca3, etc.
|
||||
|
||||
To further test the InfiniBand software stack, use IPoIB (this
|
||||
assumes you have two IB hosts named host1 and host2):
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
host1$ ip link set dev ib0 up
|
||||
host1$ ip address add dev ib0 a.b.c.x
|
||||
host2$ ip link set dev ib0 up
|
||||
host2$ ip address add dev ib0 a.b.c.y
|
||||
host1$ ping a.b.c.y
|
||||
host2$ ping a.b.c.x
|
||||
|
||||
For other device types, follow the appropriate procedures.
|
||||
|
||||
- Check NFS Setup
|
||||
|
||||
For the NFS components enabled above (client and/or server),
|
||||
test their functionality over standard Ethernet using TCP/IP or UDP/IP.
|
||||
|
||||
NFS/RDMA Setup
|
||||
==============
|
||||
|
||||
We recommend that you use two machines, one to act as the client and
|
||||
one to act as the server.
|
||||
|
||||
One time configuration:
|
||||
-----------------------
|
||||
|
||||
- On the server system, configure the /etc/exports file and start the NFS/RDMA server.
|
||||
|
||||
Exports entries with the following formats have been tested::
|
||||
|
||||
/vol0 192.168.0.47(fsid=0,rw,async,insecure,no_root_squash)
|
||||
/vol0 192.168.0.0/255.255.255.0(fsid=0,rw,async,insecure,no_root_squash)
|
||||
|
||||
The IP address(es) is(are) the client's IPoIB address for an InfiniBand
|
||||
HCA or the client's iWARP address(es) for an RNIC.
|
||||
|
||||
.. note::
|
||||
The "insecure" option must be used because the NFS/RDMA client does
|
||||
not use a reserved port.
|
||||
|
||||
Each time a machine boots:
|
||||
--------------------------
|
||||
|
||||
- Load and configure the RDMA drivers
|
||||
|
||||
For InfiniBand using a Mellanox adapter:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
$ modprobe ib_mthca
|
||||
$ modprobe ib_ipoib
|
||||
$ ip li set dev ib0 up
|
||||
$ ip addr add dev ib0 a.b.c.d
|
||||
|
||||
.. note::
|
||||
Please use unique addresses for the client and server!
|
||||
|
||||
- Start the NFS server
|
||||
|
||||
If the NFS/RDMA server was built as a module (CONFIG_SUNRPC_XPRT_RDMA=m in
|
||||
kernel config), load the RDMA transport module:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
$ modprobe svcrdma
|
||||
|
||||
Regardless of how the server was built (module or built-in), start the
|
||||
server:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
$ /etc/init.d/nfs start
|
||||
|
||||
or
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
$ service nfs start
|
||||
|
||||
Instruct the server to listen on the RDMA transport:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
$ echo rdma 20049 > /proc/fs/nfsd/portlist
|
||||
|
||||
- On the client system
|
||||
|
||||
If the NFS/RDMA client was built as a module (CONFIG_SUNRPC_XPRT_RDMA=m in
|
||||
kernel config), load the RDMA client module:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
$ modprobe xprtrdma.ko
|
||||
|
||||
Regardless of how the client was built (module or built-in), use this
|
||||
command to mount the NFS/RDMA server:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
$ mount -o rdma,port=20049 <IPoIB-server-name-or-address>:/<export> /mnt
|
||||
|
||||
To verify that the mount is using RDMA, run "cat /proc/mounts" and check
|
||||
the "proto" field for the given mount.
|
||||
|
||||
Congratulations! You're using NFS/RDMA!
|
||||
@@ -0,0 +1,40 @@
|
||||
==================================
|
||||
Administrative interfaces for nfsd
|
||||
==================================
|
||||
|
||||
Note that normally these interfaces are used only by the utilities in
|
||||
nfs-utils.
|
||||
|
||||
nfsd is controlled mainly by pseudofiles under the "nfsd" filesystem,
|
||||
which is normally mounted at /proc/fs/nfsd/.
|
||||
|
||||
The server is always started by the first write of a nonzero value to
|
||||
nfsd/threads.
|
||||
|
||||
Before doing that, NFSD can be told which sockets to listen on by
|
||||
writing to nfsd/portlist; that write may be:
|
||||
|
||||
- an ascii-encoded file descriptor, which should refer to a
|
||||
bound (and listening, for tcp) socket, or
|
||||
- "transportname port", where transportname is currently either
|
||||
"udp", "tcp", or "rdma".
|
||||
|
||||
If nfsd is started without doing any of these, then it will create one
|
||||
udp and one tcp listener at port 2049 (see nfsd_init_socks).
|
||||
|
||||
On startup, nfsd and lockd grace periods start. nfsd is shut down by a write of
|
||||
0 to nfsd/threads. All locks and state are thrown away at that point.
|
||||
|
||||
Between startup and shutdown, the number of threads may be adjusted up
|
||||
or down by additional writes to nfsd/threads or by writes to
|
||||
nfsd/pool_threads.
|
||||
|
||||
For more detail about files under nfsd/ and what they control, see
|
||||
fs/nfsd/nfsctl.c; most of them have detailed comments.
|
||||
|
||||
Implementation notes
|
||||
====================
|
||||
|
||||
Note that the rpc server requires the caller to serialize addition and
|
||||
removal of listening sockets, and startup and shutdown of the server.
|
||||
For nfsd this is done using nfsd_mutex.
|
||||
@@ -0,0 +1,364 @@
|
||||
===============================================
|
||||
Mounting the root filesystem via NFS (nfsroot)
|
||||
===============================================
|
||||
|
||||
:Authors:
|
||||
Written 1996 by Gero Kuhlmann <gero@gkminix.han.de>
|
||||
|
||||
Updated 1997 by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
|
||||
|
||||
Updated 2006 by Nico Schottelius <nico-kernel-nfsroot@schottelius.org>
|
||||
|
||||
Updated 2006 by Horms <horms@verge.net.au>
|
||||
|
||||
Updated 2018 by Chris Novakovic <chris@chrisn.me.uk>
|
||||
|
||||
|
||||
|
||||
In order to use a diskless system, such as an X-terminal or printer server for
|
||||
example, it is necessary for the root filesystem to be present on a non-disk
|
||||
device. This may be an initramfs (see
|
||||
Documentation/filesystems/ramfs-rootfs-initramfs.txt), a ramdisk (see
|
||||
Documentation/admin-guide/initrd.rst) or a filesystem mounted via NFS. The
|
||||
following text describes on how to use NFS for the root filesystem. For the rest
|
||||
of this text 'client' means the diskless system, and 'server' means the NFS
|
||||
server.
|
||||
|
||||
|
||||
|
||||
|
||||
Enabling nfsroot capabilities
|
||||
=============================
|
||||
|
||||
In order to use nfsroot, NFS client support needs to be selected as
|
||||
built-in during configuration. Once this has been selected, the nfsroot
|
||||
option will become available, which should also be selected.
|
||||
|
||||
In the networking options, kernel level autoconfiguration can be selected,
|
||||
along with the types of autoconfiguration to support. Selecting all of
|
||||
DHCP, BOOTP and RARP is safe.
|
||||
|
||||
|
||||
|
||||
|
||||
Kernel command line
|
||||
===================
|
||||
|
||||
When the kernel has been loaded by a boot loader (see below) it needs to be
|
||||
told what root fs device to use. And in the case of nfsroot, where to find
|
||||
both the server and the name of the directory on the server to mount as root.
|
||||
This can be established using the following kernel command line parameters:
|
||||
|
||||
|
||||
root=/dev/nfs
|
||||
This is necessary to enable the pseudo-NFS-device. Note that it's not a
|
||||
real device but just a synonym to tell the kernel to use NFS instead of
|
||||
a real device.
|
||||
|
||||
|
||||
nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
|
||||
If the `nfsroot' parameter is NOT given on the command line,
|
||||
the default ``"/tftpboot/%s"`` will be used.
|
||||
|
||||
<server-ip> Specifies the IP address of the NFS server.
|
||||
The default address is determined by the ip parameter
|
||||
(see below). This parameter allows the use of different
|
||||
servers for IP autoconfiguration and NFS.
|
||||
|
||||
<root-dir> Name of the directory on the server to mount as root.
|
||||
If there is a "%s" token in the string, it will be
|
||||
replaced by the ASCII-representation of the client's
|
||||
IP address.
|
||||
|
||||
<nfs-options> Standard NFS options. All options are separated by commas.
|
||||
The following defaults are used::
|
||||
|
||||
port = as given by server portmap daemon
|
||||
rsize = 4096
|
||||
wsize = 4096
|
||||
timeo = 7
|
||||
retrans = 3
|
||||
acregmin = 3
|
||||
acregmax = 60
|
||||
acdirmin = 30
|
||||
acdirmax = 60
|
||||
flags = hard, nointr, noposix, cto, ac
|
||||
|
||||
|
||||
ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>:<dns0-ip>:<dns1-ip>:<ntp0-ip>
|
||||
This parameter tells the kernel how to configure IP addresses of devices
|
||||
and also how to set up the IP routing table. It was originally called
|
||||
nfsaddrs, but now the boot-time IP configuration works independently of
|
||||
NFS, so it was renamed to ip and the old name remained as an alias for
|
||||
compatibility reasons.
|
||||
|
||||
If this parameter is missing from the kernel command line, all fields are
|
||||
assumed to be empty, and the defaults mentioned below apply. In general
|
||||
this means that the kernel tries to configure everything using
|
||||
autoconfiguration.
|
||||
|
||||
The <autoconf> parameter can appear alone as the value to the ip
|
||||
parameter (without all the ':' characters before). If the value is
|
||||
"ip=off" or "ip=none", no autoconfiguration will take place, otherwise
|
||||
autoconfiguration will take place. The most common way to use this
|
||||
is "ip=dhcp".
|
||||
|
||||
<client-ip> IP address of the client.
|
||||
Default: Determined using autoconfiguration.
|
||||
|
||||
<server-ip> IP address of the NFS server.
|
||||
If RARP is used to determine
|
||||
the client address and this parameter is NOT empty only
|
||||
replies from the specified server are accepted.
|
||||
|
||||
Only required for NFS root. That is autoconfiguration
|
||||
will not be triggered if it is missing and NFS root is not
|
||||
in operation.
|
||||
|
||||
Value is exported to /proc/net/pnp with the prefix "bootserver "
|
||||
(see below).
|
||||
|
||||
Default: Determined using autoconfiguration.
|
||||
The address of the autoconfiguration server is used.
|
||||
|
||||
<gw-ip> IP address of a gateway if the server is on a different subnet.
|
||||
Default: Determined using autoconfiguration.
|
||||
|
||||
<netmask> Netmask for local network interface.
|
||||
If unspecified the netmask is derived from the client IP address
|
||||
assuming classful addressing.
|
||||
|
||||
Default: Determined using autoconfiguration.
|
||||
|
||||
<hostname> Name of the client.
|
||||
If a '.' character is present, anything
|
||||
before the first '.' is used as the client's hostname, and anything
|
||||
after it is used as its NIS domain name. May be supplied by
|
||||
autoconfiguration, but its absence will not trigger autoconfiguration.
|
||||
If specified and DHCP is used, the user-provided hostname (and NIS
|
||||
domain name, if present) will be carried in the DHCP request; this
|
||||
may cause a DNS record to be created or updated for the client.
|
||||
|
||||
Default: Client IP address is used in ASCII notation.
|
||||
|
||||
<device> Name of network device to use.
|
||||
Default: If the host only has one device, it is used.
|
||||
Otherwise the device is determined using
|
||||
autoconfiguration. This is done by sending
|
||||
autoconfiguration requests out of all devices,
|
||||
and using the device that received the first reply.
|
||||
|
||||
<autoconf> Method to use for autoconfiguration.
|
||||
In the case of options
|
||||
which specify multiple autoconfiguration protocols,
|
||||
requests are sent using all protocols, and the first one
|
||||
to reply is used.
|
||||
|
||||
Only autoconfiguration protocols that have been compiled
|
||||
into the kernel will be used, regardless of the value of
|
||||
this option::
|
||||
|
||||
off or none: don't use autoconfiguration
|
||||
(do static IP assignment instead)
|
||||
on or any: use any protocol available in the kernel
|
||||
(default)
|
||||
dhcp: use DHCP
|
||||
bootp: use BOOTP
|
||||
rarp: use RARP
|
||||
both: use both BOOTP and RARP but not DHCP
|
||||
(old option kept for backwards compatibility)
|
||||
|
||||
if dhcp is used, the client identifier can be used by following
|
||||
format "ip=dhcp,client-id-type,client-id-value"
|
||||
|
||||
Default: any
|
||||
|
||||
<dns0-ip> IP address of primary nameserver.
|
||||
Value is exported to /proc/net/pnp with the prefix "nameserver "
|
||||
(see below).
|
||||
|
||||
Default: None if not using autoconfiguration; determined
|
||||
automatically if using autoconfiguration.
|
||||
|
||||
<dns1-ip> IP address of secondary nameserver.
|
||||
See <dns0-ip>.
|
||||
|
||||
<ntp0-ip> IP address of a Network Time Protocol (NTP) server.
|
||||
Value is exported to /proc/net/ipconfig/ntp_servers, but is
|
||||
otherwise unused (see below).
|
||||
|
||||
Default: None if not using autoconfiguration; determined
|
||||
automatically if using autoconfiguration.
|
||||
|
||||
After configuration (whether manual or automatic) is complete, two files
|
||||
are created in the following format; lines are omitted if their respective
|
||||
value is empty following configuration:
|
||||
|
||||
- /proc/net/pnp:
|
||||
|
||||
#PROTO: <DHCP|BOOTP|RARP|MANUAL> (depending on configuration method)
|
||||
domain <dns-domain> (if autoconfigured, the DNS domain)
|
||||
nameserver <dns0-ip> (primary name server IP)
|
||||
nameserver <dns1-ip> (secondary name server IP)
|
||||
nameserver <dns2-ip> (tertiary name server IP)
|
||||
bootserver <server-ip> (NFS server IP)
|
||||
|
||||
- /proc/net/ipconfig/ntp_servers:
|
||||
|
||||
<ntp0-ip> (NTP server IP)
|
||||
<ntp1-ip> (NTP server IP)
|
||||
<ntp2-ip> (NTP server IP)
|
||||
|
||||
<dns-domain> and <dns2-ip> (in /proc/net/pnp) and <ntp1-ip> and <ntp2-ip>
|
||||
(in /proc/net/ipconfig/ntp_servers) are requested during autoconfiguration;
|
||||
they cannot be specified as part of the "ip=" kernel command line parameter.
|
||||
|
||||
Because the "domain" and "nameserver" options are recognised by DNS
|
||||
resolvers, /etc/resolv.conf is often linked to /proc/net/pnp on systems
|
||||
that use an NFS root filesystem.
|
||||
|
||||
Note that the kernel will not synchronise the system time with any NTP
|
||||
servers it discovers; this is the responsibility of a user space process
|
||||
(e.g. an initrd/initramfs script that passes the IP addresses listed in
|
||||
/proc/net/ipconfig/ntp_servers to an NTP client before mounting the real
|
||||
root filesystem if it is on NFS).
|
||||
|
||||
|
||||
nfsrootdebug
|
||||
This parameter enables debugging messages to appear in the kernel
|
||||
log at boot time so that administrators can verify that the correct
|
||||
NFS mount options, server address, and root path are passed to the
|
||||
NFS client.
|
||||
|
||||
|
||||
rdinit=<executable file>
|
||||
To specify which file contains the program that starts system
|
||||
initialization, administrators can use this command line parameter.
|
||||
The default value of this parameter is "/init". If the specified
|
||||
file exists and the kernel can execute it, root filesystem related
|
||||
kernel command line parameters, including 'nfsroot=', are ignored.
|
||||
|
||||
A description of the process of mounting the root file system can be
|
||||
found in Documentation/driver-api/early-userspace/early_userspace_support.rst
|
||||
|
||||
|
||||
Boot Loader
|
||||
===========
|
||||
|
||||
To get the kernel into memory different approaches can be used.
|
||||
They depend on various facilities being available:
|
||||
|
||||
|
||||
- Booting from a floppy using syslinux
|
||||
|
||||
When building kernels, an easy way to create a boot floppy that uses
|
||||
syslinux is to use the zdisk or bzdisk make targets which use zimage
|
||||
and bzimage images respectively. Both targets accept the
|
||||
FDARGS parameter which can be used to set the kernel command line.
|
||||
|
||||
e.g::
|
||||
|
||||
make bzdisk FDARGS="root=/dev/nfs"
|
||||
|
||||
Note that the user running this command will need to have
|
||||
access to the floppy drive device, /dev/fd0
|
||||
|
||||
For more information on syslinux, including how to create bootdisks
|
||||
for prebuilt kernels, see http://syslinux.zytor.com/
|
||||
|
||||
.. note::
|
||||
Previously it was possible to write a kernel directly to
|
||||
a floppy using dd, configure the boot device using rdev, and
|
||||
boot using the resulting floppy. Linux no longer supports this
|
||||
method of booting.
|
||||
|
||||
- Booting from a cdrom using isolinux
|
||||
|
||||
When building kernels, an easy way to create a bootable cdrom that
|
||||
uses isolinux is to use the isoimage target which uses a bzimage
|
||||
image. Like zdisk and bzdisk, this target accepts the FDARGS
|
||||
parameter which can be used to set the kernel command line.
|
||||
|
||||
e.g::
|
||||
|
||||
make isoimage FDARGS="root=/dev/nfs"
|
||||
|
||||
The resulting iso image will be arch/<ARCH>/boot/image.iso
|
||||
This can be written to a cdrom using a variety of tools including
|
||||
cdrecord.
|
||||
|
||||
e.g::
|
||||
|
||||
cdrecord dev=ATAPI:1,0,0 arch/x86/boot/image.iso
|
||||
|
||||
For more information on isolinux, including how to create bootdisks
|
||||
for prebuilt kernels, see http://syslinux.zytor.com/
|
||||
|
||||
- Using LILO
|
||||
|
||||
When using LILO all the necessary command line parameters may be
|
||||
specified using the 'append=' directive in the LILO configuration
|
||||
file.
|
||||
|
||||
However, to use the 'root=' directive you also need to create
|
||||
a dummy root device, which may be removed after LILO is run.
|
||||
|
||||
e.g::
|
||||
|
||||
mknod /dev/boot255 c 0 255
|
||||
|
||||
For information on configuring LILO, please refer to its documentation.
|
||||
|
||||
- Using GRUB
|
||||
|
||||
When using GRUB, kernel parameter are simply appended after the kernel
|
||||
specification: kernel <kernel> <parameters>
|
||||
|
||||
- Using loadlin
|
||||
|
||||
loadlin may be used to boot Linux from a DOS command prompt without
|
||||
requiring a local hard disk to mount as root. This has not been
|
||||
thoroughly tested by the authors of this document, but in general
|
||||
it should be possible configure the kernel command line similarly
|
||||
to the configuration of LILO.
|
||||
|
||||
Please refer to the loadlin documentation for further information.
|
||||
|
||||
- Using a boot ROM
|
||||
|
||||
This is probably the most elegant way of booting a diskless client.
|
||||
With a boot ROM the kernel is loaded using the TFTP protocol. The
|
||||
authors of this document are not aware of any no commercial boot
|
||||
ROMs that support booting Linux over the network. However, there
|
||||
are two free implementations of a boot ROM, netboot-nfs and
|
||||
etherboot, both of which are available on sunsite.unc.edu, and both
|
||||
of which contain everything you need to boot a diskless Linux client.
|
||||
|
||||
- Using pxelinux
|
||||
|
||||
Pxelinux may be used to boot linux using the PXE boot loader
|
||||
which is present on many modern network cards.
|
||||
|
||||
When using pxelinux, the kernel image is specified using
|
||||
"kernel <relative-path-below /tftpboot>". The nfsroot parameters
|
||||
are passed to the kernel by adding them to the "append" line.
|
||||
It is common to use serial console in conjunction with pxeliunx,
|
||||
see Documentation/admin-guide/serial-console.rst for more information.
|
||||
|
||||
For more information on isolinux, including how to create bootdisks
|
||||
for prebuilt kernels, see http://syslinux.zytor.com/
|
||||
|
||||
|
||||
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
The nfsroot code in the kernel and the RARP support have been written
|
||||
by Gero Kuhlmann <gero@gkminix.han.de>.
|
||||
|
||||
The rest of the IP layer autoconfiguration code has been written
|
||||
by Martin Mares <mj@atrey.karlin.mff.cuni.cz>.
|
||||
|
||||
In order to write the initial version of nfsroot I would like to thank
|
||||
Jens-Uwe Mager <jum@anubis.han.de> for his help.
|
||||
@@ -0,0 +1,42 @@
|
||||
===================================
|
||||
pNFS block layout server user guide
|
||||
===================================
|
||||
|
||||
The Linux NFS server now supports the pNFS block layout extension. In this
|
||||
case the NFS server acts as Metadata Server (MDS) for pNFS, which in addition
|
||||
to handling all the metadata access to the NFS export also hands out layouts
|
||||
to the clients to directly access the underlying block devices that are
|
||||
shared with the client.
|
||||
|
||||
To use pNFS block layouts with with the Linux NFS server the exported file
|
||||
system needs to support the pNFS block layouts (currently just XFS), and the
|
||||
file system must sit on shared storage (typically iSCSI) that is accessible
|
||||
to the clients in addition to the MDS. As of now the file system needs to
|
||||
sit directly on the exported volume, striping or concatenation of
|
||||
volumes on the MDS and clients is not supported yet.
|
||||
|
||||
On the server, pNFS block volume support is automatically if the file system
|
||||
support it. On the client make sure the kernel has the CONFIG_PNFS_BLOCK
|
||||
option enabled, the blkmapd daemon from nfs-utils is running, and the
|
||||
file system is mounted using the NFSv4.1 protocol version (mount -o vers=4.1).
|
||||
|
||||
If the nfsd server needs to fence a non-responding client it calls
|
||||
/sbin/nfsd-recall-failed with the first argument set to the IP address of
|
||||
the client, and the second argument set to the device node without the /dev
|
||||
prefix for the file system to be fenced. Below is an example file that shows
|
||||
how to translate the device into a serial number from SCSI EVPD 0x80::
|
||||
|
||||
cat > /sbin/nfsd-recall-failed << EOF
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
CLIENT="$1"
|
||||
DEV="/dev/$2"
|
||||
EVPD=`sg_inq --page=0x80 ${DEV} | \
|
||||
grep "Unit serial number:" | \
|
||||
awk -F ': ' '{print $2}'`
|
||||
|
||||
echo "fencing client ${CLIENT} serial ${EVPD}" >> /var/log/pnfsd-fence.log
|
||||
EOF
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
==================================
|
||||
pNFS SCSI layout server user guide
|
||||
==================================
|
||||
|
||||
This document describes support for pNFS SCSI layouts in the Linux NFS server.
|
||||
With pNFS SCSI layouts, the NFS server acts as Metadata Server (MDS) for pNFS,
|
||||
which in addition to handling all the metadata access to the NFS export,
|
||||
also hands out layouts to the clients so that they can directly access the
|
||||
underlying SCSI LUNs that are shared with the client.
|
||||
|
||||
To use pNFS SCSI layouts with with the Linux NFS server, the exported file
|
||||
system needs to support the pNFS SCSI layouts (currently just XFS), and the
|
||||
file system must sit on a SCSI LUN that is accessible to the clients in
|
||||
addition to the MDS. As of now the file system needs to sit directly on the
|
||||
exported LUN, striping or concatenation of LUNs on the MDS and clients
|
||||
is not supported yet.
|
||||
|
||||
On a server built with CONFIG_NFSD_SCSI, the pNFS SCSI volume support is
|
||||
automatically enabled if the file system is exported using the "pnfs"
|
||||
option and the underlying SCSI device support persistent reservations.
|
||||
On the client make sure the kernel has the CONFIG_PNFS_BLOCK option
|
||||
enabled, and the file system is mounted using the NFSv4.1 protocol
|
||||
version (mount -o vers=4.1).
|
||||
@@ -43,7 +43,8 @@ value 1 for supported.
|
||||
|
||||
AXI_ID and AXI_MASKING are mapped on DPCR1 register in performance counter.
|
||||
When non-masked bits are matching corresponding AXI_ID bits then counter is
|
||||
incremented. Perf counter is incremented if
|
||||
incremented. Perf counter is incremented if::
|
||||
|
||||
AxID && AXI_MASKING == AXI_ID && AXI_MASKING
|
||||
|
||||
This filter doesn't support filter different AXI ID for axid-read and axid-write
|
||||
|
||||
@@ -0,0 +1,274 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
=======================================================
|
||||
Legacy Documentation of CPU Performance Scaling Drivers
|
||||
=======================================================
|
||||
|
||||
Included below are historic documents describing assorted
|
||||
:doc:`CPU performance scaling <cpufreq>` drivers. They are reproduced verbatim,
|
||||
with the original white space formatting and indentation preserved, except for
|
||||
the added leading space character in every line of text.
|
||||
|
||||
|
||||
AMD PowerNow! Drivers
|
||||
=====================
|
||||
|
||||
::
|
||||
|
||||
PowerNow! and Cool'n'Quiet are AMD names for frequency
|
||||
management capabilities in AMD processors. As the hardware
|
||||
implementation changes in new generations of the processors,
|
||||
there is a different cpu-freq driver for each generation.
|
||||
|
||||
Note that the driver's will not load on the "wrong" hardware,
|
||||
so it is safe to try each driver in turn when in doubt as to
|
||||
which is the correct driver.
|
||||
|
||||
Note that the functionality to change frequency (and voltage)
|
||||
is not available in all processors. The drivers will refuse
|
||||
to load on processors without this capability. The capability
|
||||
is detected with the cpuid instruction.
|
||||
|
||||
The drivers use BIOS supplied tables to obtain frequency and
|
||||
voltage information appropriate for a particular platform.
|
||||
Frequency transitions will be unavailable if the BIOS does
|
||||
not supply these tables.
|
||||
|
||||
6th Generation: powernow-k6
|
||||
|
||||
7th Generation: powernow-k7: Athlon, Duron, Geode.
|
||||
|
||||
8th Generation: powernow-k8: Athlon, Athlon 64, Opteron, Sempron.
|
||||
Documentation on this functionality in 8th generation processors
|
||||
is available in the "BIOS and Kernel Developer's Guide", publication
|
||||
26094, in chapter 9, available for download from www.amd.com.
|
||||
|
||||
BIOS supplied data, for powernow-k7 and for powernow-k8, may be
|
||||
from either the PSB table or from ACPI objects. The ACPI support
|
||||
is only available if the kernel config sets CONFIG_ACPI_PROCESSOR.
|
||||
The powernow-k8 driver will attempt to use ACPI if so configured,
|
||||
and fall back to PST if that fails.
|
||||
The powernow-k7 driver will try to use the PSB support first, and
|
||||
fall back to ACPI if the PSB support fails. A module parameter,
|
||||
acpi_force, is provided to force ACPI support to be used instead
|
||||
of PSB support.
|
||||
|
||||
|
||||
``cpufreq-nforce2``
|
||||
===================
|
||||
|
||||
::
|
||||
|
||||
The cpufreq-nforce2 driver changes the FSB on nVidia nForce2 platforms.
|
||||
|
||||
This works better than on other platforms, because the FSB of the CPU
|
||||
can be controlled independently from the PCI/AGP clock.
|
||||
|
||||
The module has two options:
|
||||
|
||||
fid: multiplier * 10 (for example 8.5 = 85)
|
||||
min_fsb: minimum FSB
|
||||
|
||||
If not set, fid is calculated from the current CPU speed and the FSB.
|
||||
min_fsb defaults to FSB at boot time - 50 MHz.
|
||||
|
||||
IMPORTANT: The available range is limited downwards!
|
||||
Also the minimum available FSB can differ, for systems
|
||||
booting with 200 MHz, 150 should always work.
|
||||
|
||||
|
||||
``pcc-cpufreq``
|
||||
===============
|
||||
|
||||
::
|
||||
|
||||
/*
|
||||
* pcc-cpufreq.txt - PCC interface documentation
|
||||
*
|
||||
* Copyright (C) 2009 Red Hat, Matthew Garrett <mjg@redhat.com>
|
||||
* Copyright (C) 2009 Hewlett-Packard Development Company, L.P.
|
||||
* Nagananda Chumbalkar <nagananda.chumbalkar@hp.com>
|
||||
*/
|
||||
|
||||
|
||||
Processor Clocking Control Driver
|
||||
---------------------------------
|
||||
|
||||
Contents:
|
||||
---------
|
||||
1. Introduction
|
||||
1.1 PCC interface
|
||||
1.1.1 Get Average Frequency
|
||||
1.1.2 Set Desired Frequency
|
||||
1.2 Platforms affected
|
||||
2. Driver and /sys details
|
||||
2.1 scaling_available_frequencies
|
||||
2.2 cpuinfo_transition_latency
|
||||
2.3 cpuinfo_cur_freq
|
||||
2.4 related_cpus
|
||||
3. Caveats
|
||||
|
||||
1. Introduction:
|
||||
----------------
|
||||
Processor Clocking Control (PCC) is an interface between the platform
|
||||
firmware and OSPM. It is a mechanism for coordinating processor
|
||||
performance (ie: frequency) between the platform firmware and the OS.
|
||||
|
||||
The PCC driver (pcc-cpufreq) allows OSPM to take advantage of the PCC
|
||||
interface.
|
||||
|
||||
OS utilizes the PCC interface to inform platform firmware what frequency the
|
||||
OS wants for a logical processor. The platform firmware attempts to achieve
|
||||
the requested frequency. If the request for the target frequency could not be
|
||||
satisfied by platform firmware, then it usually means that power budget
|
||||
conditions are in place, and "power capping" is taking place.
|
||||
|
||||
1.1 PCC interface:
|
||||
------------------
|
||||
The complete PCC specification is available here:
|
||||
https://acpica.org/sites/acpica/files/Processor-Clocking-Control-v1p0.pdf
|
||||
|
||||
PCC relies on a shared memory region that provides a channel for communication
|
||||
between the OS and platform firmware. PCC also implements a "doorbell" that
|
||||
is used by the OS to inform the platform firmware that a command has been
|
||||
sent.
|
||||
|
||||
The ACPI PCCH() method is used to discover the location of the PCC shared
|
||||
memory region. The shared memory region header contains the "command" and
|
||||
"status" interface. PCCH() also contains details on how to access the platform
|
||||
doorbell.
|
||||
|
||||
The following commands are supported by the PCC interface:
|
||||
* Get Average Frequency
|
||||
* Set Desired Frequency
|
||||
|
||||
The ACPI PCCP() method is implemented for each logical processor and is
|
||||
used to discover the offsets for the input and output buffers in the shared
|
||||
memory region.
|
||||
|
||||
When PCC mode is enabled, the platform will not expose processor performance
|
||||
or throttle states (_PSS, _TSS and related ACPI objects) to OSPM. Therefore,
|
||||
the native P-state driver (such as acpi-cpufreq for Intel, powernow-k8 for
|
||||
AMD) will not load.
|
||||
|
||||
However, OSPM remains in control of policy. The governor (eg: "ondemand")
|
||||
computes the required performance for each processor based on server workload.
|
||||
The PCC driver fills in the command interface, and the input buffer and
|
||||
communicates the request to the platform firmware. The platform firmware is
|
||||
responsible for delivering the requested performance.
|
||||
|
||||
Each PCC command is "global" in scope and can affect all the logical CPUs in
|
||||
the system. Therefore, PCC is capable of performing "group" updates. With PCC
|
||||
the OS is capable of getting/setting the frequency of all the logical CPUs in
|
||||
the system with a single call to the BIOS.
|
||||
|
||||
1.1.1 Get Average Frequency:
|
||||
----------------------------
|
||||
This command is used by the OSPM to query the running frequency of the
|
||||
processor since the last time this command was completed. The output buffer
|
||||
indicates the average unhalted frequency of the logical processor expressed as
|
||||
a percentage of the nominal (ie: maximum) CPU frequency. The output buffer
|
||||
also signifies if the CPU frequency is limited by a power budget condition.
|
||||
|
||||
1.1.2 Set Desired Frequency:
|
||||
----------------------------
|
||||
This command is used by the OSPM to communicate to the platform firmware the
|
||||
desired frequency for a logical processor. The output buffer is currently
|
||||
ignored by OSPM. The next invocation of "Get Average Frequency" will inform
|
||||
OSPM if the desired frequency was achieved or not.
|
||||
|
||||
1.2 Platforms affected:
|
||||
-----------------------
|
||||
The PCC driver will load on any system where the platform firmware:
|
||||
* supports the PCC interface, and the associated PCCH() and PCCP() methods
|
||||
* assumes responsibility for managing the hardware clocking controls in order
|
||||
to deliver the requested processor performance
|
||||
|
||||
Currently, certain HP ProLiant platforms implement the PCC interface. On those
|
||||
platforms PCC is the "default" choice.
|
||||
|
||||
However, it is possible to disable this interface via a BIOS setting. In
|
||||
such an instance, as is also the case on platforms where the PCC interface
|
||||
is not implemented, the PCC driver will fail to load silently.
|
||||
|
||||
2. Driver and /sys details:
|
||||
---------------------------
|
||||
When the driver loads, it merely prints the lowest and the highest CPU
|
||||
frequencies supported by the platform firmware.
|
||||
|
||||
The PCC driver loads with a message such as:
|
||||
pcc-cpufreq: (v1.00.00) driver loaded with frequency limits: 1600 MHz, 2933
|
||||
MHz
|
||||
|
||||
This means that the OPSM can request the CPU to run at any frequency in
|
||||
between the limits (1600 MHz, and 2933 MHz) specified in the message.
|
||||
|
||||
Internally, there is no need for the driver to convert the "target" frequency
|
||||
to a corresponding P-state.
|
||||
|
||||
The VERSION number for the driver will be of the format v.xy.ab.
|
||||
eg: 1.00.02
|
||||
----- --
|
||||
| |
|
||||
| -- this will increase with bug fixes/enhancements to the driver
|
||||
|-- this is the version of the PCC specification the driver adheres to
|
||||
|
||||
|
||||
The following is a brief discussion on some of the fields exported via the
|
||||
/sys filesystem and how their values are affected by the PCC driver:
|
||||
|
||||
2.1 scaling_available_frequencies:
|
||||
----------------------------------
|
||||
scaling_available_frequencies is not created in /sys. No intermediate
|
||||
frequencies need to be listed because the BIOS will try to achieve any
|
||||
frequency, within limits, requested by the governor. A frequency does not have
|
||||
to be strictly associated with a P-state.
|
||||
|
||||
2.2 cpuinfo_transition_latency:
|
||||
-------------------------------
|
||||
The cpuinfo_transition_latency field is 0. The PCC specification does
|
||||
not include a field to expose this value currently.
|
||||
|
||||
2.3 cpuinfo_cur_freq:
|
||||
---------------------
|
||||
A) Often cpuinfo_cur_freq will show a value different than what is declared
|
||||
in the scaling_available_frequencies or scaling_cur_freq, or scaling_max_freq.
|
||||
This is due to "turbo boost" available on recent Intel processors. If certain
|
||||
conditions are met the BIOS can achieve a slightly higher speed than requested
|
||||
by OSPM. An example:
|
||||
|
||||
scaling_cur_freq : 2933000
|
||||
cpuinfo_cur_freq : 3196000
|
||||
|
||||
B) There is a round-off error associated with the cpuinfo_cur_freq value.
|
||||
Since the driver obtains the current frequency as a "percentage" (%) of the
|
||||
nominal frequency from the BIOS, sometimes, the values displayed by
|
||||
scaling_cur_freq and cpuinfo_cur_freq may not match. An example:
|
||||
|
||||
scaling_cur_freq : 1600000
|
||||
cpuinfo_cur_freq : 1583000
|
||||
|
||||
In this example, the nominal frequency is 2933 MHz. The driver obtains the
|
||||
current frequency, cpuinfo_cur_freq, as 54% of the nominal frequency:
|
||||
|
||||
54% of 2933 MHz = 1583 MHz
|
||||
|
||||
Nominal frequency is the maximum frequency of the processor, and it usually
|
||||
corresponds to the frequency of the P0 P-state.
|
||||
|
||||
2.4 related_cpus:
|
||||
-----------------
|
||||
The related_cpus field is identical to affected_cpus.
|
||||
|
||||
affected_cpus : 4
|
||||
related_cpus : 4
|
||||
|
||||
Currently, the PCC driver does not evaluate _PSD. The platforms that support
|
||||
PCC do not implement SW_ALL. So OSPM doesn't need to perform any coordination
|
||||
to ensure that the same frequency is requested of all dependent CPUs.
|
||||
|
||||
3. Caveats:
|
||||
-----------
|
||||
The "cpufreq_stats" module in its present form cannot be loaded and
|
||||
expected to work with the PCC driver. Since the "cpufreq_stats" module
|
||||
provides information wrt each P-state, it is not applicable to the PCC driver.
|
||||
@@ -583,20 +583,17 @@ Power Management Quality of Service for CPUs
|
||||
The power management quality of service (PM QoS) framework in the Linux kernel
|
||||
allows kernel code and user space processes to set constraints on various
|
||||
energy-efficiency features of the kernel to prevent performance from dropping
|
||||
below a required level. The PM QoS constraints can be set globally, in
|
||||
predefined categories referred to as PM QoS classes, or against individual
|
||||
devices.
|
||||
below a required level.
|
||||
|
||||
CPU idle time management can be affected by PM QoS in two ways, through the
|
||||
global constraint in the ``PM_QOS_CPU_DMA_LATENCY`` class and through the
|
||||
resume latency constraints for individual CPUs. Kernel code (e.g. device
|
||||
drivers) can set both of them with the help of special internal interfaces
|
||||
provided by the PM QoS framework. User space can modify the former by opening
|
||||
the :file:`cpu_dma_latency` special device file under :file:`/dev/` and writing
|
||||
a binary value (interpreted as a signed 32-bit integer) to it. In turn, the
|
||||
resume latency constraint for a CPU can be modified by user space by writing a
|
||||
string (representing a signed 32-bit integer) to the
|
||||
:file:`power/pm_qos_resume_latency_us` file under
|
||||
global CPU latency limit and through the resume latency constraints for
|
||||
individual CPUs. Kernel code (e.g. device drivers) can set both of them with
|
||||
the help of special internal interfaces provided by the PM QoS framework. User
|
||||
space can modify the former by opening the :file:`cpu_dma_latency` special
|
||||
device file under :file:`/dev/` and writing a binary value (interpreted as a
|
||||
signed 32-bit integer) to it. In turn, the resume latency constraint for a CPU
|
||||
can be modified from user space by writing a string (representing a signed
|
||||
32-bit integer) to the :file:`power/pm_qos_resume_latency_us` file under
|
||||
:file:`/sys/devices/system/cpu/cpu<N>/` in ``sysfs``, where the CPU number
|
||||
``<N>`` is allocated at the system initialization time. Negative values
|
||||
will be rejected in both cases and, also in both cases, the written integer
|
||||
@@ -605,52 +602,54 @@ number will be interpreted as a requested PM QoS constraint in microseconds.
|
||||
The requested value is not automatically applied as a new constraint, however,
|
||||
as it may be less restrictive (greater in this particular case) than another
|
||||
constraint previously requested by someone else. For this reason, the PM QoS
|
||||
framework maintains a list of requests that have been made so far in each
|
||||
global class and for each device, aggregates them and applies the effective
|
||||
(minimum in this particular case) value as the new constraint.
|
||||
framework maintains a list of requests that have been made so far for the
|
||||
global CPU latency limit and for each individual CPU, aggregates them and
|
||||
applies the effective (minimum in this particular case) value as the new
|
||||
constraint.
|
||||
|
||||
In fact, opening the :file:`cpu_dma_latency` special device file causes a new
|
||||
PM QoS request to be created and added to the priority list of requests in the
|
||||
``PM_QOS_CPU_DMA_LATENCY`` class and the file descriptor coming from the
|
||||
"open" operation represents that request. If that file descriptor is then
|
||||
used for writing, the number written to it will be associated with the PM QoS
|
||||
request represented by it as a new requested constraint value. Next, the
|
||||
priority list mechanism will be used to determine the new effective value of
|
||||
the entire list of requests and that effective value will be set as a new
|
||||
constraint. Thus setting a new requested constraint value will only change the
|
||||
real constraint if the effective "list" value is affected by it. In particular,
|
||||
for the ``PM_QOS_CPU_DMA_LATENCY`` class it only affects the real constraint if
|
||||
it is the minimum of the requested constraints in the list. The process holding
|
||||
a file descriptor obtained by opening the :file:`cpu_dma_latency` special device
|
||||
file controls the PM QoS request associated with that file descriptor, but it
|
||||
controls this particular PM QoS request only.
|
||||
PM QoS request to be created and added to a global priority list of CPU latency
|
||||
limit requests and the file descriptor coming from the "open" operation
|
||||
represents that request. If that file descriptor is then used for writing, the
|
||||
number written to it will be associated with the PM QoS request represented by
|
||||
it as a new requested limit value. Next, the priority list mechanism will be
|
||||
used to determine the new effective value of the entire list of requests and
|
||||
that effective value will be set as a new CPU latency limit. Thus requesting a
|
||||
new limit value will only change the real limit if the effective "list" value is
|
||||
affected by it, which is the case if it is the minimum of the requested values
|
||||
in the list.
|
||||
|
||||
The process holding a file descriptor obtained by opening the
|
||||
:file:`cpu_dma_latency` special device file controls the PM QoS request
|
||||
associated with that file descriptor, but it controls this particular PM QoS
|
||||
request only.
|
||||
|
||||
Closing the :file:`cpu_dma_latency` special device file or, more precisely, the
|
||||
file descriptor obtained while opening it, causes the PM QoS request associated
|
||||
with that file descriptor to be removed from the ``PM_QOS_CPU_DMA_LATENCY``
|
||||
class priority list and destroyed. If that happens, the priority list mechanism
|
||||
will be used, again, to determine the new effective value for the whole list
|
||||
and that value will become the new real constraint.
|
||||
with that file descriptor to be removed from the global priority list of CPU
|
||||
latency limit requests and destroyed. If that happens, the priority list
|
||||
mechanism will be used again, to determine the new effective value for the whole
|
||||
list and that value will become the new limit.
|
||||
|
||||
In turn, for each CPU there is only one resume latency PM QoS request
|
||||
associated with the :file:`power/pm_qos_resume_latency_us` file under
|
||||
In turn, for each CPU there is one resume latency PM QoS request associated with
|
||||
the :file:`power/pm_qos_resume_latency_us` file under
|
||||
:file:`/sys/devices/system/cpu/cpu<N>/` in ``sysfs`` and writing to it causes
|
||||
this single PM QoS request to be updated regardless of which user space
|
||||
process does that. In other words, this PM QoS request is shared by the entire
|
||||
user space, so access to the file associated with it needs to be arbitrated
|
||||
to avoid confusion. [Arguably, the only legitimate use of this mechanism in
|
||||
practice is to pin a process to the CPU in question and let it use the
|
||||
``sysfs`` interface to control the resume latency constraint for it.] It
|
||||
still only is a request, however. It is a member of a priority list used to
|
||||
``sysfs`` interface to control the resume latency constraint for it.] It is
|
||||
still only a request, however. It is an entry in a priority list used to
|
||||
determine the effective value to be set as the resume latency constraint for the
|
||||
CPU in question every time the list of requests is updated this way or another
|
||||
(there may be other requests coming from kernel code in that list).
|
||||
|
||||
CPU idle time governors are expected to regard the minimum of the global
|
||||
effective ``PM_QOS_CPU_DMA_LATENCY`` class constraint and the effective
|
||||
resume latency constraint for the given CPU as the upper limit for the exit
|
||||
latency of the idle states they can select for that CPU. They should never
|
||||
select any idle states with exit latency beyond that limit.
|
||||
(effective) CPU latency limit and the effective resume latency constraint for
|
||||
the given CPU as the upper limit for the exit latency of the idle states that
|
||||
they are allowed to select for that CPU. They should never select any idle
|
||||
states with exit latency beyond that limit.
|
||||
|
||||
|
||||
Idle States Control Via Kernel Command Line
|
||||
|
||||
@@ -60,6 +60,9 @@ of the system. The former are always used if the processor model at hand is
|
||||
recognized by ``intel_idle`` and the latter are used if that is required for
|
||||
the given processor model (which is the case for all server processor models
|
||||
recognized by ``intel_idle``) or if the processor model is not recognized.
|
||||
[There is a module parameter that can be used to make the driver use the ACPI
|
||||
tables with any processor model recognized by it; see
|
||||
`below <intel-idle-parameters_>`_.]
|
||||
|
||||
If the ACPI tables are going to be used for building the list of available idle
|
||||
states, ``intel_idle`` first looks for a ``_CST`` object under one of the ACPI
|
||||
@@ -165,7 +168,7 @@ and ``idle=nomwait``. If any of them is present in the kernel command line, the
|
||||
``MWAIT`` instruction is not allowed to be used, so the initialization of
|
||||
``intel_idle`` will fail.
|
||||
|
||||
Apart from that there are two module parameters recognized by ``intel_idle``
|
||||
Apart from that there are four module parameters recognized by ``intel_idle``
|
||||
itself that can be set via the kernel command line (they cannot be updated via
|
||||
sysfs, so that is the only way to change their values).
|
||||
|
||||
@@ -186,9 +189,28 @@ QoS) feature can be used to prevent ``CPUIdle`` from touching those idle states
|
||||
even if they have been enumerated (see :ref:`cpu-pm-qos` in :doc:`cpuidle`).
|
||||
Setting ``max_cstate`` to 0 causes the ``intel_idle`` initialization to fail.
|
||||
|
||||
The ``noacpi`` module parameter (which is recognized by ``intel_idle`` if the
|
||||
kernel has been configured with ACPI support), can be set to make the driver
|
||||
ignore the system's ACPI tables entirely (it is unset by default).
|
||||
The ``no_acpi`` and ``use_acpi`` module parameters (recognized by ``intel_idle``
|
||||
if the kernel has been configured with ACPI support) can be set to make the
|
||||
driver ignore the system's ACPI tables entirely or use them for all of the
|
||||
recognized processor models, respectively (they both are unset by default and
|
||||
``use_acpi`` has no effect if ``no_acpi`` is set).
|
||||
|
||||
The value of the ``states_off`` module parameter (0 by default) represents a
|
||||
list of idle states to be disabled by default in the form of a bitmask.
|
||||
|
||||
Namely, the positions of the bits that are set in the ``states_off`` value are
|
||||
the indices of idle states to be disabled by default (as reflected by the names
|
||||
of the corresponding idle state directories in ``sysfs``, :file:`state0`,
|
||||
:file:`state1` ... :file:`state<i>` ..., where ``<i>`` is the index of the given
|
||||
idle state; see :ref:`idle-states-representation` in :doc:`cpuidle`).
|
||||
|
||||
For example, if ``states_off`` is equal to 3, the driver will disable idle
|
||||
states 0 and 1 by default, and if it is equal to 8, idle state 3 will be
|
||||
disabled by default and so on (bit positions beyond the maximum idle state index
|
||||
are ignored).
|
||||
|
||||
The idle states disabled this way can be enabled (on a per-CPU basis) from user
|
||||
space via ``sysfs``.
|
||||
|
||||
|
||||
.. _intel-idle-core-and-package-idle-states:
|
||||
|
||||
@@ -734,10 +734,10 @@ References
|
||||
==========
|
||||
|
||||
.. [1] Kristen Accardi, *Balancing Power and Performance in the Linux Kernel*,
|
||||
http://events.linuxfoundation.org/sites/events/files/slides/LinuxConEurope_2015.pdf
|
||||
https://events.static.linuxfound.org/sites/events/files/slides/LinuxConEurope_2015.pdf
|
||||
|
||||
.. [2] *Intel® 64 and IA-32 Architectures Software Developer’s Manual Volume 3: System Programming Guide*,
|
||||
http://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-software-developer-system-programming-manual-325384.html
|
||||
https://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-software-developer-system-programming-manual-325384.html
|
||||
|
||||
.. [3] *Advanced Configuration and Power Interface Specification*,
|
||||
https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf
|
||||
|
||||
@@ -153,8 +153,11 @@ for the given CPU architecture includes the low-level code for system resume.
|
||||
Basic ``sysfs`` Interfaces for System Suspend and Hibernation
|
||||
=============================================================
|
||||
|
||||
The following files located in the :file:`/sys/power/` directory can be used by
|
||||
user space for sleep states control.
|
||||
The power management subsystem provides userspace with a unified ``sysfs``
|
||||
interface for system sleep regardless of the underlying system architecture or
|
||||
platform. That interface is located in the :file:`/sys/power/` directory
|
||||
(assuming that ``sysfs`` is mounted at :file:`/sys`) and it consists of the
|
||||
following attributes (files):
|
||||
|
||||
``state``
|
||||
This file contains a list of strings representing sleep states supported
|
||||
@@ -162,9 +165,9 @@ user space for sleep states control.
|
||||
to start a transition of the system into the sleep state represented by
|
||||
that string.
|
||||
|
||||
In particular, the strings "disk", "freeze" and "standby" represent the
|
||||
In particular, the "disk", "freeze" and "standby" strings represent the
|
||||
:ref:`hibernation <hibernation>`, :ref:`suspend-to-idle <s2idle>` and
|
||||
:ref:`standby <standby>` sleep states, respectively. The string "mem"
|
||||
:ref:`standby <standby>` sleep states, respectively. The "mem" string
|
||||
is interpreted in accordance with the contents of the ``mem_sleep`` file
|
||||
described below.
|
||||
|
||||
@@ -177,7 +180,7 @@ user space for sleep states control.
|
||||
associated with the "mem" string in the ``state`` file described above.
|
||||
|
||||
The strings that may be present in this file are "s2idle", "shallow"
|
||||
and "deep". The string "s2idle" always represents :ref:`suspend-to-idle
|
||||
and "deep". The "s2idle" string always represents :ref:`suspend-to-idle
|
||||
<s2idle>` and, by convention, "shallow" and "deep" represent
|
||||
:ref:`standby <standby>` and :ref:`suspend-to-RAM <s2ram>`,
|
||||
respectively.
|
||||
@@ -185,15 +188,17 @@ user space for sleep states control.
|
||||
Writing one of the listed strings into this file causes the system
|
||||
suspend variant represented by it to be associated with the "mem" string
|
||||
in the ``state`` file. The string representing the suspend variant
|
||||
currently associated with the "mem" string in the ``state`` file
|
||||
is listed in square brackets.
|
||||
currently associated with the "mem" string in the ``state`` file is
|
||||
shown in square brackets.
|
||||
|
||||
If the kernel does not support system suspend, this file is not present.
|
||||
|
||||
``disk``
|
||||
This file contains a list of strings representing different operations
|
||||
that can be carried out after the hibernation image has been saved. The
|
||||
possible options are as follows:
|
||||
This file controls the operating mode of hibernation (Suspend-to-Disk).
|
||||
Specifically, it tells the kernel what to do after creating a
|
||||
hibernation image.
|
||||
|
||||
Reading from it returns a list of supported options encoded as:
|
||||
|
||||
``platform``
|
||||
Put the system into a special low-power state (e.g. ACPI S4) to
|
||||
@@ -201,6 +206,11 @@ user space for sleep states control.
|
||||
platform firmware to take a simplified initialization path after
|
||||
wakeup.
|
||||
|
||||
It is only available if the platform provides a special
|
||||
mechanism to put the system to sleep after creating a
|
||||
hibernation image (platforms with ACPI do that as a rule, for
|
||||
example).
|
||||
|
||||
``shutdown``
|
||||
Power off the system.
|
||||
|
||||
@@ -214,22 +224,53 @@ user space for sleep states control.
|
||||
the hibernation image and continue. Otherwise, use the image
|
||||
to restore the previous state of the system.
|
||||
|
||||
It is available if system suspend is supported.
|
||||
|
||||
``test_resume``
|
||||
Diagnostic operation. Load the image as though the system had
|
||||
just woken up from hibernation and the currently running kernel
|
||||
instance was a restore kernel and follow up with full system
|
||||
resume.
|
||||
|
||||
Writing one of the listed strings into this file causes the option
|
||||
Writing one of the strings listed above into this file causes the option
|
||||
represented by it to be selected.
|
||||
|
||||
The currently selected option is shown in square brackets which means
|
||||
The currently selected option is shown in square brackets, which means
|
||||
that the operation represented by it will be carried out after creating
|
||||
and saving the image next time hibernation is triggered by writing
|
||||
``disk`` to :file:`/sys/power/state`.
|
||||
and saving the image when hibernation is triggered by writing ``disk``
|
||||
to :file:`/sys/power/state`.
|
||||
|
||||
If the kernel does not support hibernation, this file is not present.
|
||||
|
||||
``image_size``
|
||||
This file controls the size of hibernation images.
|
||||
|
||||
It can be written a string representing a non-negative integer that will
|
||||
be used as a best-effort upper limit of the image size, in bytes. The
|
||||
hibernation core will do its best to ensure that the image size will not
|
||||
exceed that number, but if that turns out to be impossible to achieve, a
|
||||
hibernation image will still be created and its size will be as small as
|
||||
possible. In particular, writing '0' to this file causes the size of
|
||||
hibernation images to be minimum.
|
||||
|
||||
Reading from it returns the current image size limit, which is set to
|
||||
around 2/5 of the available RAM size by default.
|
||||
|
||||
``pm_trace``
|
||||
This file controls the "PM trace" mechanism saving the last suspend
|
||||
or resume event point in the RTC memory across reboots. It helps to
|
||||
debug hard lockups or reboots due to device driver failures that occur
|
||||
during system suspend or resume (which is more common) more effectively.
|
||||
|
||||
If it contains "1", the fingerprint of each suspend/resume event point
|
||||
in turn will be stored in the RTC memory (overwriting the actual RTC
|
||||
information), so it will survive a system crash if one occurs right
|
||||
after storing it and it can be used later to identify the driver that
|
||||
caused the crash to happen.
|
||||
|
||||
It contains "0" by default, which may be changed to "1" by writing a
|
||||
string representing a nonzero integer into it.
|
||||
|
||||
According to the above, there are two ways to make the system go into the
|
||||
:ref:`suspend-to-idle <s2idle>` state. The first one is to write "freeze"
|
||||
directly to :file:`/sys/power/state`. The second one is to write "s2idle" to
|
||||
@@ -244,6 +285,7 @@ system go into the :ref:`suspend-to-RAM <s2ram>` state (write "deep" into
|
||||
The default suspend variant (ie. the one to be used without writing anything
|
||||
into :file:`/sys/power/mem_sleep`) is either "deep" (on the majority of systems
|
||||
supporting :ref:`suspend-to-RAM <s2ram>`) or "s2idle", but it can be overridden
|
||||
by the value of the "mem_sleep_default" parameter in the kernel command line.
|
||||
On some ACPI-based systems, depending on the information in the ACPI tables, the
|
||||
default may be "s2idle" even if :ref:`suspend-to-RAM <s2ram>` is supported.
|
||||
by the value of the ``mem_sleep_default`` parameter in the kernel command line.
|
||||
On some systems with ACPI, depending on the information in the ACPI tables, the
|
||||
default may be "s2idle" even if :ref:`suspend-to-RAM <s2ram>` is supported in
|
||||
principle.
|
||||
|
||||
@@ -0,0 +1,270 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0
|
||||
.. include:: <isonum.txt>
|
||||
|
||||
=========================
|
||||
System Suspend Code Flows
|
||||
=========================
|
||||
|
||||
:Copyright: |copy| 2020 Intel Corporation
|
||||
|
||||
:Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
|
||||
|
||||
At least one global system-wide transition needs to be carried out for the
|
||||
system to get from the working state into one of the supported
|
||||
:doc:`sleep states <sleep-states>`. Hibernation requires more than one
|
||||
transition to occur for this purpose, but the other sleep states, commonly
|
||||
referred to as *system-wide suspend* (or simply *system suspend*) states, need
|
||||
only one.
|
||||
|
||||
For those sleep states, the transition from the working state of the system into
|
||||
the target sleep state is referred to as *system suspend* too (in the majority
|
||||
of cases, whether this means a transition or a sleep state of the system should
|
||||
be clear from the context) and the transition back from the sleep state into the
|
||||
working state is referred to as *system resume*.
|
||||
|
||||
The kernel code flows associated with the suspend and resume transitions for
|
||||
different sleep states of the system are quite similar, but there are some
|
||||
significant differences between the :ref:`suspend-to-idle <s2idle>` code flows
|
||||
and the code flows related to the :ref:`suspend-to-RAM <s2ram>` and
|
||||
:ref:`standby <standby>` sleep states.
|
||||
|
||||
The :ref:`suspend-to-RAM <s2ram>` and :ref:`standby <standby>` sleep states
|
||||
cannot be implemented without platform support and the difference between them
|
||||
boils down to the platform-specific actions carried out by the suspend and
|
||||
resume hooks that need to be provided by the platform driver to make them
|
||||
available. Apart from that, the suspend and resume code flows for these sleep
|
||||
states are mostly identical, so they both together will be referred to as
|
||||
*platform-dependent suspend* states in what follows.
|
||||
|
||||
|
||||
.. _s2idle_suspend:
|
||||
|
||||
Suspend-to-idle Suspend Code Flow
|
||||
=================================
|
||||
|
||||
The following steps are taken in order to transition the system from the working
|
||||
state to the :ref:`suspend-to-idle <s2idle>` sleep state:
|
||||
|
||||
1. Invoking system-wide suspend notifiers.
|
||||
|
||||
Kernel subsystems can register callbacks to be invoked when the suspend
|
||||
transition is about to occur and when the resume transition has finished.
|
||||
|
||||
That allows them to prepare for the change of the system state and to clean
|
||||
up after getting back to the working state.
|
||||
|
||||
2. Freezing tasks.
|
||||
|
||||
Tasks are frozen primarily in order to avoid unchecked hardware accesses
|
||||
from user space through MMIO regions or I/O registers exposed directly to
|
||||
it and to prevent user space from entering the kernel while the next step
|
||||
of the transition is in progress (which might have been problematic for
|
||||
various reasons).
|
||||
|
||||
All user space tasks are intercepted as though they were sent a signal and
|
||||
put into uninterruptible sleep until the end of the subsequent system resume
|
||||
transition.
|
||||
|
||||
The kernel threads that choose to be frozen during system suspend for
|
||||
specific reasons are frozen subsequently, but they are not intercepted.
|
||||
Instead, they are expected to periodically check whether or not they need
|
||||
to be frozen and to put themselves into uninterruptible sleep if so. [Note,
|
||||
however, that kernel threads can use locking and other concurrency controls
|
||||
available in kernel space to synchronize themselves with system suspend and
|
||||
resume, which can be much more precise than the freezing, so the latter is
|
||||
not a recommended option for kernel threads.]
|
||||
|
||||
3. Suspending devices and reconfiguring IRQs.
|
||||
|
||||
Devices are suspended in four phases called *prepare*, *suspend*,
|
||||
*late suspend* and *noirq suspend* (see :ref:`driverapi_pm_devices` for more
|
||||
information on what exactly happens in each phase).
|
||||
|
||||
Every device is visited in each phase, but typically it is not physically
|
||||
accessed in more than two of them.
|
||||
|
||||
The runtime PM API is disabled for every device during the *late* suspend
|
||||
phase and high-level ("action") interrupt handlers are prevented from being
|
||||
invoked before the *noirq* suspend phase.
|
||||
|
||||
Interrupts are still handled after that, but they are only acknowledged to
|
||||
interrupt controllers without performing any device-specific actions that
|
||||
would be triggered in the working state of the system (those actions are
|
||||
deferred till the subsequent system resume transition as described
|
||||
`below <s2idle_resume_>`_).
|
||||
|
||||
IRQs associated with system wakeup devices are "armed" so that the resume
|
||||
transition of the system is started when one of them signals an event.
|
||||
|
||||
4. Freezing the scheduler tick and suspending timekeeping.
|
||||
|
||||
When all devices have been suspended, CPUs enter the idle loop and are put
|
||||
into the deepest available idle state. While doing that, each of them
|
||||
"freezes" its own scheduler tick so that the timer events associated with
|
||||
the tick do not occur until the CPU is woken up by another interrupt source.
|
||||
|
||||
The last CPU to enter the idle state also stops the timekeeping which
|
||||
(among other things) prevents high resolution timers from triggering going
|
||||
forward until the first CPU that is woken up restarts the timekeeping.
|
||||
That allows the CPUs to stay in the deep idle state relatively long in one
|
||||
go.
|
||||
|
||||
From this point on, the CPUs can only be woken up by non-timer hardware
|
||||
interrupts. If that happens, they go back to the idle state unless the
|
||||
interrupt that woke up one of them comes from an IRQ that has been armed for
|
||||
system wakeup, in which case the system resume transition is started.
|
||||
|
||||
|
||||
.. _s2idle_resume:
|
||||
|
||||
Suspend-to-idle Resume Code Flow
|
||||
================================
|
||||
|
||||
The following steps are taken in order to transition the system from the
|
||||
:ref:`suspend-to-idle <s2idle>` sleep state into the working state:
|
||||
|
||||
1. Resuming timekeeping and unfreezing the scheduler tick.
|
||||
|
||||
When one of the CPUs is woken up (by a non-timer hardware interrupt), it
|
||||
leaves the idle state entered in the last step of the preceding suspend
|
||||
transition, restarts the timekeeping (unless it has been restarted already
|
||||
by another CPU that woke up earlier) and the scheduler tick on that CPU is
|
||||
unfrozen.
|
||||
|
||||
If the interrupt that has woken up the CPU was armed for system wakeup,
|
||||
the system resume transition begins.
|
||||
|
||||
2. Resuming devices and restoring the working-state configuration of IRQs.
|
||||
|
||||
Devices are resumed in four phases called *noirq resume*, *early resume*,
|
||||
*resume* and *complete* (see :ref:`driverapi_pm_devices` for more
|
||||
information on what exactly happens in each phase).
|
||||
|
||||
Every device is visited in each phase, but typically it is not physically
|
||||
accessed in more than two of them.
|
||||
|
||||
The working-state configuration of IRQs is restored after the *noirq* resume
|
||||
phase and the runtime PM API is re-enabled for every device whose driver
|
||||
supports it during the *early* resume phase.
|
||||
|
||||
3. Thawing tasks.
|
||||
|
||||
Tasks frozen in step 2 of the preceding `suspend <s2idle_suspend_>`_
|
||||
transition are "thawed", which means that they are woken up from the
|
||||
uninterruptible sleep that they went into at that time and user space tasks
|
||||
are allowed to exit the kernel.
|
||||
|
||||
4. Invoking system-wide resume notifiers.
|
||||
|
||||
This is analogous to step 1 of the `suspend <s2idle_suspend_>`_ transition
|
||||
and the same set of callbacks is invoked at this point, but a different
|
||||
"notification type" parameter value is passed to them.
|
||||
|
||||
|
||||
Platform-dependent Suspend Code Flow
|
||||
====================================
|
||||
|
||||
The following steps are taken in order to transition the system from the working
|
||||
state to platform-dependent suspend state:
|
||||
|
||||
1. Invoking system-wide suspend notifiers.
|
||||
|
||||
This step is the same as step 1 of the suspend-to-idle suspend transition
|
||||
described `above <s2idle_suspend_>`_.
|
||||
|
||||
2. Freezing tasks.
|
||||
|
||||
This step is the same as step 2 of the suspend-to-idle suspend transition
|
||||
described `above <s2idle_suspend_>`_.
|
||||
|
||||
3. Suspending devices and reconfiguring IRQs.
|
||||
|
||||
This step is analogous to step 3 of the suspend-to-idle suspend transition
|
||||
described `above <s2idle_suspend_>`_, but the arming of IRQs for system
|
||||
wakeup generally does not have any effect on the platform.
|
||||
|
||||
There are platforms that can go into a very deep low-power state internally
|
||||
when all CPUs in them are in sufficiently deep idle states and all I/O
|
||||
devices have been put into low-power states. On those platforms,
|
||||
suspend-to-idle can reduce system power very effectively.
|
||||
|
||||
On the other platforms, however, low-level components (like interrupt
|
||||
controllers) need to be turned off in a platform-specific way (implemented
|
||||
in the hooks provided by the platform driver) to achieve comparable power
|
||||
reduction.
|
||||
|
||||
That usually prevents in-band hardware interrupts from waking up the system,
|
||||
which must be done in a special platform-dependent way. Then, the
|
||||
configuration of system wakeup sources usually starts when system wakeup
|
||||
devices are suspended and is finalized by the platform suspend hooks later
|
||||
on.
|
||||
|
||||
4. Disabling non-boot CPUs.
|
||||
|
||||
On some platforms the suspend hooks mentioned above must run in a one-CPU
|
||||
configuration of the system (in particular, the hardware cannot be accessed
|
||||
by any code running in parallel with the platform suspend hooks that may,
|
||||
and often do, trap into the platform firmware in order to finalize the
|
||||
suspend transition).
|
||||
|
||||
For this reason, the CPU offline/online (CPU hotplug) framework is used
|
||||
to take all of the CPUs in the system, except for one (the boot CPU),
|
||||
offline (typically, the CPUs that have been taken offline go into deep idle
|
||||
states).
|
||||
|
||||
This means that all tasks are migrated away from those CPUs and all IRQs are
|
||||
rerouted to the only CPU that remains online.
|
||||
|
||||
5. Suspending core system components.
|
||||
|
||||
This prepares the core system components for (possibly) losing power going
|
||||
forward and suspends the timekeeping.
|
||||
|
||||
6. Platform-specific power removal.
|
||||
|
||||
This is expected to remove power from all of the system components except
|
||||
for the memory controller and RAM (in order to preserve the contents of the
|
||||
latter) and some devices designated for system wakeup.
|
||||
|
||||
In many cases control is passed to the platform firmware which is expected
|
||||
to finalize the suspend transition as needed.
|
||||
|
||||
|
||||
Platform-dependent Resume Code Flow
|
||||
===================================
|
||||
|
||||
The following steps are taken in order to transition the system from a
|
||||
platform-dependent suspend state into the working state:
|
||||
|
||||
1. Platform-specific system wakeup.
|
||||
|
||||
The platform is woken up by a signal from one of the designated system
|
||||
wakeup devices (which need not be an in-band hardware interrupt) and
|
||||
control is passed back to the kernel (the working configuration of the
|
||||
platform may need to be restored by the platform firmware before the
|
||||
kernel gets control again).
|
||||
|
||||
2. Resuming core system components.
|
||||
|
||||
The suspend-time configuration of the core system components is restored and
|
||||
the timekeeping is resumed.
|
||||
|
||||
3. Re-enabling non-boot CPUs.
|
||||
|
||||
The CPUs disabled in step 4 of the preceding suspend transition are taken
|
||||
back online and their suspend-time configuration is restored.
|
||||
|
||||
4. Resuming devices and restoring the working-state configuration of IRQs.
|
||||
|
||||
This step is the same as step 2 of the suspend-to-idle suspend transition
|
||||
described `above <s2idle_resume_>`_.
|
||||
|
||||
5. Thawing tasks.
|
||||
|
||||
This step is the same as step 3 of the suspend-to-idle suspend transition
|
||||
described `above <s2idle_resume_>`_.
|
||||
|
||||
6. Invoking system-wide resume notifiers.
|
||||
|
||||
This step is the same as step 4 of the suspend-to-idle suspend transition
|
||||
described `above <s2idle_resume_>`_.
|
||||
@@ -8,3 +8,4 @@ System-Wide Power Management
|
||||
:maxdepth: 2
|
||||
|
||||
sleep-states
|
||||
suspend-flows
|
||||
|
||||
@@ -11,4 +11,5 @@ Working-State Power Management
|
||||
intel_idle
|
||||
cpufreq
|
||||
intel_pstate
|
||||
cpufreq_drivers
|
||||
intel_epb
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -67,7 +67,8 @@ two flavors of JITs, the newer eBPF JIT currently supported on:
|
||||
- sparc64
|
||||
- mips64
|
||||
- s390x
|
||||
- riscv
|
||||
- riscv64
|
||||
- riscv32
|
||||
|
||||
And the older cBPF JIT supported on the following archs:
|
||||
|
||||
|
||||
@@ -65,6 +65,12 @@ max_pid_namespaces
|
||||
The maximum number of pid namespaces that any user in the current
|
||||
user namespace may create.
|
||||
|
||||
max_time_namespaces
|
||||
===================
|
||||
|
||||
The maximum number of time namespaces that any user in the current
|
||||
user namespace may create.
|
||||
|
||||
max_user_namespaces
|
||||
===================
|
||||
|
||||
|
||||
@@ -128,6 +128,9 @@ allowed to examine the unevictable lru (mlocked pages) for pages to compact.
|
||||
This should be used on systems where stalls for minor page faults are an
|
||||
acceptable trade for large contiguous free memory. Set to 0 to prevent
|
||||
compaction from moving pages that are unevictable. Default value is 1.
|
||||
On CONFIG_PREEMPT_RT the default value is 0 in order to avoid a page fault, due
|
||||
to compaction, which would block the task from becomming active until the fault
|
||||
is resolved.
|
||||
|
||||
|
||||
dirty_background_bytes
|
||||
|
||||
@@ -48,9 +48,10 @@ always allowed (by a user with admin privileges).
|
||||
How do I use the magic SysRq key?
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
On x86 - You press the key combo :kbd:`ALT-SysRq-<command key>`.
|
||||
On x86
|
||||
You press the key combo :kbd:`ALT-SysRq-<command key>`.
|
||||
|
||||
.. note::
|
||||
.. note::
|
||||
Some
|
||||
keyboards may not have a key labeled 'SysRq'. The 'SysRq' key is
|
||||
also known as the 'Print Screen' key. Also some keyboards cannot
|
||||
@@ -58,14 +59,15 @@ On x86 - You press the key combo :kbd:`ALT-SysRq-<command key>`.
|
||||
have better luck with press :kbd:`Alt`, press :kbd:`SysRq`,
|
||||
release :kbd:`SysRq`, press :kbd:`<command key>`, release everything.
|
||||
|
||||
On SPARC - You press :kbd:`ALT-STOP-<command key>`, I believe.
|
||||
On SPARC
|
||||
You press :kbd:`ALT-STOP-<command key>`, I believe.
|
||||
|
||||
On the serial console (PC style standard serial ports only)
|
||||
You send a ``BREAK``, then within 5 seconds a command key. Sending
|
||||
``BREAK`` twice is interpreted as a normal BREAK.
|
||||
|
||||
On PowerPC
|
||||
Press :kbd:`ALT - Print Screen` (or :kbd:`F13`) - :kbd:`<command key>`,
|
||||
Press :kbd:`ALT - Print Screen` (or :kbd:`F13`) - :kbd:`<command key>`.
|
||||
:kbd:`Print Screen` (or :kbd:`F13`) - :kbd:`<command key>` may suffice.
|
||||
|
||||
On other
|
||||
@@ -73,7 +75,7 @@ On other
|
||||
let me know so I can add them to this section.
|
||||
|
||||
On all
|
||||
write a character to /proc/sysrq-trigger. e.g.::
|
||||
Write a character to /proc/sysrq-trigger. e.g.::
|
||||
|
||||
echo t > /proc/sysrq-trigger
|
||||
|
||||
@@ -282,7 +284,7 @@ Just ask them on the linux-kernel mailing list:
|
||||
Credits
|
||||
~~~~~~~
|
||||
|
||||
Written by Mydraal <vulpyne@vulpyne.net>
|
||||
Updated by Adam Sulmicki <adam@cfar.umd.edu>
|
||||
Updated by Jeremy M. Dolan <jmd@turbogeek.org> 2001/01/28 10:15:59
|
||||
Added to by Crutcher Dunnavant <crutcher+kernel@datastacks.com>
|
||||
- Written by Mydraal <vulpyne@vulpyne.net>
|
||||
- Updated by Adam Sulmicki <adam@cfar.umd.edu>
|
||||
- Updated by Jeremy M. Dolan <jmd@turbogeek.org> 2001/01/28 10:15:59
|
||||
- Added to by Crutcher Dunnavant <crutcher+kernel@datastacks.com>
|
||||
|
||||
@@ -92,6 +92,12 @@ the Microchip website: http://www.microchip.com.
|
||||
|
||||
http://ww1.microchip.com/downloads/en/DeviceDoc/DS60001517A.pdf
|
||||
|
||||
- sam9x60
|
||||
|
||||
* Datasheet
|
||||
|
||||
http://ww1.microchip.com/downloads/en/DeviceDoc/SAM9X60-Data-Sheet-DS60001579A.pdf
|
||||
|
||||
* ARM Cortex-A5 based SoCs
|
||||
- sama5d3 family
|
||||
|
||||
|
||||
@@ -4,18 +4,18 @@ ARM TCM (Tightly-Coupled Memory) handling in Linux
|
||||
|
||||
Written by Linus Walleij <linus.walleij@stericsson.com>
|
||||
|
||||
Some ARM SoC:s have a so-called TCM (Tightly-Coupled Memory).
|
||||
Some ARM SoCs have a so-called TCM (Tightly-Coupled Memory).
|
||||
This is usually just a few (4-64) KiB of RAM inside the ARM
|
||||
processor.
|
||||
|
||||
Due to being embedded inside the CPU The TCM has a
|
||||
Due to being embedded inside the CPU, the TCM has a
|
||||
Harvard-architecture, so there is an ITCM (instruction TCM)
|
||||
and a DTCM (data TCM). The DTCM can not contain any
|
||||
instructions, but the ITCM can actually contain data.
|
||||
The size of DTCM or ITCM is minimum 4KiB so the typical
|
||||
minimum configuration is 4KiB ITCM and 4KiB DTCM.
|
||||
|
||||
ARM CPU:s have special registers to read out status, physical
|
||||
ARM CPUs have special registers to read out status, physical
|
||||
location and size of TCM memories. arch/arm/include/asm/cputype.h
|
||||
defines a CPUID_TCM register that you can read out from the
|
||||
system control coprocessor. Documentation from ARM can be found
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
=======================================================
|
||||
Activity Monitors Unit (AMU) extension in AArch64 Linux
|
||||
=======================================================
|
||||
|
||||
Author: Ionela Voinescu <ionela.voinescu@arm.com>
|
||||
|
||||
Date: 2019-09-10
|
||||
|
||||
This document briefly describes the provision of Activity Monitors Unit
|
||||
support in AArch64 Linux.
|
||||
|
||||
|
||||
Architecture overview
|
||||
---------------------
|
||||
|
||||
The activity monitors extension is an optional extension introduced by the
|
||||
ARMv8.4 CPU architecture.
|
||||
|
||||
The activity monitors unit, implemented in each CPU, provides performance
|
||||
counters intended for system management use. The AMU extension provides a
|
||||
system register interface to the counter registers and also supports an
|
||||
optional external memory-mapped interface.
|
||||
|
||||
Version 1 of the Activity Monitors architecture implements a counter group
|
||||
of four fixed and architecturally defined 64-bit event counters.
|
||||
- CPU cycle counter: increments at the frequency of the CPU.
|
||||
- Constant counter: increments at the fixed frequency of the system
|
||||
clock.
|
||||
- Instructions retired: increments with every architecturally executed
|
||||
instruction.
|
||||
- Memory stall cycles: counts instruction dispatch stall cycles caused by
|
||||
misses in the last level cache within the clock domain.
|
||||
|
||||
When in WFI or WFE these counters do not increment.
|
||||
|
||||
The Activity Monitors architecture provides space for up to 16 architected
|
||||
event counters. Future versions of the architecture may use this space to
|
||||
implement additional architected event counters.
|
||||
|
||||
Additionally, version 1 implements a counter group of up to 16 auxiliary
|
||||
64-bit event counters.
|
||||
|
||||
On cold reset all counters reset to 0.
|
||||
|
||||
|
||||
Basic support
|
||||
-------------
|
||||
|
||||
The kernel can safely run a mix of CPUs with and without support for the
|
||||
activity monitors extension. Therefore, when CONFIG_ARM64_AMU_EXTN is
|
||||
selected we unconditionally enable the capability to allow any late CPU
|
||||
(secondary or hotplugged) to detect and use the feature.
|
||||
|
||||
When the feature is detected on a CPU, we flag the availability of the
|
||||
feature but this does not guarantee the correct functionality of the
|
||||
counters, only the presence of the extension.
|
||||
|
||||
Firmware (code running at higher exception levels, e.g. arm-tf) support is
|
||||
needed to:
|
||||
- Enable access for lower exception levels (EL2 and EL1) to the AMU
|
||||
registers.
|
||||
- Enable the counters. If not enabled these will read as 0.
|
||||
- Save/restore the counters before/after the CPU is being put/brought up
|
||||
from the 'off' power state.
|
||||
|
||||
When using kernels that have this feature enabled but boot with broken
|
||||
firmware the user may experience panics or lockups when accessing the
|
||||
counter registers. Even if these symptoms are not observed, the values
|
||||
returned by the register reads might not correctly reflect reality. Most
|
||||
commonly, the counters will read as 0, indicating that they are not
|
||||
enabled.
|
||||
|
||||
If proper support is not provided in firmware it's best to disable
|
||||
CONFIG_ARM64_AMU_EXTN. To be noted that for security reasons, this does not
|
||||
bypass the setting of AMUSERENR_EL0 to trap accesses from EL0 (userspace) to
|
||||
EL1 (kernel). Therefore, firmware should still ensure accesses to AMU registers
|
||||
are not trapped in EL2/EL3.
|
||||
|
||||
The fixed counters of AMUv1 are accessible though the following system
|
||||
register definitions:
|
||||
- SYS_AMEVCNTR0_CORE_EL0
|
||||
- SYS_AMEVCNTR0_CONST_EL0
|
||||
- SYS_AMEVCNTR0_INST_RET_EL0
|
||||
- SYS_AMEVCNTR0_MEM_STALL_EL0
|
||||
|
||||
Auxiliary platform specific counters can be accessed using
|
||||
SYS_AMEVCNTR1_EL0(n), where n is a value between 0 and 15.
|
||||
|
||||
Details can be found in: arch/arm64/include/asm/sysreg.h.
|
||||
|
||||
|
||||
Userspace access
|
||||
----------------
|
||||
|
||||
Currently, access from userspace to the AMU registers is disabled due to:
|
||||
- Security reasons: they might expose information about code executed in
|
||||
secure mode.
|
||||
- Purpose: AMU counters are intended for system management use.
|
||||
|
||||
Also, the presence of the feature is not visible to userspace.
|
||||
|
||||
|
||||
Virtualization
|
||||
--------------
|
||||
|
||||
Currently, access from userspace (EL0) and kernelspace (EL1) on the KVM
|
||||
guest side is disabled due to:
|
||||
- Security reasons: they might expose information about code executed
|
||||
by other guests or the host.
|
||||
|
||||
Any attempt to access the AMU registers will result in an UNDEFINED
|
||||
exception being injected into the guest.
|
||||
@@ -248,6 +248,20 @@ Before jumping into the kernel, the following conditions must be met:
|
||||
- HCR_EL2.APK (bit 40) must be initialised to 0b1
|
||||
- HCR_EL2.API (bit 41) must be initialised to 0b1
|
||||
|
||||
For CPUs with Activity Monitors Unit v1 (AMUv1) extension present:
|
||||
- If EL3 is present:
|
||||
CPTR_EL3.TAM (bit 30) must be initialised to 0b0
|
||||
CPTR_EL2.TAM (bit 30) must be initialised to 0b0
|
||||
AMCNTENSET0_EL0 must be initialised to 0b1111
|
||||
AMCNTENSET1_EL0 must be initialised to a platform specific value
|
||||
having 0b1 set for the corresponding bit for each of the auxiliary
|
||||
counters present.
|
||||
- If the kernel is entered at EL1:
|
||||
AMCNTENSET0_EL0 must be initialised to 0b1111
|
||||
AMCNTENSET1_EL0 must be initialised to a platform specific value
|
||||
having 0b1 set for the corresponding bit for each of the auxiliary
|
||||
counters present.
|
||||
|
||||
The requirements described above for CPU mode, caches, MMUs, architected
|
||||
timers, coherency and system registers apply to all CPUs. All CPUs must
|
||||
enter the kernel in the same exception level.
|
||||
|
||||
@@ -6,6 +6,7 @@ ARM64 Architecture
|
||||
:maxdepth: 1
|
||||
|
||||
acpi_object_usage
|
||||
amu
|
||||
arm-acpi
|
||||
booting
|
||||
cpu-feature-registers
|
||||
|
||||
@@ -129,7 +129,7 @@ this logic.
|
||||
|
||||
As a single binary will need to support both 48-bit and 52-bit VA
|
||||
spaces, the VMEMMAP must be sized large enough for 52-bit VAs and
|
||||
also must be sized large enought to accommodate a fixed PAGE_OFFSET.
|
||||
also must be sized large enough to accommodate a fixed PAGE_OFFSET.
|
||||
|
||||
Most code in the kernel should not need to consider the VA_BITS, for
|
||||
code that does need to know the VA size the variables are
|
||||
|
||||
@@ -110,6 +110,8 @@ stable kernels.
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| Cavium | ThunderX GICv3 | #23154 | CAVIUM_ERRATUM_23154 |
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| Cavium | ThunderX GICv3 | #38539 | N/A |
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| Cavium | ThunderX Core | #27456 | CAVIUM_ERRATUM_27456 |
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| Cavium | ThunderX Core | #30115 | CAVIUM_ERRATUM_30115 |
|
||||
|
||||
@@ -44,8 +44,15 @@ The AArch64 Tagged Address ABI has two stages of relaxation depending
|
||||
how the user addresses are used by the kernel:
|
||||
|
||||
1. User addresses not accessed by the kernel but used for address space
|
||||
management (e.g. ``mmap()``, ``mprotect()``, ``madvise()``). The use
|
||||
of valid tagged pointers in this context is always allowed.
|
||||
management (e.g. ``mprotect()``, ``madvise()``). The use of valid
|
||||
tagged pointers in this context is allowed with the exception of
|
||||
``brk()``, ``mmap()`` and the ``new_address`` argument to
|
||||
``mremap()`` as these have the potential to alias with existing
|
||||
user addresses.
|
||||
|
||||
NOTE: This behaviour changed in v5.6 and so some earlier kernels may
|
||||
incorrectly accept valid tagged pointers for the ``brk()``,
|
||||
``mmap()`` and ``mremap()`` system calls.
|
||||
|
||||
2. User addresses accessed by the kernel (e.g. ``write()``). This ABI
|
||||
relaxation is disabled by default and the application thread needs to
|
||||
|
||||
@@ -73,10 +73,11 @@ The new macros are prefixed with the ``SYM_`` prefix and can be divided into
|
||||
three main groups:
|
||||
|
||||
1. ``SYM_FUNC_*`` -- to annotate C-like functions. This means functions with
|
||||
standard C calling conventions, i.e. the stack contains a return address at
|
||||
the predefined place and a return from the function can happen in a
|
||||
standard way. When frame pointers are enabled, save/restore of frame
|
||||
pointer shall happen at the start/end of a function, respectively, too.
|
||||
standard C calling conventions. For example, on x86, this means that the
|
||||
stack contains a return address at the predefined place and a return from
|
||||
the function can happen in a standard way. When frame pointers are enabled,
|
||||
save/restore of frame pointer shall happen at the start/end of a function,
|
||||
respectively, too.
|
||||
|
||||
Checking tools like ``objtool`` should ensure such marked functions conform
|
||||
to these rules. The tools can also easily annotate these functions with
|
||||
|
||||
@@ -47,7 +47,7 @@ Having a real iterator, and making biovecs immutable, has a number of
|
||||
advantages:
|
||||
|
||||
* Before, iterating over bios was very awkward when you weren't processing
|
||||
exactly one bvec at a time - for example, bio_copy_data() in fs/bio.c,
|
||||
exactly one bvec at a time - for example, bio_copy_data() in block/bio.c,
|
||||
which copies the contents of one bio into another. Because the biovecs
|
||||
wouldn't necessarily be the same size, the old code was tricky convoluted -
|
||||
it had to walk two different bios at the same time, keeping both bi_idx and
|
||||
|
||||
@@ -2,17 +2,9 @@
|
||||
Generic Block Device Capability
|
||||
===============================
|
||||
|
||||
This file documents the sysfs file block/<disk>/capability
|
||||
This file documents the sysfs file ``block/<disk>/capability``.
|
||||
|
||||
capability is a hex word indicating which capabilities a specific disk
|
||||
supports. For more information on bits not listed here, see
|
||||
include/linux/genhd.h
|
||||
``capability`` is a bitfield, printed in hexadecimal, indicating which
|
||||
capabilities a specific block device supports:
|
||||
|
||||
GENHD_FL_MEDIA_CHANGE_NOTIFY
|
||||
----------------------------
|
||||
|
||||
Value: 4
|
||||
|
||||
When this bit is set, the disk supports Asynchronous Notification
|
||||
of media change events. These events will be broadcast to user
|
||||
space via kernel uevent.
|
||||
.. kernel-doc:: include/linux/genhd.h
|
||||
|
||||
@@ -20,11 +20,11 @@ Reporting bugs
|
||||
Q: How do I report bugs for BPF kernel code?
|
||||
--------------------------------------------
|
||||
A: Since all BPF kernel development as well as bpftool and iproute2 BPF
|
||||
loader development happens through the netdev kernel mailing list,
|
||||
loader development happens through the bpf kernel mailing list,
|
||||
please report any found issues around BPF to the following mailing
|
||||
list:
|
||||
|
||||
netdev@vger.kernel.org
|
||||
bpf@vger.kernel.org
|
||||
|
||||
This may also include issues related to XDP, BPF tracing, etc.
|
||||
|
||||
@@ -46,17 +46,12 @@ Submitting patches
|
||||
|
||||
Q: To which mailing list do I need to submit my BPF patches?
|
||||
------------------------------------------------------------
|
||||
A: Please submit your BPF patches to the netdev kernel mailing list:
|
||||
A: Please submit your BPF patches to the bpf kernel mailing list:
|
||||
|
||||
netdev@vger.kernel.org
|
||||
|
||||
Historically, BPF came out of networking and has always been maintained
|
||||
by the kernel networking community. Although these days BPF touches
|
||||
many other subsystems as well, the patches are still routed mainly
|
||||
through the networking community.
|
||||
bpf@vger.kernel.org
|
||||
|
||||
In case your patch has changes in various different subsystems (e.g.
|
||||
tracing, security, etc), make sure to Cc the related kernel mailing
|
||||
networking, tracing, security, etc), make sure to Cc the related kernel mailing
|
||||
lists and maintainers from there as well, so they are able to review
|
||||
the changes and provide their Acked-by's to the patches.
|
||||
|
||||
@@ -168,7 +163,7 @@ a BPF point of view.
|
||||
Be aware that this is not a final verdict that the patch will
|
||||
automatically get accepted into net or net-next trees eventually:
|
||||
|
||||
On the netdev kernel mailing list reviews can come in at any point
|
||||
On the bpf kernel mailing list reviews can come in at any point
|
||||
in time. If discussions around a patch conclude that they cannot
|
||||
get included as-is, we will either apply a follow-up fix or drop
|
||||
them from the trees entirely. Therefore, we also reserve to rebase
|
||||
@@ -494,15 +489,15 @@ A: You need cmake and gcc-c++ as build requisites for LLVM. Once you have
|
||||
that set up, proceed with building the latest LLVM and clang version
|
||||
from the git repositories::
|
||||
|
||||
$ git clone http://llvm.org/git/llvm.git
|
||||
$ cd llvm/tools
|
||||
$ git clone --depth 1 http://llvm.org/git/clang.git
|
||||
$ cd ..; mkdir build; cd build
|
||||
$ cmake .. -DLLVM_TARGETS_TO_BUILD="BPF;X86" \
|
||||
$ git clone https://github.com/llvm/llvm-project.git
|
||||
$ mkdir -p llvm-project/llvm/build/install
|
||||
$ cd llvm-project/llvm/build
|
||||
$ cmake .. -G "Ninja" -DLLVM_TARGETS_TO_BUILD="BPF;X86" \
|
||||
-DLLVM_ENABLE_PROJECTS="clang" \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DLLVM_BUILD_RUNTIME=OFF
|
||||
$ make -j $(getconf _NPROCESSORS_ONLN)
|
||||
$ ninja
|
||||
|
||||
The built binaries can then be found in the build/bin/ directory, where
|
||||
you can point the PATH variable to.
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0+
|
||||
.. Copyright (C) 2020 Google LLC.
|
||||
|
||||
================
|
||||
LSM BPF Programs
|
||||
================
|
||||
|
||||
These BPF programs allow runtime instrumentation of the LSM hooks by privileged
|
||||
users to implement system-wide MAC (Mandatory Access Control) and Audit
|
||||
policies using eBPF.
|
||||
|
||||
Structure
|
||||
---------
|
||||
|
||||
The example shows an eBPF program that can be attached to the ``file_mprotect``
|
||||
LSM hook:
|
||||
|
||||
.. c:function:: int file_mprotect(struct vm_area_struct *vma, unsigned long reqprot, unsigned long prot);
|
||||
|
||||
Other LSM hooks which can be instrumented can be found in
|
||||
``include/linux/lsm_hooks.h``.
|
||||
|
||||
eBPF programs that use :doc:`/bpf/btf` do not need to include kernel headers
|
||||
for accessing information from the attached eBPF program's context. They can
|
||||
simply declare the structures in the eBPF program and only specify the fields
|
||||
that need to be accessed.
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
struct mm_struct {
|
||||
unsigned long start_brk, brk, start_stack;
|
||||
} __attribute__((preserve_access_index));
|
||||
|
||||
struct vm_area_struct {
|
||||
unsigned long start_brk, brk, start_stack;
|
||||
unsigned long vm_start, vm_end;
|
||||
struct mm_struct *vm_mm;
|
||||
} __attribute__((preserve_access_index));
|
||||
|
||||
|
||||
.. note:: The order of the fields is irrelevant.
|
||||
|
||||
This can be further simplified (if one has access to the BTF information at
|
||||
build time) by generating the ``vmlinux.h`` with:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
# bpftool btf dump file <path-to-btf-vmlinux> format c > vmlinux.h
|
||||
|
||||
.. note:: ``path-to-btf-vmlinux`` can be ``/sys/kernel/btf/vmlinux`` if the
|
||||
build environment matches the environment the BPF programs are
|
||||
deployed in.
|
||||
|
||||
The ``vmlinux.h`` can then simply be included in the BPF programs without
|
||||
requiring the definition of the types.
|
||||
|
||||
The eBPF programs can be declared using the``BPF_PROG``
|
||||
macros defined in `tools/lib/bpf/bpf_tracing.h`_. In this
|
||||
example:
|
||||
|
||||
* ``"lsm/file_mprotect"`` indicates the LSM hook that the program must
|
||||
be attached to
|
||||
* ``mprotect_audit`` is the name of the eBPF program
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
SEC("lsm/file_mprotect")
|
||||
int BPF_PROG(mprotect_audit, struct vm_area_struct *vma,
|
||||
unsigned long reqprot, unsigned long prot, int ret)
|
||||
{
|
||||
/* ret is the return value from the previous BPF program
|
||||
* or 0 if it's the first hook.
|
||||
*/
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
int is_heap;
|
||||
|
||||
is_heap = (vma->vm_start >= vma->vm_mm->start_brk &&
|
||||
vma->vm_end <= vma->vm_mm->brk);
|
||||
|
||||
/* Return an -EPERM or write information to the perf events buffer
|
||||
* for auditing
|
||||
*/
|
||||
if (is_heap)
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
The ``__attribute__((preserve_access_index))`` is a clang feature that allows
|
||||
the BPF verifier to update the offsets for the access at runtime using the
|
||||
:doc:`/bpf/btf` information. Since the BPF verifier is aware of the types, it
|
||||
also validates all the accesses made to the various types in the eBPF program.
|
||||
|
||||
Loading
|
||||
-------
|
||||
|
||||
eBPF programs can be loaded with the :manpage:`bpf(2)` syscall's
|
||||
``BPF_PROG_LOAD`` operation:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
struct bpf_object *obj;
|
||||
|
||||
obj = bpf_object__open("./my_prog.o");
|
||||
bpf_object__load(obj);
|
||||
|
||||
This can be simplified by using a skeleton header generated by ``bpftool``:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
# bpftool gen skeleton my_prog.o > my_prog.skel.h
|
||||
|
||||
and the program can be loaded by including ``my_prog.skel.h`` and using
|
||||
the generated helper, ``my_prog__open_and_load``.
|
||||
|
||||
Attachment to LSM Hooks
|
||||
-----------------------
|
||||
|
||||
The LSM allows attachment of eBPF programs as LSM hooks using :manpage:`bpf(2)`
|
||||
syscall's ``BPF_RAW_TRACEPOINT_OPEN`` operation or more simply by
|
||||
using the libbpf helper ``bpf_program__attach_lsm``.
|
||||
|
||||
The program can be detached from the LSM hook by *destroying* the ``link``
|
||||
link returned by ``bpf_program__attach_lsm`` using ``bpf_link__destroy``.
|
||||
|
||||
One can also use the helpers generated in ``my_prog.skel.h`` i.e.
|
||||
``my_prog__attach`` for attachment and ``my_prog__destroy`` for cleaning up.
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
An example eBPF program can be found in
|
||||
`tools/testing/selftests/bpf/progs/lsm.c`_ and the corresponding
|
||||
userspace code in `tools/testing/selftests/bpf/prog_tests/test_lsm.c`_
|
||||
|
||||
.. Links
|
||||
.. _tools/lib/bpf/bpf_tracing.h:
|
||||
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/tools/lib/bpf/bpf_tracing.h
|
||||
.. _tools/testing/selftests/bpf/progs/lsm.c:
|
||||
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/tools/testing/selftests/bpf/progs/lsm.c
|
||||
.. _tools/testing/selftests/bpf/prog_tests/test_lsm.c:
|
||||
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/tools/testing/selftests/bpf/prog_tests/test_lsm.c
|
||||
@@ -0,0 +1,213 @@
|
||||
.. SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
|
||||
|
||||
==============
|
||||
BPF drgn tools
|
||||
==============
|
||||
|
||||
drgn scripts is a convenient and easy to use mechanism to retrieve arbitrary
|
||||
kernel data structures. drgn is not relying on kernel UAPI to read the data.
|
||||
Instead it's reading directly from ``/proc/kcore`` or vmcore and pretty prints
|
||||
the data based on DWARF debug information from vmlinux.
|
||||
|
||||
This document describes BPF related drgn tools.
|
||||
|
||||
See `drgn/tools`_ for all tools available at the moment and `drgn/doc`_ for
|
||||
more details on drgn itself.
|
||||
|
||||
bpf_inspect.py
|
||||
--------------
|
||||
|
||||
Description
|
||||
===========
|
||||
|
||||
`bpf_inspect.py`_ is a tool intended to inspect BPF programs and maps. It can
|
||||
iterate over all programs and maps in the system and print basic information
|
||||
about these objects, including id, type and name.
|
||||
|
||||
The main use-case `bpf_inspect.py`_ covers is to show BPF programs of types
|
||||
``BPF_PROG_TYPE_EXT`` and ``BPF_PROG_TYPE_TRACING`` attached to other BPF
|
||||
programs via ``freplace``/``fentry``/``fexit`` mechanisms, since there is no
|
||||
user-space API to get this information.
|
||||
|
||||
Getting started
|
||||
===============
|
||||
|
||||
List BPF programs (full names are obtained from BTF)::
|
||||
|
||||
% sudo bpf_inspect.py prog
|
||||
27: BPF_PROG_TYPE_TRACEPOINT tracepoint__tcp__tcp_send_reset
|
||||
4632: BPF_PROG_TYPE_CGROUP_SOCK_ADDR tw_ipt_bind
|
||||
49464: BPF_PROG_TYPE_RAW_TRACEPOINT raw_tracepoint__sched_process_exit
|
||||
|
||||
List BPF maps::
|
||||
|
||||
% sudo bpf_inspect.py map
|
||||
2577: BPF_MAP_TYPE_HASH tw_ipt_vips
|
||||
4050: BPF_MAP_TYPE_STACK_TRACE stack_traces
|
||||
4069: BPF_MAP_TYPE_PERCPU_ARRAY ned_dctcp_cntr
|
||||
|
||||
Find BPF programs attached to BPF program ``test_pkt_access``::
|
||||
|
||||
% sudo bpf_inspect.py p | grep test_pkt_access
|
||||
650: BPF_PROG_TYPE_SCHED_CLS test_pkt_access
|
||||
654: BPF_PROG_TYPE_TRACING test_main linked:[650->25: BPF_TRAMP_FEXIT test_pkt_access->test_pkt_access()]
|
||||
655: BPF_PROG_TYPE_TRACING test_subprog1 linked:[650->29: BPF_TRAMP_FEXIT test_pkt_access->test_pkt_access_subprog1()]
|
||||
656: BPF_PROG_TYPE_TRACING test_subprog2 linked:[650->31: BPF_TRAMP_FEXIT test_pkt_access->test_pkt_access_subprog2()]
|
||||
657: BPF_PROG_TYPE_TRACING test_subprog3 linked:[650->21: BPF_TRAMP_FEXIT test_pkt_access->test_pkt_access_subprog3()]
|
||||
658: BPF_PROG_TYPE_EXT new_get_skb_len linked:[650->16: BPF_TRAMP_REPLACE test_pkt_access->get_skb_len()]
|
||||
659: BPF_PROG_TYPE_EXT new_get_skb_ifindex linked:[650->23: BPF_TRAMP_REPLACE test_pkt_access->get_skb_ifindex()]
|
||||
660: BPF_PROG_TYPE_EXT new_get_constant linked:[650->19: BPF_TRAMP_REPLACE test_pkt_access->get_constant()]
|
||||
|
||||
It can be seen that there is a program ``test_pkt_access``, id 650 and there
|
||||
are multiple other tracing and ext programs attached to functions in
|
||||
``test_pkt_access``.
|
||||
|
||||
For example the line::
|
||||
|
||||
658: BPF_PROG_TYPE_EXT new_get_skb_len linked:[650->16: BPF_TRAMP_REPLACE test_pkt_access->get_skb_len()]
|
||||
|
||||
, means that BPF program id 658, type ``BPF_PROG_TYPE_EXT``, name
|
||||
``new_get_skb_len`` replaces (``BPF_TRAMP_REPLACE``) function ``get_skb_len()``
|
||||
that has BTF id 16 in BPF program id 650, name ``test_pkt_access``.
|
||||
|
||||
Getting help:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
% sudo bpf_inspect.py
|
||||
usage: bpf_inspect.py [-h] {prog,p,map,m} ...
|
||||
|
||||
drgn script to list BPF programs or maps and their properties
|
||||
unavailable via kernel API.
|
||||
|
||||
See https://github.com/osandov/drgn/ for more details on drgn.
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
|
||||
subcommands:
|
||||
{prog,p,map,m}
|
||||
prog (p) list BPF programs
|
||||
map (m) list BPF maps
|
||||
|
||||
Customization
|
||||
=============
|
||||
|
||||
The script is intended to be customized by developers to print relevant
|
||||
information about BPF programs, maps and other objects.
|
||||
|
||||
For example, to print ``struct bpf_prog_aux`` for BPF program id 53077:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
% git diff
|
||||
diff --git a/tools/bpf_inspect.py b/tools/bpf_inspect.py
|
||||
index 650e228..aea2357 100755
|
||||
--- a/tools/bpf_inspect.py
|
||||
+++ b/tools/bpf_inspect.py
|
||||
@@ -112,7 +112,9 @@ def list_bpf_progs(args):
|
||||
if linked:
|
||||
linked = f" linked:[{linked}]"
|
||||
|
||||
- print(f"{id_:>6}: {type_:32} {name:32} {linked}")
|
||||
+ if id_ == 53077:
|
||||
+ print(f"{id_:>6}: {type_:32} {name:32}")
|
||||
+ print(f"{bpf_prog.aux}")
|
||||
|
||||
|
||||
def list_bpf_maps(args):
|
||||
|
||||
It produces the output::
|
||||
|
||||
% sudo bpf_inspect.py p
|
||||
53077: BPF_PROG_TYPE_XDP tw_xdp_policer
|
||||
*(struct bpf_prog_aux *)0xffff8893fad4b400 = {
|
||||
.refcnt = (atomic64_t){
|
||||
.counter = (long)58,
|
||||
},
|
||||
.used_map_cnt = (u32)1,
|
||||
.max_ctx_offset = (u32)8,
|
||||
.max_pkt_offset = (u32)15,
|
||||
.max_tp_access = (u32)0,
|
||||
.stack_depth = (u32)8,
|
||||
.id = (u32)53077,
|
||||
.func_cnt = (u32)0,
|
||||
.func_idx = (u32)0,
|
||||
.attach_btf_id = (u32)0,
|
||||
.linked_prog = (struct bpf_prog *)0x0,
|
||||
.verifier_zext = (bool)0,
|
||||
.offload_requested = (bool)0,
|
||||
.attach_btf_trace = (bool)0,
|
||||
.func_proto_unreliable = (bool)0,
|
||||
.trampoline_prog_type = (enum bpf_tramp_prog_type)BPF_TRAMP_FENTRY,
|
||||
.trampoline = (struct bpf_trampoline *)0x0,
|
||||
.tramp_hlist = (struct hlist_node){
|
||||
.next = (struct hlist_node *)0x0,
|
||||
.pprev = (struct hlist_node **)0x0,
|
||||
},
|
||||
.attach_func_proto = (const struct btf_type *)0x0,
|
||||
.attach_func_name = (const char *)0x0,
|
||||
.func = (struct bpf_prog **)0x0,
|
||||
.jit_data = (void *)0x0,
|
||||
.poke_tab = (struct bpf_jit_poke_descriptor *)0x0,
|
||||
.size_poke_tab = (u32)0,
|
||||
.ksym_tnode = (struct latch_tree_node){
|
||||
.node = (struct rb_node [2]){
|
||||
{
|
||||
.__rb_parent_color = (unsigned long)18446612956263126665,
|
||||
.rb_right = (struct rb_node *)0x0,
|
||||
.rb_left = (struct rb_node *)0xffff88a0be3d0088,
|
||||
},
|
||||
{
|
||||
.__rb_parent_color = (unsigned long)18446612956263126689,
|
||||
.rb_right = (struct rb_node *)0x0,
|
||||
.rb_left = (struct rb_node *)0xffff88a0be3d00a0,
|
||||
},
|
||||
},
|
||||
},
|
||||
.ksym_lnode = (struct list_head){
|
||||
.next = (struct list_head *)0xffff88bf481830b8,
|
||||
.prev = (struct list_head *)0xffff888309f536b8,
|
||||
},
|
||||
.ops = (const struct bpf_prog_ops *)xdp_prog_ops+0x0 = 0xffffffff820fa350,
|
||||
.used_maps = (struct bpf_map **)0xffff889ff795de98,
|
||||
.prog = (struct bpf_prog *)0xffffc9000cf2d000,
|
||||
.user = (struct user_struct *)root_user+0x0 = 0xffffffff82444820,
|
||||
.load_time = (u64)2408348759285319,
|
||||
.cgroup_storage = (struct bpf_map *[2]){},
|
||||
.name = (char [16])"tw_xdp_policer",
|
||||
.security = (void *)0xffff889ff795d548,
|
||||
.offload = (struct bpf_prog_offload *)0x0,
|
||||
.btf = (struct btf *)0xffff8890ce6d0580,
|
||||
.func_info = (struct bpf_func_info *)0xffff889ff795d240,
|
||||
.func_info_aux = (struct bpf_func_info_aux *)0xffff889ff795de20,
|
||||
.linfo = (struct bpf_line_info *)0xffff888a707afc00,
|
||||
.jited_linfo = (void **)0xffff8893fad48600,
|
||||
.func_info_cnt = (u32)1,
|
||||
.nr_linfo = (u32)37,
|
||||
.linfo_idx = (u32)0,
|
||||
.num_exentries = (u32)0,
|
||||
.extable = (struct exception_table_entry *)0xffffffffa032d950,
|
||||
.stats = (struct bpf_prog_stats *)0x603fe3a1f6d0,
|
||||
.work = (struct work_struct){
|
||||
.data = (atomic_long_t){
|
||||
.counter = (long)0,
|
||||
},
|
||||
.entry = (struct list_head){
|
||||
.next = (struct list_head *)0x0,
|
||||
.prev = (struct list_head *)0x0,
|
||||
},
|
||||
.func = (work_func_t)0x0,
|
||||
},
|
||||
.rcu = (struct callback_head){
|
||||
.next = (struct callback_head *)0x0,
|
||||
.func = (void (*)(struct callback_head *))0x0,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
.. Links
|
||||
.. _drgn/doc: https://drgn.readthedocs.io/en/latest/
|
||||
.. _drgn/tools: https://github.com/osandov/drgn/tree/master/tools
|
||||
.. _bpf_inspect.py:
|
||||
https://github.com/osandov/drgn/blob/master/tools/bpf_inspect.py
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user