[igt-dev] [PATCH i-g-t 2/3] lib/intel_bufops: Add simple object cache

Chris Wilson chris at chris-wilson.co.uk
Tue Sep 29 11:51:06 UTC 2020


Quoting Dominik Grzegorzek (2020-09-29 11:48:17)
> +struct cache_entry {
> +       int fd;

So we assume that we are not lazy and completely clean up the cache
between subtests in case we reopen the device with the same fd?

For forking, if the parent opened with CLOEXEC, the child could open
the device with the same fd and not know about the parent's poison in
the cache. (This happens with the libdrm_intel cache, can be quite a
nuisance.)

Or not a concern?

> +       uint32_t size;
> +       uint32_t handle;
> +       uint64_t prev_offset;
> +       bool reserved;
> +       bool busy;
> +       struct igt_list_head link;

Consider member layout to reduce holes.
-Chris


More information about the igt-dev mailing list