linux/Documentation
Lucas De Marchi 188ced1e0f drm/xe/client: Print runtime to fdinfo
Print the accumulated runtime for client when printing fdinfo.
Each time a query is done it first does 2 things:

1) loop through all the exec queues for the current client and
   accumulate the runtime, per engine class. CTX_TIMESTAMP is used for
   that, being read from the context image.

2) Read a "GPU timestamp" that can be used for considering "how much GPU
   time has passed" and that has the same unit/refclock as the one
   recording the runtime. RING_TIMESTAMP is used for that via MMIO.

Since for all current platforms RING_TIMESTAMP follows the same
refclock, just read it once, using any first engine available.

This is exported to userspace as 2 numbers in fdinfo:

	drm-cycles-<class>: <RUNTIME>
	drm-total-cycles-<class>: <TIMESTAMP>

Userspace is expected to collect at least 2 samples, which allows to
know the client engine busyness as per:

		    RUNTIME1 - RUNTIME0
	busyness = ---------------------
			  T1 - T0

Since drm-cycles-<class> always starts at 0, it's also possible to know
if and engine was ever used by a client.

It's expected that userspace will read any 2 samples every few seconds.
Given the update frequency of the counters involved and that
CTX_TIMESTAMP is 32-bits, the counter for each exec_queue can wrap
around (assuming 100% utilization) after ~200s. The wraparound is not
perceived by userspace since it's just accumulated for all the
exec_queues in a 64-bit counter) but the measurement will not be
accurate if the samples are too far apart.

This could be mitigated by adding a workqueue to accumulate the counters
every so often, but it's additional complexity for something that is
done already by userspace every few seconds in tools like gputop (from
igt), htop, nvtop, etc, with none of them really defaulting to 1 sample
per minute or more.

Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Acked-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240517204310.88854-9-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
History 2024-05-21 06:33:40 -07:00
..
ABI Merge drm/drm-next into drm-xe-next 2024-04-12 15:14:25 +02:00
accel docs/accel: correct links to mailing list archives 2024-01-23 14:45:50 -07:00
accounting docs: psi: use correct config name 2023-07-31 09:54:17 -06:00
admin-guide Misc fixes: 2024-04-28 11:58:16 -07:00
arch Documentation/x86: Fix title underline length 2024-03-25 11:29:16 +01:00
block Documentation: block: ioprio: Update schedulers 2024-01-18 08:21:14 -07:00
bpf bpf, docs: Rename legacy conformance group to packet 2024-03-04 14:31:06 +01:00
cdrom Documentation: use capitalization for chapters and acronyms 2023-05-16 12:49:31 -06:00
core-api workqueue: Changes for v6.9 2024-03-11 12:50:42 -07:00
cpu-freq Docs/subsystem-apis: Remove '[The ]Linux' prefixes from titles of listed documents 2023-01-24 15:27:08 -07:00
crypto Another moderately busy cycle for documentation, including: 2024-01-11 19:46:52 -08:00
dev-tools Documentation: dev-tools: Add link to RV docs 2024-03-29 08:27:21 -06:00
devicetree Linux 6.9-rc6 2024-04-29 20:22:39 +02:00
doc-guide docs: drop the version constraints for sphinx and dependencies 2024-03-03 08:17:20 -07:00
driver-api Linux 6.9-rc5 2024-04-22 14:35:52 +10:00
fault-injection Fixed case issue with 'fault-injection' in documentation 2024-02-21 13:44:21 -07:00
fb fbdev/intelfb: Remove driver 2024-01-12 12:38:37 +01:00
features membarrier: riscv: Provide core serializing command 2024-02-15 08:04:14 -08:00
filesystems Documentation: filesystems: Add bcachefs toctree 2024-04-06 13:50:26 -04:00
firmware-guide More ACPI updates for 6.9-rc1 2024-03-19 11:15:14 -07:00
firmware_class firmware: revamp firmware documentation 2017-01-11 09:42:59 +01:00
fpga Documentation: use capitalization for chapters and acronyms 2023-05-16 12:49:31 -06:00
gpu drm/xe/client: Print runtime to fdinfo 2024-05-21 06:33:40 -07:00
hid HID: Add introduction about HID for non-kernel programmers 2023-08-07 13:24:36 +02:00
hwmon hwmon: (aspeed-g6-pwm-tacho): Support for ASPEED g6 PWM/Fan tach 2024-03-07 10:50:16 -08:00
i2c Documentation: i2c: Document that client auto-detection is a legacy mechanism 2024-03-07 09:42:09 +01:00
iio docs: iio: add documentation for adis16475 driver 2024-02-28 19:26:36 +00:00
images docs: add SVG version of the Linux logo 2022-06-01 09:32:45 -06:00
infiniband RDMA/core: Remove FMR device ops 2020-06-02 20:32:54 -03:00
input input: docs: properly format ToC headings 2023-11-17 13:05:26 -07:00
isdn Documentation: isdn: correct spelling 2023-02-10 16:28:13 -08:00
kbuild Documentation/llvm: Note s390 LLVM=1 support with LLVM 18.1.0 and newer 2024-03-31 21:09:50 +09:00
kernel-hacking Documentation: Add document for false sharing 2023-04-10 16:46:11 -06:00
leds - New Drivers 2023-07-03 11:26:05 -07:00
litmus-tests LKMM scripting updates for v6.4 2023-04-24 12:02:25 -07:00
livepatch docs: automarkup: linkify git revs 2023-11-17 13:13:24 -07:00
locking locking/mutex: Clarify that mutex_unlock(), and most other sleeping locks, can still use the lock object after it's unlocked 2024-01-08 09:55:31 +01:00
maintainer docs: maintainer: add existing SoC and netdev profiles 2024-02-05 10:05:57 -07:00
mhi docs: Add documentation for MHI bus 2020-03-19 07:41:04 +01:00
misc-devices dt-bindings: misc: xlnx,sd-fec: convert bindings to yaml 2024-02-04 19:49:51 -06:00
mm mm,page_owner: fix refcount imbalance 2024-04-16 15:39:49 -07:00
netlabel docs: add some directories to the main documentation index 2019-07-15 11:03:03 -03:00
netlink Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-03-11 20:38:36 -07:00
networking Documentation: Add documentation for eswitch attribute 2024-03-28 18:20:08 -07:00
nvdimm nvdimm: fixes to maintainter-entry-profile 2020-05-25 10:19:19 -06:00
nvme docs, nvme: add a feature and quirk policy document 2022-12-28 05:37:12 -10:00
PCI docs: PCI: Fix typos 2023-12-28 17:37:36 -06:00
pcmcia Documentation: use capitalization for chapters and acronyms 2023-05-16 12:49:31 -06:00
peci Docs/subsystem-apis: Remove '[The ]Linux' prefixes from titles of listed documents 2023-01-24 15:27:08 -07:00
power Documentation: power: Fix typo in suspend and interrupts doc 2024-03-13 20:51:11 +01:00
process Documentation: embargoed-hardware-issues.rst: Add myself for Power 2024-04-11 15:21:18 +02:00
RCU A moderatly busy cycle for development this time around. 2024-03-12 15:18:34 -07:00
rust docs: rust: fix improper rendering in Arch Support page 2024-03-31 20:45:18 +02:00
scheduler A single update for the documentation of the base_slice_ns tunable to 2024-03-24 11:11:05 -07:00
scsi SCSI misc on 20230902 2023-09-02 12:02:41 -07:00
security Documentation: Destage TEE subsystem documentation 2023-12-08 15:45:10 -07:00
sound ALSA: doc: Use DEFINE_SIMPLE_DEV_PM_OPS() 2024-02-12 11:50:26 +01:00
sphinx docs: drop the version constraints for sphinx and dependencies 2024-03-03 08:17:20 -07:00
sphinx-static docs: translations: add translations links when they exist 2023-12-19 14:34:59 -07:00
spi spi: docs: spidev: fix echo command format 2024-03-19 18:37:55 +00:00
staging docs: staging: fix typo in docs 2024-02-08 15:38:21 -07:00
target scsi: target: docs: Remove tcm_mod_builder.py 2023-06-28 22:01:32 -04:00
tee Documentation: Destage TEE subsystem documentation 2023-12-08 15:45:10 -07:00
timers sched/isolation: Prevent boot crash when the boot CPU is nohz_full 2024-04-28 10:07:12 +02:00
tools tools/rtla: Add -U/--user-load option to timerlat 2024-03-20 05:39:06 +01:00
trace tracing/user_events: Document multi-format flag 2024-03-18 10:13:16 -04:00
translations - Sumanth Korikkar has taught s390 to allocate hotplug-time page frames 2024-03-14 17:43:30 -07:00
usb Documentation: usb: Document FunctionFS DMABUF API 2024-02-17 17:00:09 +01:00
userspace-api media updates for v6.9-rc1 2024-03-15 11:36:54 -07:00
virt Documentation: kvm/sev: clarify usage of KVM_MEMORY_ENCRYPT_OP 2024-03-18 19:03:53 -04:00
w1 w1: add UART w1 bus driver 2024-02-15 15:02:33 +01:00
watchdog Documentation: Fix typos 2023-08-18 11:29:03 -06:00
wmi platform/x86: wmi: Update documentation regarding _WED 2024-02-27 14:44:31 +02:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
atomic_bitops.txt wait_on_bit: add an acquire memory barrier 2022-08-26 09:30:25 -07:00
atomic_t.txt Documentation: Fixed a typo in atomic_t.txt 2023-01-03 20:47:04 -08:00
Changes docs: add back 'Documentation/Changes' file (as symlink) 2016-12-14 16:30:12 -08:00
CodingStyle doc: re-add CodingStyle and SubmittingPatches 2016-10-24 08:12:35 -02:00
conf.py docs: Restore "smart quotes" for quotes 2024-02-28 15:48:18 -07:00
docutils.conf doc-rst: Add missing newline at end of file 2019-06-20 14:16:56 -06:00
dontdiff scripts: remove bin2c 2023-01-26 12:43:33 +09:00
index.rst A moderatly busy cycle for development this time around. 2024-03-12 15:18:34 -07:00
Kconfig Documentation: Avoid duplicate Kconfig inclusion 2023-01-19 13:56:34 -07:00
Makefile docs: Makefile: Add dependency to $(YNL_INDEX) for targets other than htmldocs 2024-03-05 11:06:43 -07:00
memory-barriers.txt doc: Clarify historical disclaimers in memory-barriers.txt 2023-12-14 01:16:28 +05:30
SubmittingPatches doc: re-add CodingStyle and SubmittingPatches 2016-10-24 08:12:35 -02:00
subsystem-apis.rst docs: Fix subsystem APIs page so ungrouped entries have their own header 2024-01-30 14:02:32 -07:00