This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bpftrace | |
| /* | |
| * io_uring workload insight. | |
| * | |
| * Gives a complete picture of io_uring activity during a workload: | |
| * - ring lifecycle (create, cqring wait) | |
| * - submission & completion volume and per-opcode breakdown | |
| * - per-request latency (submit -> complete) per opcode | |
| * - registration-path activity (buffers/files/etc.), with stacks | |
| * - async-work offload and io_uring_enter traffic |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bpftrace | |
| /* | |
| * hmm-snoop.bt -- comprehensive observer for Linux HMM / CPU-GPU memory | |
| * | |
| * Reports all CPU<->device memory interactions that flow through the | |
| * kernel's HMM (Heterogeneous Memory Management) APIs, without any driver | |
| * cooperation. Works transparently for any driver that uses the standard | |
| * migrate_vma_* / hmm_range_fault interface: amdgpu/amdkfd, nouveau, | |
| * drm/xe (via drm_pagemap), and lib/test_hmm. No kernel patches required. | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # A script to offline a certain percentage of memory from a specific NUMA node. | |
| # --- Input Validation --- | |
| if [ "$EUID" -ne 0 ]; then | |
| echo "Please run as root." | |
| exit 1 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bpftrace | |
| /* | |
| * extfragsnoop Trace events that induce system external memory fragmentation. | |
| * For Linux, uses bpftrace and eBPF. | |
| * | |
| * This traces when a fallback event occurs, particularly mixed pageblocks that | |
| * occur as a consequence of pollution upon memory pressure. | |
| * | |
| * Unmovable memory is the enemy of a de-fragmenting process (compaction), so | |
| * gather such allocations as well as situations when movable memory becomes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "target": "linux/amd64", | |
| "http": "127.0.0.1:56741", | |
| "workdir": "workdir", | |
| "kernel_obj": "/home/dave/code/linux/", | |
| "image": "/img/bullseye.img", | |
| "sshkey": "/img/bullseye.id_rsa", | |
| "syzkaller": "/home/dave/code/syzkaller", | |
| "procs": 8, | |
| "type": "qemu", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "target": "linux/amd64", | |
| "http": "127.0.0.1:56741", | |
| "workdir": "workdir", | |
| "kernel_obj": "/home/dave/code/linux/", | |
| "image": "/img/bullseye.img", | |
| "sshkey": "/img/bullseye.id_rsa", | |
| "syzkaller": "/home/dave/code/syzkaller", | |
| "procs": 8, | |
| "type": "qemu", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "target": "linux/amd64", | |
| "http": "127.0.0.1:56741", | |
| "workdir": "workdir", | |
| "kernel_obj": "/home/dave/code/linux/", | |
| "image": "/img/bullseye.img", | |
| "sshkey": "/img/bullseye.id_rsa", | |
| "syzkaller": "/home/dave/code/syzkaller", | |
| "procs": 8, | |
| "type": "qemu", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "target": "linux/amd64", | |
| "http": "127.0.0.1:56741", | |
| "workdir": "workdir", | |
| "kernel_obj": "/home/dave/code/linux/", | |
| "image": "/img/bullseye.img", | |
| "sshkey": "/img/bullseye.id_rsa", | |
| "syzkaller": "/home/dave/code/syzkaller", | |
| "procs": 8, | |
| "type": "qemu", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Applies to the MM, but works on any subsystem. | |
| Based on https://deferred.io/2015/10/27/visualizing-linux-kernel-call-graphs.html | |
| $ git diff | |
| diff --git a/Makefile b/Makefile | |
| index c43d825a3c4c..3b9f43a112b8 100644 | |
| --- a/Makefile | |
| +++ b/Makefile | |
| @@ -523,7 +523,7 @@ KBUILD_AFLAGS := -D__ASSEMBLY__ -fno-PIE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright (C) Davidlohr Bueso, 2018. | |
| // | |
| // Convert the infamous mmap_sem to a range lock. | |
| // Usage within the kernel source: | |
| // | |
| // $ make coccicheck MODE=patch COCCI=/path/to/mmap_sem.cocci | |
| virtual patch | |
| virtual context | |
| virtual org |
NewerOlder