Skip to content

Commit f96271c

Browse files
committed
Merge branch 'master' into next
Merge master back into next, this allows us to resolve some conflicts in arch/powerpc/Kconfig, and also re-sort the symbols under config PPC so that they are in alphabetical order again.
2 parents 32b48bf + dd86005 commit f96271c

File tree

1,332 files changed

+33908
-14493
lines changed

Some content is hidden

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

1,332 files changed

+33908
-14493
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
What: /sys/bus/event_source/devices/dsa*/format
2+
Date: April 2021
3+
KernelVersion: 5.13
4+
Contact: Tom Zanussi <[email protected]>
5+
Description: Read-only. Attribute group to describe the magic bits
6+
that go into perf_event_attr.config or
7+
perf_event_attr.config1 for the IDXD DSA pmu. (See also
8+
ABI/testing/sysfs-bus-event_source-devices-format).
9+
10+
Each attribute in this group defines a bit range in
11+
perf_event_attr.config or perf_event_attr.config1.
12+
All supported attributes are listed below (See the
13+
IDXD DSA Spec for possible attribute values)::
14+
15+
event_category = "config:0-3" - event category
16+
event = "config:4-31" - event ID
17+
18+
filter_wq = "config1:0-31" - workqueue filter
19+
filter_tc = "config1:32-39" - traffic class filter
20+
filter_pgsz = "config1:40-43" - page size filter
21+
filter_sz = "config1:44-51" - transfer size filter
22+
filter_eng = "config1:52-59" - engine filter
23+
24+
What: /sys/bus/event_source/devices/dsa*/cpumask
25+
Date: April 2021
26+
KernelVersion: 5.13
27+
Contact: Tom Zanussi <[email protected]>
28+
Description: Read-only. This file always returns the cpu to which the
29+
IDXD DSA pmu is bound for access to all dsa pmu
30+
performance monitoring events.

Documentation/ABI/testing/sysfs-devices-system-cpu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ Description: Disable L3 cache indices
285285

286286
All AMD processors with L3 caches provide this functionality.
287287
For details, see BKDGs at
288-
http://developer.amd.com/documentation/guides/Pages/default.aspx
288+
https://www.amd.com/en/support/tech-docs?keyword=bios+kernel
289289

290290

291291
What: /sys/devices/system/cpu/cpufreq/boost

Documentation/ABI/testing/sysfs-driver-input-exc3000

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,12 @@ Description: Reports the model identification provided by the touchscreen, fo
1515
Access: Read
1616

1717
Valid values: Represented as string
18+
19+
What: /sys/bus/i2c/devices/xxx/type
20+
Date: Jan 2021
21+
22+
Description: Reports the type identification provided by the touchscreen, for example "PCAP82H80 Series"
23+
24+
Access: Read
25+
26+
Valid values: Represented as string

Documentation/ABI/testing/sysfs-fs-f2fs

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ Date April 2019
276276
Contact: "Daniel Rosenberg" <[email protected]>
277277
Description: If checkpoint=disable, it displays the number of blocks that
278278
are unusable.
279-
If checkpoint=enable it displays the enumber of blocks that
279+
If checkpoint=enable it displays the number of blocks that
280280
would be unusable if checkpoint=disable were to be set.
281281

282282
What: /sys/fs/f2fs/<disk>/encoding
@@ -409,3 +409,32 @@ Description: Give a way to change checkpoint merge daemon's io priority.
409409
I/O priority "3". We can select the class between "rt" and "be",
410410
and set the I/O priority within valid range of it. "," delimiter
411411
is necessary in between I/O class and priority number.
412+
413+
What: /sys/fs/f2fs/<disk>/ovp_segments
414+
Date: March 2021
415+
Contact: "Jaegeuk Kim" <[email protected]>
416+
Description: Shows the number of overprovision segments.
417+
418+
What: /sys/fs/f2fs/<disk>/compr_written_block
419+
Date: March 2021
420+
Contact: "Daeho Jeong" <[email protected]>
421+
Description: Show the block count written after compression since mount. Note
422+
that when the compressed blocks are deleted, this count doesn't
423+
decrease. If you write "0" here, you can initialize
424+
compr_written_block and compr_saved_block to "0".
425+
426+
What: /sys/fs/f2fs/<disk>/compr_saved_block
427+
Date: March 2021
428+
Contact: "Daeho Jeong" <[email protected]>
429+
Description: Show the saved block count with compression since mount. Note
430+
that when the compressed blocks are deleted, this count doesn't
431+
decrease. If you write "0" here, you can initialize
432+
compr_written_block and compr_saved_block to "0".
433+
434+
What: /sys/fs/f2fs/<disk>/compr_new_inode
435+
Date: March 2021
436+
Contact: "Daeho Jeong" <[email protected]>
437+
Description: Show the count of inode newly enabled for compression since mount.
438+
Note that when the compression is disabled for the files, this count
439+
doesn't decrease. If you write "0" here, you can initialize
440+
compr_new_inode to "0".
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
What: /sys/kernel/mm/cma/
2+
Date: Feb 2021
3+
Contact: Minchan Kim <[email protected]>
4+
Description:
5+
/sys/kernel/mm/cma/ contains a subdirectory for each CMA
6+
heap name (also sometimes called CMA areas).
7+
8+
Each CMA heap subdirectory (that is, each
9+
/sys/kernel/mm/cma/<cma-heap-name> directory) contains the
10+
following items:
11+
12+
alloc_pages_success
13+
alloc_pages_fail
14+
15+
What: /sys/kernel/mm/cma/<cma-heap-name>/alloc_pages_success
16+
Date: Feb 2021
17+
Contact: Minchan Kim <[email protected]>
18+
Description:
19+
the number of pages CMA API succeeded to allocate
20+
21+
What: /sys/kernel/mm/cma/<cma-heap-name>/alloc_pages_fail
22+
Date: Feb 2021
23+
Contact: Minchan Kim <[email protected]>
24+
Description:
25+
the number of pages CMA API failed to allocate

Documentation/admin-guide/devices.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
1 char Memory devices
66
1 = /dev/mem Physical memory access
7-
2 = /dev/kmem Kernel virtual memory access
7+
2 = /dev/kmem OBSOLETE - replaced by /proc/kcore
88
3 = /dev/null Null device
99
4 = /dev/port I/O port access
1010
5 = /dev/zero Null byte source

Documentation/admin-guide/gpio/gpio-mockup.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@ module.
1717
gpio_mockup_ranges
1818

1919
This parameter takes an argument in the form of an array of integer
20-
pairs. Each pair defines the base GPIO number (if any) and the number
21-
of lines exposed by the chip. If the base GPIO is -1, the gpiolib
22-
will assign it automatically.
20+
pairs. Each pair defines the base GPIO number (non-negative integer)
21+
and the first number after the last of this chip. If the base GPIO
22+
is -1, the gpiolib will assign it automatically. while the following
23+
parameter is the number of lines exposed by the chip.
2324

24-
Example: gpio_mockup_ranges=-1,8,-1,16,405,4
25+
Example: gpio_mockup_ranges=-1,8,-1,16,405,409
2526

2627
The line above creates three chips. The first one will expose 8 lines,
2728
the second 16 and the third 4. The base GPIO for the third chip is set
2829
to 405 while for two first chips it will be assigned automatically.
2930

30-
gpio_named_lines
31+
gpio_mockup_named_lines
3132

3233
This parameter doesn't take any arguments. It lets the driver know that
3334
GPIO lines exposed by it should be named.

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,6 +1469,12 @@
14691469
Don't use this when you are not running on the
14701470
android emulator
14711471

1472+
gpio-mockup.gpio_mockup_ranges
1473+
[HW] Sets the ranges of gpiochip of for this device.
1474+
Format: <start1>,<end1>,<start2>,<end2>...
1475+
gpio-mockup.gpio_mockup_named_lines
1476+
[HW] Let the driver know GPIO lines should be named.
1477+
14721478
gpt [EFI] Forces disk with valid GPT signature but
14731479
invalid Protective MBR to be treated as GPT. If the
14741480
primary GPT is corrupted, it enables the backup/alternate
@@ -1492,10 +1498,6 @@
14921498
Format: <unsigned int> such that (rxsize & ~0x1fffc0) == 0.
14931499
Default: 1024
14941500

1495-
gpio-mockup.gpio_mockup_ranges
1496-
[HW] Sets the ranges of gpiochip of for this device.
1497-
Format: <start1>,<end1>,<start2>,<end2>...
1498-
14991501
hardlockup_all_cpu_backtrace=
15001502
[KNL] Should the hard-lockup detector generate
15011503
backtraces on all cpus.
@@ -1833,6 +1835,18 @@
18331835
initcall functions. Useful for debugging built-in
18341836
modules and initcalls.
18351837

1838+
initramfs_async= [KNL]
1839+
Format: <bool>
1840+
Default: 1
1841+
This parameter controls whether the initramfs
1842+
image is unpacked asynchronously, concurrently
1843+
with devices being probed and
1844+
initialized. This should normally just work,
1845+
but as a debugging aid, one can get the
1846+
historical behaviour of the initramfs
1847+
unpacking being completed before device_ and
1848+
late_ initcalls.
1849+
18361850
initrd= [BOOT] Specify the location of the initial ramdisk
18371851

18381852
initrdmem= [KNL] Specify a physical address and size from which to
@@ -2802,7 +2816,24 @@
28022816
seconds. Use this parameter to check at some
28032817
other rate. 0 disables periodic checking.
28042818

2805-
memtest= [KNL,X86,ARM,PPC] Enable memtest
2819+
memory_hotplug.memmap_on_memory
2820+
[KNL,X86,ARM] Boolean flag to enable this feature.
2821+
Format: {on | off (default)}
2822+
When enabled, runtime hotplugged memory will
2823+
allocate its internal metadata (struct pages)
2824+
from the hotadded memory which will allow to
2825+
hotadd a lot of memory without requiring
2826+
additional memory to do so.
2827+
This feature is disabled by default because it
2828+
has some implication on large (e.g. GB)
2829+
allocations in some configurations (e.g. small
2830+
memory blocks).
2831+
The state of the flag can be read in
2832+
/sys/module/memory_hotplug/parameters/memmap_on_memory.
2833+
Note that even when enabled, there are a few cases where
2834+
the feature is not effective.
2835+
2836+
memtest= [KNL,X86,ARM,PPC,RISCV] Enable memtest
28062837
Format: <integer>
28072838
default : 0 <disable>
28082839
Specifies the number of memtest passes to be

Documentation/admin-guide/mm/memory-hotplug.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,15 @@ creates ZONE_MOVABLE as following.
357357
Unfortunately, there is no information to show which memory block belongs
358358
to ZONE_MOVABLE. This is TBD.
359359

360+
.. note::
361+
Techniques that rely on long-term pinnings of memory (especially, RDMA and
362+
vfio) are fundamentally problematic with ZONE_MOVABLE and, therefore, memory
363+
hot remove. Pinned pages cannot reside on ZONE_MOVABLE, to guarantee that
364+
memory can still get hot removed - be aware that pinning can fail even if
365+
there is plenty of free memory in ZONE_MOVABLE. In addition, using
366+
ZONE_MOVABLE might make page pinning more expensive, because pages have to be
367+
migrated off that zone first.
368+
360369
.. _memory_hotplug_how_to_offline_memory:
361370

362371
How to offline memory

Documentation/admin-guide/mm/userfaultfd.rst

Lines changed: 66 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -63,68 +63,93 @@ the generic ioctl available.
6363

6464
The ``uffdio_api.features`` bitmask returned by the ``UFFDIO_API`` ioctl
6565
defines what memory types are supported by the ``userfaultfd`` and what
66-
events, except page fault notifications, may be generated.
67-
68-
If the kernel supports registering ``userfaultfd`` ranges on hugetlbfs
69-
virtual memory areas, ``UFFD_FEATURE_MISSING_HUGETLBFS`` will be set in
70-
``uffdio_api.features``. Similarly, ``UFFD_FEATURE_MISSING_SHMEM`` will be
71-
set if the kernel supports registering ``userfaultfd`` ranges on shared
72-
memory (covering all shmem APIs, i.e. tmpfs, ``IPCSHM``, ``/dev/zero``,
73-
``MAP_SHARED``, ``memfd_create``, etc).
74-
75-
The userland application that wants to use ``userfaultfd`` with hugetlbfs
76-
or shared memory need to set the corresponding flag in
77-
``uffdio_api.features`` to enable those features.
78-
79-
If the userland desires to receive notifications for events other than
80-
page faults, it has to verify that ``uffdio_api.features`` has appropriate
81-
``UFFD_FEATURE_EVENT_*`` bits set. These events are described in more
82-
detail below in `Non-cooperative userfaultfd`_ section.
83-
84-
Once the ``userfaultfd`` has been enabled the ``UFFDIO_REGISTER`` ioctl should
85-
be invoked (if present in the returned ``uffdio_api.ioctls`` bitmask) to
86-
register a memory range in the ``userfaultfd`` by setting the
66+
events, except page fault notifications, may be generated:
67+
68+
- The ``UFFD_FEATURE_EVENT_*`` flags indicate that various other events
69+
other than page faults are supported. These events are described in more
70+
detail below in the `Non-cooperative userfaultfd`_ section.
71+
72+
- ``UFFD_FEATURE_MISSING_HUGETLBFS`` and ``UFFD_FEATURE_MISSING_SHMEM``
73+
indicate that the kernel supports ``UFFDIO_REGISTER_MODE_MISSING``
74+
registrations for hugetlbfs and shared memory (covering all shmem APIs,
75+
i.e. tmpfs, ``IPCSHM``, ``/dev/zero``, ``MAP_SHARED``, ``memfd_create``,
76+
etc) virtual memory areas, respectively.
77+
78+
- ``UFFD_FEATURE_MINOR_HUGETLBFS`` indicates that the kernel supports
79+
``UFFDIO_REGISTER_MODE_MINOR`` registration for hugetlbfs virtual memory
80+
areas.
81+
82+
The userland application should set the feature flags it intends to use
83+
when invoking the ``UFFDIO_API`` ioctl, to request that those features be
84+
enabled if supported.
85+
86+
Once the ``userfaultfd`` API has been enabled the ``UFFDIO_REGISTER``
87+
ioctl should be invoked (if present in the returned ``uffdio_api.ioctls``
88+
bitmask) to register a memory range in the ``userfaultfd`` by setting the
8789
uffdio_register structure accordingly. The ``uffdio_register.mode``
8890
bitmask will specify to the kernel which kind of faults to track for
89-
the range (``UFFDIO_REGISTER_MODE_MISSING`` would track missing
90-
pages). The ``UFFDIO_REGISTER`` ioctl will return the
91+
the range. The ``UFFDIO_REGISTER`` ioctl will return the
9192
``uffdio_register.ioctls`` bitmask of ioctls that are suitable to resolve
9293
userfaults on the range registered. Not all ioctls will necessarily be
93-
supported for all memory types depending on the underlying virtual
94-
memory backend (anonymous memory vs tmpfs vs real filebacked
95-
mappings).
94+
supported for all memory types (e.g. anonymous memory vs. shmem vs.
95+
hugetlbfs), or all types of intercepted faults.
9696

9797
Userland can use the ``uffdio_register.ioctls`` to manage the virtual
9898
address space in the background (to add or potentially also remove
9999
memory from the ``userfaultfd`` registered range). This means a userfault
100100
could be triggering just before userland maps in the background the
101101
user-faulted page.
102102

103-
The primary ioctl to resolve userfaults is ``UFFDIO_COPY``. That
104-
atomically copies a page into the userfault registered range and wakes
105-
up the blocked userfaults
106-
(unless ``uffdio_copy.mode & UFFDIO_COPY_MODE_DONTWAKE`` is set).
107-
Other ioctl works similarly to ``UFFDIO_COPY``. They're atomic as in
108-
guaranteeing that nothing can see an half copied page since it'll
109-
keep userfaulting until the copy has finished.
103+
Resolving Userfaults
104+
--------------------
105+
106+
There are three basic ways to resolve userfaults:
107+
108+
- ``UFFDIO_COPY`` atomically copies some existing page contents from
109+
userspace.
110+
111+
- ``UFFDIO_ZEROPAGE`` atomically zeros the new page.
112+
113+
- ``UFFDIO_CONTINUE`` maps an existing, previously-populated page.
114+
115+
These operations are atomic in the sense that they guarantee nothing can
116+
see a half-populated page, since readers will keep userfaulting until the
117+
operation has finished.
118+
119+
By default, these wake up userfaults blocked on the range in question.
120+
They support a ``UFFDIO_*_MODE_DONTWAKE`` ``mode`` flag, which indicates
121+
that waking will be done separately at some later time.
122+
123+
Which ioctl to choose depends on the kind of page fault, and what we'd
124+
like to do to resolve it:
125+
126+
- For ``UFFDIO_REGISTER_MODE_MISSING`` faults, the fault needs to be
127+
resolved by either providing a new page (``UFFDIO_COPY``), or mapping
128+
the zero page (``UFFDIO_ZEROPAGE``). By default, the kernel would map
129+
the zero page for a missing fault. With userfaultfd, userspace can
130+
decide what content to provide before the faulting thread continues.
131+
132+
- For ``UFFDIO_REGISTER_MODE_MINOR`` faults, there is an existing page (in
133+
the page cache). Userspace has the option of modifying the page's
134+
contents before resolving the fault. Once the contents are correct
135+
(modified or not), userspace asks the kernel to map the page and let the
136+
faulting thread continue with ``UFFDIO_CONTINUE``.
110137

111138
Notes:
112139

113-
- If you requested ``UFFDIO_REGISTER_MODE_MISSING`` when registering then
114-
you must provide some kind of page in your thread after reading from
115-
the uffd. You must provide either ``UFFDIO_COPY`` or ``UFFDIO_ZEROPAGE``.
116-
The normal behavior of the OS automatically providing a zero page on
117-
an anonymous mmaping is not in place.
140+
- You can tell which kind of fault occurred by examining
141+
``pagefault.flags`` within the ``uffd_msg``, checking for the
142+
``UFFD_PAGEFAULT_FLAG_*`` flags.
118143

119144
- None of the page-delivering ioctls default to the range that you
120145
registered with. You must fill in all fields for the appropriate
121146
ioctl struct including the range.
122147

123148
- You get the address of the access that triggered the missing page
124149
event out of a struct uffd_msg that you read in the thread from the
125-
uffd. You can supply as many pages as you want with ``UFFDIO_COPY`` or
126-
``UFFDIO_ZEROPAGE``. Keep in mind that unless you used DONTWAKE then
127-
the first of any of those IOCTLs wakes up the faulting thread.
150+
uffd. You can supply as many pages as you want with these IOCTLs.
151+
Keep in mind that unless you used DONTWAKE then the first of any of
152+
those IOCTLs wakes up the faulting thread.
128153

129154
- Be sure to test for all errors including
130155
(``pollfd[0].revents & POLLERR``). This can happen, e.g. when ranges

0 commit comments

Comments
 (0)