Files
Inbox/系统基座文件/1/1.1/1.1.7 实时性与吞吐量配置补丁 (Real-time & Throughput Patches).md
2025-12-11 07:24:36 +08:00

65 lines
2.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
tags: []
aliases:
- 1.1.7 实时性与吞吐量配置补丁 (Real-time & Throughput Patches)
date created: 星期三, 十一月 19日 2025, 4:31:12 下午
date modified: 星期三, 十一月 19日 2025, 4:31:40 下午
---
# 1.1.7 实时性与吞吐量配置补丁 (Real-time & Throughput Patches)
| **组件** | **状态** | **说明** |
| :--- | :--- | :--- |
| **limits.conf** | 已修复 | 解决了 `max locked memory` 64KB 的致命限制。 |
| **sysctl.conf** | 已优化 | 解决了 `numa_balancing` 抖动和网络缓冲不足的问题。 |
| **GRUB CMDLINE** | 已加固 | 解决了 USB 设备的自动挂起风险。 |
-----
**1. 进程级资源锁定限制 (Process Memory Locking)**
- **关键性**P0
- **信息解析**:已通过修改 `/etc/security/limits.conf`,将**锁定内存限制**从原先的致命值 **64KB** 提升至 `unlimited`。这确保了雷达实时线程和 DMA 缓冲区能成功调用 `mlock()`,杜绝内存换出导致的延迟。
- 探测命令与结果:
```bash
ulimit -l
unlimited
```
**2. 核心调度与实时节流策略 (CPU Scheduling & Throttling)**
- **关键性**P0
- **信息解析**:已停止并禁用 `irqbalance` 服务,并强制将内核 `numa_balancing` 设置为 `0`,消除了自动化的内存和中断迁移,以保障信号处理的时序确定性。同时,通过 `sched_rt_runtime_us = -1` 解除了对实时线程的 CPU 时间节流。
- 探测命令与结果:
```bash
systemctl status irqbalance | grep Active
Active: inactive (dead) since …
sysctl kernel.numa_balancing
kernel.numa_balancing = 0
```
**3. 网络 UDP 缓冲区优化 (Network UDP Buffers)**
- **关键性**P1
- **信息解析**:已通过 `/etc/sysctl.d/99-radar-tuning.conf` 文件,将内核接收 (`rmem_max`) 和发送 (`wmem_max`) 缓冲区最大值从默认值提升至 25MB 以上,同时优化了 ARP 表大小。这对于处理降级 PCIe 链路 上的雷达高速 UDP 数据流是必要的。
- 探测命令与结果:
```bash
sysctl net.core.rmem_max
net.core.rmem_max = 26214400
```
**4. 硬件电源管理修正 (USB Power Management)**
- **关键性**P2
- **信息解析**:已通过 GRUB 引导参数,追加 `usbcore.autosuspend=-1`。这防止了连接的 USB 设备(如网卡)因系统默认的节能策略而进入休眠,保障了数据流的持续性。
- 探测命令与结果:
```bash
cat /proc/cmdline
… usbcore.autosuspend=-1 …
```