[ovs-dev] [OVN Patch v14 1/3] ovn-libs: Add support for parallel processing

Ilya Maximets i.maximets at ovn.org
Thu Feb 25 15:18:28 UTC 2021


On 2/12/21 3:49 PM, Anton Ivanov wrote:
> This adds a set of functions and macros intended to process
> hashes in parallel.
> 
> The principles of operation are documented in the fasthmap.h
> 
> If these one day go into the OVS tree, the OVS tree versions
> would be used in preference.
> 
> Signed-off-by: Anton Ivanov <anton.ivanov at cambridgegreys.com>

Hi, Anton.  Not a full review, just one comment below.

> +static inline void wait_for_work(struct worker_control *control)
> +{
> +    sem_wait(control->fire);
> +}

Shouldn't we check the result of sem_wait?  If it failed with
EINTR we likely need to call it again, otherwise worker thread
might start working on the incomplete or uninitialized data
and crash.

We may also add assertion for EINVAL just to catch it earlier.

Best regards, Ilya Maximets.


More information about the dev mailing list