Bug 1264187

Summary: ioprocess should set its cpu affinity
Product: [oVirt] ovirt-distribution Reporter: Nir Soffer <nsoffer>
Component: ioprocessAssignee: Oved Ourfali <oourfali>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Kubica <pkubica>
Severity: high Docs Contact:
Priority: unspecified    
Version: ioprocess-0.15.0CC: bazulay, bugs, dougsland, oourfali, smizrahi, ybronhei
Target Milestone: ovirt-3.6.1Flags: oourfali: ovirt-3.6.z?
rule-engine: planning_ack?
oourfali: devel_ack+
pstehlik: testing_ack+
Target Release: ioprocess-0.15.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ioprocess-0.15.0-4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-18 11:00:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nir Soffer 2015-09-17 19:02:03 UTC
Description of problem:

Vdsm is going to add cpu-affinity configuration, pinning vdsm to certain
cpus. Most likely, vdsm will be configured to run on single cpu, as
this much more efficient on machines with many cpus (see bug 1247075).

When vdsm is configured to use cpu-affinity, it reset the cpu affinity
of child processes, so they can run on any cpu, which may be more
efficient for the child process, or for the system, specially when there
are many cpus, and vdsm is overloaded.

Since ioprocess is not started from vdsm, but from its own python
library, vdsm cannot reset the cpu-affinity of ioprocess, and it run
with the same cpu-affinity as vdsm.

Here is an example run showing this issue. Vdsm was configured with
"cpu_affinity = 1", pinning to the second cpu.

# ps auxf
vdsm      4608  /usr/bin/python /usr/share/vdsm/vdsm
vdsm      5164   \_ /usr/libexec/ioprocess
vdsm      5171   \_ /usr/libexec/ioprocess
...
# taskset -p 4608
pid 4608's current affinity mask: 2
# taskset -p 5164
pid 5164's current affinity mask: 2
# taskset -p 5171
pid 5171's current affinity mask: 2

We like to reset the cpu affinity of ioprocess so it can run on any cpu.

Vdsm cpu affinity is going to be backported to ovirt 3.5, so we need this
feature in fedora 21 and 22.

Comment 1 Red Hat Bugzilla Rules Engine 2015-10-19 10:53:03 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 2 Yaniv Lavi 2015-10-29 12:34:10 UTC
In oVirt testing is done on single release by default. Therefore I'm removing the 4.0 flag. If you think this bug must be tested in 4.0 as well, please re-add the flag. Please note we might not have testing resources to handle the 4.0 clone.

Comment 4 Petr Kubica 2016-02-11 10:31:31 UTC
Verified in ioprocess-0.15.0-5
#ps auxf
vdsm     13866   /usr/bin/python /usr/share/vdsm/vdsm
vdsm     14601    \_ /usr/libexec/ioprocess --read-pipe-fd 54 --write-pipe-fd 53 --max-threads 10 --max-queued-requests 10

# taskset -p 13866
pid 13866's current affinity mask: 2
# taskset -p 14601
pid 14601's current affinity mask: ff