全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Quantitative Finance · 术语表

什么是 First-touch allocation?

Definition 4.2 Low-Latency Software · 第 4 章 — Multi-Socket Machines and Interconnects

Under first-touch allocation, the default policy of Linux, a page of memory is placed on the NUMA node of the CPU that first writes it (the page fault that creates it), not the one that allocated the address range.

示例

Example 4.3 (A book allocated on the wrong node)

The main thread, on node 0, allocates and zeroes 64 MiB of order books with huge pages at start-up, then starts the feed thread on node 1. Every book update now misses to the other socket’s memory. The fix is one line: move the initialisation into the feed thread, after it has pinned itself, or pass the node to the allocator.

在原文中阅读 →