An open API service indexing awesome lists of open source software.

https://github.com/mikuchi9/ebpf-prefetch-hints

An eBPF-based tool that suggests prefetching hints to the Linux kernel for frequently executed binaries in /usr/bin.
https://github.com/mikuchi9/ebpf-prefetch-hints

ebpf libbpf performance prefetch system-tools userspace

Last synced: 3 days ago
JSON representation

An eBPF-based tool that suggests prefetching hints to the Linux kernel for frequently executed binaries in /usr/bin.

Awesome Lists containing this project

README

          

## eBPF Prefetch Hints

⚡ **Speed up frequently used binaries** by hinting the Linux kernel to prefetch them — powered by eBPF.

### 🚀 What It Does

This tool uses an eBPF kernel-side program to track execution frequency of binaries under `/usr/bin`, and a user-space controller that:

- Aggregates call frequency from a BPF map
- Periodically identifies hot binaries
- Suggests prefetching those binaries via system hints

### 🔧 Features

- [x] eBPF‑based tracing of binary execution under **/usr/bin**
- [x] Maintains a frequency map of hot binaries in the kernel
- [x] **User‑defined polling interval**
  • run `sudo ./prefetch_hint `
  • defaults to **300 s** (5 min) when omitted
- [x] Advises the kernel with `posix_fadvise()` to **prefetch the
*.text* segment** of each hot ELF binary

### Prerequisites

- Linux kernel with eBPF support
- Clang/LLVM and libbpf-dev
- bpftool
- Root privileges

### 🛠️ Build and Run

```
make all
sudo ./prefetch_hint
```

### 📦 Header provenance
The bundled `vmlinux.h` was generated on Ubuntu 22.04.04 LTS (kernel 6.5.0, BTF enabled)
using `bpftool v7.3.0`. Regenerate with `make headers` if you need an exact match
for a custom kernel.