[FFmpeg-devel] [PATCH] libsvtav1: Add logical_processors option
Mark Thompson
sw at jkqxz.net
Fri Feb 12 00:12:54 EET 2021
On 10/02/2021 23:49, Christopher Degawa wrote:
> Based on my limited understanding of the code, it's limiting the usage
> using pthread_setaffinity_np and CPU_SET on Linux to limit the process to
> certain CPUs, but it also has a default and max of the return of
> `sysconf(_SC_NPROCESSORS_ONLN)`. According to Hassene Tmar of SVT-AV1, it
> is a "target core count that SVT would do a best effort to achieve" and
> "--lp 8 might still produce 50 threads". It does not actually limit how
> many threads are deployed.
IMO people who want to do things with processor affinity should use the flexible tools that their OS provides to do it (on Linux, that's taskset for the ffmpeg utility and sched_setaffinity() for library users). Having a specific and weird special case option is not obviously useful.
(In particular, not warning that it's changing processor affinity in a tricky way is making the option a footgun - if I run two instances of ffmpeg then the intuitive thing to do would be to pass my number of cpus / 2 to each, which would give me a result much worse than passing nothing at all.)
That said, if you have a general use-case where this is helpful and the documentation explains what it is doing (and warns about the bad cases) then maybe?
Thanks,
- Mark
More information about the ffmpeg-devel
mailing list