On Thu, Jun 02, 2016 at 04:34:35PM +0200, Quentin Monnet wrote:
> From: David Marchand <david.march...@6wind.com>
> 
> Relying on /proc/cpuinfo to count the number of available cores is not
> the best option:
> 
> - The code is x86-specific.
> - If the process is started with a different CPU affinity, then it will
>   wrongly try to start too many threads (for an example, imagine an OVS
>   daemon restricted to 4 CPU threads on a 128 threads system).
> 
> This commit removes /proc/cpuinfo parsing, and introduces instead a call
> to sched_getaffinity(), which is architecture-independant, in order to
> retrieve the list of CPU threads available to the current process and to
> count them.

This appears to be Linux-specific.  On non-Linux systems (e.g. FreeBSD,
Mac OS) I suggest using just _SC_NPROCESSORS_ONLN.

Thanks,

Ben.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to