From: Jonathan Rajotte Date: Mon, 29 Jul 2019 18:49:59 +0000 (-0400) Subject: Use MAP_POPULATE to reduce pagefault when available X-Git-Tag: v2.12.0-rc1~29 X-Git-Url: https://git.lttng.org/?a=commitdiff_plain;h=4d4838bad480d48424bddc686f5ad0089e28ac94;hp=4d4838bad480d48424bddc686f5ad0089e28ac94;p=lttng-ust.git Use MAP_POPULATE to reduce pagefault when available Any ring buffer configuration bigger than PAGE_SIZE would result in an increased latency for the first tracepoint hit (1200ns) landing on a new PAGE_SIZE sized chunk of the mapped memory. This happens at least for the first ring buffer traversal. To alleviate this we can use MAP_POPULATE that will "prefault" the page tables. A similar flag seems to exist on freebsd (MAP_PREFAULT_READ) but I do not have access to a system to test it and ensure it does indeed results in the same effect. It mostly indicates that it prefaults for the read case so I doubt it is the case. Default to using MAP_POPULATE on Linux only for now. Support of prefaulting on other platforms will be added as needed. Link: https://lists.lttng.org/pipermail/lttng-dev/2019-July/029116.html Link: https://lists.lttng.org/pipermail/lttng-dev/2019-July/029122.html Tested-by: Yiteng Guo Signed-off-by: Jonathan Rajotte Signed-off-by: Mathieu Desnoyers ---