Skip to content

Commit b0c0388

Browse files
committed
Merge: RHEL 10.1: DRM Dependencies Backport
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/606 ## Overview The DRM backport's goal is to backport all the changes in the DRM subsystem to the kernel target version, with the biggest value being that we get the upstream hardware enablement (and bug fixes) into RHEL. This merge request is the initial step of the DRM backport: identify and backport the dependencies of the DRM backport outside of `drivers/gpu`. Check https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/615 for the main backport MR. ## Dependencies: This MR is quite big. In other to simplify the process of getting ACKs from different subsystems, I extracted some of the tree-wide changes to standalone MRs: - Drop `__stringify` in `EXPORT_SYMBOL_NS`, `EXPORT_SYMBOL_NS_GPL` and `MODULE_IMPORT_NS`. Backported in https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/627. - Simplify assignment of required_devs for required OPPs. The first 2 patches of [the series](https://lore.kernel.org/all/20241002122232.194245-1-ulf.hansson@linaro.org/) are already present the rest are backported in https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/628. ## Included changes: Dependencies required for 6.13: - New configuration options - Add file_ref. Patches: - fs: protect backing files with rcu - fs: add file_ref - fs: port files to file_ref - Rename drm/intel/i915_pciids.h to drm/intel/pciids.h. Patches: - drm/i915/pciids: use designated initializers in INTEL_VGA_DEVICE() - drm/i915/pciids: separate ARL and MTL PCI IDs - drm/i915/xe3lpd: reuse xe2lpd definition - drm/i915/pciids: add PVC PCI ID macros - drm/intel/pciids: rename i915_pciids.h to just pciids.h - Remove drm/intel/xe_pciids.h and use drm/intel/pciids.h. Patches: - drm/xe/ptl: Add PTL platform definition - drm/xe: switch to common PCI ID macros - drm/xe: remove unused xe_pciids.h harder, add missing PCI ID - Fix recursive dependencies compile errors. Patches: - fbdev: Fix recursive dependencies wrt BACKLIGHT_CLASS_DEVICE - Add missing IDs in media-bus-format.h. Patches: - media: uapi: Add MEDIA_BUS_FMT_RGB101010_1X7X5_{SPWG, JEIDA} - Constify struct bin_attribute. Patches: [Dropped after https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/638 was merged] - sysfs: explicitly pass size to sysfs_add_bin_file_mode_ns() - sysfs: introduce callback attribute_group::bin_size - PCI/sysfs: Calculate bin_attribute size through bin_size() - nvmem: core: calculate bin_attribute size through bin_size() - sysfs: treewide: constify attribute callback of bin_is_visible() - sysfs: treewide: constify attribute callback of bin_attribute::mmap() - sysfs: treewide: constify attribute callback of bin_attribute::llseek() - sysfs: implement all BIN_ATTR_* macros in terms of __BIN_ATTR() - sysfs: bin_attribute: add const read/write callback variants - driver core: Constify attribute arguments of binary attributes - cdx: Fix cdx_mmap_resource() after constifying attr in ->mmap() Dependencies required for 6.14: - New configuration options - [Add "dmem" memory accounting cgroup](https://lore.kernel.org/all/20241204134410.1161769-1-dev@lankhorst.se/). Only the first patch and the follow up fixes are required, the other will be backported by the main backport. Patches: - kernel/cgroup: Add "dmem" memory accounting cgroup - cgroup/dmem: Select PAGE_COUNTER - cgroup/dmem: Fix parameters documentation - drm/doc: Include new drm-compute documentation - doc/cgroup: Fix title underline length - cgroup/rdma: Drop bogus PAGE_COUNTER select - cgroup/dmem: Don't open-code css_for_each_descendant_pre - [kthread: Introduce preferred affinity](https://lore.kernel.org/all/20241211154035.75565-1-frederic@kernel.org/). I need "treewide: Introduce kthread_run_worker[_on_cpu]\(\)", but it requires backporting the entire series. Patches: - arm/bL_switcher: Use kthread_run_on_cpu() - firmware: stratix10-svc: Use kthread_run_on_cpu() - scsi: bnx2fc: Use kthread_create_on_cpu() - scsi: bnx2i: Use kthread_create_on_cpu() - scsi: qedi: Use kthread_create_on_cpu() - soc/qman: test: Use kthread_run_on_cpu() - kallsyms: Use kthread_run_on_cpu() - lib: test_objpool: Use kthread_run_on_cpu() - arm64: Exclude nohz_full CPUs from 32bits el0 support - sched,arm64: Handle CPU isolation on last resort fallback rq selection - kthread: Make sure kthread hasn't started while binding it - kthread: Default affine kthread to its preferred NUMA node - mm: Create/affine kcompactd to its preferred node - mm: Create/affine kswapd to its preferred node - kthread: Implement preferred affinity - rcu: Use kthread preferred affinity for RCU boost - kthread: Unify kthread_create_on_cpu() and kthread_create_worker_on_cpu() automatic format - treewide: Introduce kthread_run_worker[_on_cpu]\(\) - rcu: Use kthread preferred affinity for RCU exp kworkers - kthread: Fix return value on kzalloc() failure in kthread_affine_preferred() - kthread: modify kernel-doc function name to match code - [ASoC: hdmi-codec: pass data to get_dai_id too](https://lore.kernel.org/all/20241224-drm-bridge-hdmi-connector-v10-0-dc89577cd438@linaro.org/). Taking the first 2 patches, the others will be backported by the main backport. Patches: - ASoC: hdmi-codec: pass data to get_dai_id too - ASoC: hdmi-codec: move no_capture_mute to struct hdmi_codec_pdata - [Converge on secs_to_jiffies()](https://lore.kernel.org/all/20241030-open-coded-timeouts-v3-0-9ba123facf88@linux.microsoft.com/). Required for secs_to_jiffies(). Patches: - jiffies: Define secs_to_jiffies() - jiffies: Cast to unsigned long in secs_to_jiffies() conversion - [Support BMG PMT features for Xe](https://lore.kernel.org/all/20241114130358.2467787-1-michael.j.ruhl@intel.com/). Only the first patch, the other will be backported by the main backport. Patches: - platform/x86/intel/pmt: allow user offset for PMT callbacks ## Omitted fixes: These are reported as fixes for "jiffies: Define secs_to_jiffies()", but they are not fixes, they are conversions to use secs_to_jiffies() instead of various functions. They can be omitted: Omitted-fix: 75c2d63 <br/> Omitted-fix: 5ad2abf <br/> Omitted-fix: 1969392 <br/> Omitted-fix: 84c398c <br/> Omitted-fix: c2cd598 <br/> Omitted-fix: b4aa02f <br/> Omitted-fix: 84bbaeb <br/> Omitted-fix: 38b2ea1 <br/> Omitted-fix: 4d69f4c <br/> Omitted-fix: 3d1a26a <br/> Omitted-fix: b294259 <br/> Omitted-fix: eefdb19 <br/> Omitted-fix: e3b5ace <br/> Omitted-fix: f5ea031 <br/> Omitted-fix: 6d072c0 <br/> Omitted-fix: b6ca5bb <br/> Omitted-fix: f87e4f2 <br/> Omitted-fix: 734ff31 <br/> Omitted-fix: 7d2497f <br/> Omitted-fix: a9d5131 <br/> Omitted-fix: e3e627e <br/> Omitted-fix: 3f0a819 <br/> Omitted-fix: c9d84da <br/> Omitted-fix: a131f20 <br/> Omitted-fix: 32fcd1b <br/> Omitted-fix: 1d2e01d <br/> Omitted-fix: 96b8f46 <br/> Omitted-fix: b3e8dc1 <br/> Omitted-fix: 84c34d0 <br/> Omitted-fix: 78cf56f <br/> Omitted-fix: 344825e <br/> Omitted-fix: 8ef9019 <br/> Omitted-fix: d583461 <br/> Omitted-fix: a877cd2 <br/> Omitted-fix: 2c54b24 <br/> Omitted-fix: 6cf828d <br/> Omitted-fix: eee6af2 <br/> Omitted-fix: 7c9a8c5 <br/> Omitted-fix: 8ba1b42 <br/> Omitted-fix: 66644d8 <br/> Omitted-fix: f873136 <br/> Omitted-fix: f4293c2 <br/> Omitted-fix: 16b8236 ## Other: JIRA: https://issues.redhat.com/browse/RHEL-85955 Signed-off-by: José Expósito <jexposit@redhat.com> Approved-by: Rafael Aquini <raquini@redhat.com> Approved-by: Bastien Nocera <bnocera@redhat.com> Approved-by: Chris Leech <cleech@redhat.com> Approved-by: Vladis Dronov <vdronov@redhat.com> Approved-by: Phil Auld <pauld@redhat.com> Approved-by: Jocelyn Falempe <jfalempe@redhat.com> Approved-by: Michal Schmidt <mschmidt@redhat.com> Approved-by: David Arcari <darcari@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Julio Faracco <jfaracco@redhat.com>
2 parents 45b0c38 + e9dc08b commit b0c0388

File tree

112 files changed

+1965
-586
lines changed

Some content is hidden

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

112 files changed

+1965
-586
lines changed

Documentation/admin-guide/cgroup-v2.rst

Lines changed: 51 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,14 @@ v1 is available under :ref:`Documentation/admin-guide/cgroup-v1/index.rst <cgrou
6464
5-6. Device
6565
5-7. RDMA
6666
5-7-1. RDMA Interface Files
67-
5-8. HugeTLB
68-
5.8-1. HugeTLB Interface Files
69-
5-9. Misc
70-
5.9-1 Miscellaneous cgroup Interface Files
71-
5.9-2 Migration and Ownership
72-
5-10. Others
73-
5-10-1. perf_event
67+
5-8. DMEM
68+
5-9. HugeTLB
69+
5.9-1. HugeTLB Interface Files
70+
5-10. Misc
71+
5.10-1 Miscellaneous cgroup Interface Files
72+
5.10-2 Migration and Ownership
73+
5-11. Others
74+
5-11-1. perf_event
7475
5-N. Non-normative information
7576
5-N-1. CPU controller root cgroup process behaviour
7677
5-N-2. IO controller root cgroup process behaviour
@@ -2626,6 +2627,49 @@ RDMA Interface Files
26262627
mlx4_0 hca_handle=1 hca_object=20
26272628
ocrdma1 hca_handle=1 hca_object=23
26282629

2630+
DMEM
2631+
----
2632+
2633+
The "dmem" controller regulates the distribution and accounting of
2634+
device memory regions. Because each memory region may have its own page size,
2635+
which does not have to be equal to the system page size, the units are always bytes.
2636+
2637+
DMEM Interface Files
2638+
~~~~~~~~~~~~~~~~~~~~
2639+
2640+
dmem.max, dmem.min, dmem.low
2641+
A readwrite nested-keyed file that exists for all the cgroups
2642+
except root that describes current configured resource limit
2643+
for a region.
2644+
2645+
An example for xe follows::
2646+
2647+
drm/0000:03:00.0/vram0 1073741824
2648+
drm/0000:03:00.0/stolen max
2649+
2650+
The semantics are the same as for the memory cgroup controller, and are
2651+
calculated in the same way.
2652+
2653+
dmem.capacity
2654+
A read-only file that describes maximum region capacity.
2655+
It only exists on the root cgroup. Not all memory can be
2656+
allocated by cgroups, as the kernel reserves some for
2657+
internal use.
2658+
2659+
An example for xe follows::
2660+
2661+
drm/0000:03:00.0/vram0 8514437120
2662+
drm/0000:03:00.0/stolen 67108864
2663+
2664+
dmem.current
2665+
A read-only file that describes current resource usage.
2666+
It exists for all the cgroup except root.
2667+
2668+
An example for xe follows::
2669+
2670+
drm/0000:03:00.0/vram0 12550144
2671+
drm/0000:03:00.0/stolen 8650752
2672+
26292673
HugeTLB
26302674
-------
26312675

Documentation/arch/arm64/asymmetric-32bit.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,11 @@ asymmetric system, a broken guest at EL1 could still attempt to execute
153153
mode will return to host userspace with an ``exit_reason`` of
154154
``KVM_EXIT_FAIL_ENTRY`` and will remain non-runnable until successfully
155155
re-initialised by a subsequent ``KVM_ARM_VCPU_INIT`` operation.
156+
157+
NOHZ FULL
158+
---------
159+
160+
To avoid perturbing an adaptive-ticks CPU (specified using
161+
``nohz_full=``) when a 32-bit task is forcefully migrated, these CPUs
162+
are treated as 64-bit-only when support for asymmetric 32-bit systems
163+
is enabled.

Documentation/core-api/cgroup.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
==================
2+
Cgroup Kernel APIs
3+
==================
4+
5+
Device Memory Cgroup API (dmemcg)
6+
=================================
7+
.. kernel-doc:: kernel/cgroup/dmem.c
8+
:export:
9+

Documentation/core-api/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ more memory-management documentation in Documentation/mm/index.rst.
108108
dma-isa-lpc
109109
swiotlb
110110
mm-api
111+
cgroup
111112
genalloc
112113
pin_user_pages
113114
boot-time-mm

Documentation/gpu/drm-compute.rst

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
==================================
2+
Long running workloads and compute
3+
==================================
4+
5+
Long running workloads (compute) are workloads that will not complete in 10
6+
seconds. (The time let the user wait before he reaches for the power button).
7+
This means that other techniques need to be used to manage those workloads,
8+
that cannot use fences.
9+
10+
Some hardware may schedule compute jobs, and have no way to pre-empt them, or
11+
have their memory swapped out from them. Or they simply want their workload
12+
not to be preempted or swapped out at all.
13+
14+
This means that it differs from what is described in driver-api/dma-buf.rst.
15+
16+
As with normal compute jobs, dma-fence may not be used at all. In this case,
17+
not even to force preemption. The driver with is simply forced to unmap a BO
18+
from the long compute job's address space on unbind immediately, not even
19+
waiting for the workload to complete. Effectively this terminates the workload
20+
when there is no hardware support to recover.
21+
22+
Since this is undesirable, there need to be mitigations to prevent a workload
23+
from being terminated. There are several possible approach, all with their
24+
advantages and drawbacks.
25+
26+
The first approach you will likely try is to pin all buffers used by compute.
27+
This guarantees that the job will run uninterrupted, but also allows a very
28+
denial of service attack by pinning as much memory as possible, hogging the
29+
all GPU memory, and possibly a huge chunk of CPU memory.
30+
31+
A second approach that will work slightly better on its own is adding an option
32+
not to evict when creating a new job (any kind). If all of userspace opts in
33+
to this flag, it would prevent cooperating userspace from forced terminating
34+
older compute jobs to start a new one.
35+
36+
If job preemption and recoverable pagefaults are not available, those are the
37+
only approaches possible. So even with those, you want a separate way of
38+
controlling resources. The standard kernel way of doing so is cgroups.
39+
40+
This creates a third option, using cgroups to prevent eviction. Both GPU and
41+
driver-allocated CPU memory would be accounted to the correct cgroup, and
42+
eviction would be made cgroup aware. This allows the GPU to be partitioned
43+
into cgroups, that will allow jobs to run next to each other without
44+
interference.
45+
46+
The interface to the cgroup would be similar to the current CPU memory
47+
interface, with similar semantics for min/low/high/max, if eviction can
48+
be made cgroup aware.
49+
50+
What should be noted is that each memory region (tiled memory for example)
51+
should have its own accounting.
52+
53+
The key is set to the regionid set by the driver, for example "tile0".
54+
For the value of $card, we use drmGetUnique().

Documentation/gpu/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ GPU Driver Developer's Guide
1313
drm-usage-stats
1414
driver-uapi
1515
drm-client
16+
drm-compute
1617
drivers
1718
backlight
1819
vga-switcheroo

0 commit comments

Comments
 (0)