]> git.ipfire.org Git - thirdparty/haproxy.git/commit
DEBUG: pollers/fd: add thread id suffix to per-thread memory areas name hints
authorAurelien DARRAGON <adarragon@haproxy.com>
Fri, 24 May 2024 08:41:28 +0000 (10:41 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Fri, 24 May 2024 10:07:18 +0000 (12:07 +0200)
commitc9af6d5414e44e8ba3057bb33443cbefd620871f
tree1de042339a240d4079dc2f1087666690e8702caa
parent9d37c4b989cb5b8d0a0984a505d4715fe87cc9a8
DEBUG: pollers/fd: add thread id suffix to per-thread memory areas name hints

Willy reported that since abb8412d2 ("DEBUG: pollers: add name hint for
large memory areas used by pollers") and 22ec2ad8b ("DEBUG: fd: add name
hint for large memory areas") multiple maps with the same name could be
found in /proc/<pid>/maps when haproxy process is started with multiple
threads, which can be annoying.

In fact this happens because some poller and fd-created memory areas are
being created for each available thread, and since the naming was done
using vma_set_name() with the same <type> and <name> inputs, the resulting
name was the same for all threads.

Thanks to the previous commit, we now use vma_set_name_id() for naming
per-thread memory areas so that "-id" prefix is appended after the name
name, where "id" equals to 'tid+1' (to match the thread numbering logic
found in config file or in ha_panic() report),  allowing to easily
identify which haproxy thread owns the map in /proc/<pid>/maps:

7d3b26200000-7d3b26a01000 rw-p 00000000 00:00 0                          [anon:ev_poll:poll_events-2]
7d3b26c00000-7d3b27001000 rw-p 00000000 00:00 0                          [anon:fd:fd_updt-2]
7d3b27200000-7d3b27a01000 rw-p 00000000 00:00 0                          [anon:ev_poll:poll_events-1]
7d3b34200000-7d3b34601000 rw-p 00000000 00:00 0                          [anon:fd:fd_updt-1]
src/ev_epoll.c
src/ev_poll.c
src/ev_select.c
src/fd.c