Bug 2078552

Summary: [ovn-northd] Add an explicit command line option to control lflow build parallelization.
Product: Red Hat Enterprise Linux Fast Datapath Reporter: Dumitru Ceara <dceara>
Component: OVNAssignee: xsimonar
Status: POST --- QA Contact: Ehsan Elahi <eelahi>
Severity: medium Docs Contact:
Priority: medium    
Version: FDP 22.CCC: ctrautma, dcbw, jiji, surya, xsimonar
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2067388    

Description Dumitru Ceara 2022-04-25 15:30:48 UTC
Description of problem:

It's currently possible to enable northd lflow build parallelization by
setting the NB.NB_Global.Options:use_parallel_build option to true in
the Northbound database.

If that gets toggled to "true" ovn-northd will by default determine the
number of CPUs and NUMAs available in the system and based on that
decide if it will actually enable parallelization and with how many
worker threads.

When running upstream self tests we sometimes "trick" ovn-northd into
believing that it runs on a single-NUMA node with 4 available CPUs:

https://github.com/ovn-org/ovn/blob/a0ded8874865d999ac9e8204c6affa4a5fd70699/tests/ovn-macros.at#L174

While the same approach might be used by a CMS to force ovn-northd to
use a given number of threads, it's probably better to have an explicit
command line argument to configure the number of threads ovn-northd
should use.

For example something like:

ovn-northd ... --n-threads=<VALUE> ..

To avoid confusion this should probably be made the only officially
supported way of enabling northd parallelization.  That means that:

- NB_Global.Options.use_parallel_build should become obsolete and be
  ignored by ovn-northd
- --dummy-numa should not have an effect on the number of worker
  threads ovn-northd spawns for lflow build parallelization

Additionally, it would be helpful if an appctl command would be added to
ovn-northd to allow users to dynamically change the number of threads
(and potentially disable) parallelization at runtime.  E.g.:

ovn-appctl -t ovn-northd parallel-build/n-threads <VALUE>

Comment 2 Dan Williams 2022-05-25 17:20:06 UTC
v5 was accepted upstream for 22.06 and later: http://patchwork.ozlabs.org/project/ovn/patch/20220519112017.1162522-1-xsimonar@redhat.com/