diff options
author | Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> | 2020-10-23 09:30:08 +0200 |
---|---|---|
committer | Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> | 2021-04-13 15:44:34 +0200 |
commit | 911b17f3d4f52cde4aad99374fc504fecf141256 (patch) | |
tree | 786a44c139c8adef21b0f6ab9c8466859496bbeb /lib/intel_batchbuffer.c | |
parent | 32313d52152e78f7e66fe89e9a7aaa0d70727887 (diff) |
lib/igt_core: Track child process pid and tid
Introduce variables which can decrease number of getpid()/gettid()
calls, especially for allocator which must be aware of method
acquiring addresses.
When child is spawned using igt_fork() we can control its initialization
and prepare child_pid implicitly. Tracking child_tid requires our
intervention in the code and do something like this:
if (child_tid == -1)
child_tid = gettid()
Variable was created for using in TLS so each thread is created
with variable set to -1. This will give each thread it's own "copy"
and there's no risk to use other thread tid. For each forked child
we reassign -1 to child_tid to avoid using already set variable.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Petri Latvala <petri.latvala@intel.com>
Acked-by: Arjun Melkaveri <arjun.melkaveri@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'lib/intel_batchbuffer.c')
0 files changed, 0 insertions, 0 deletions