Debian: qat1.7.l driver package build uses a single CPU and builds the driver twice

Bug #1989601 reported by M. Vefa Bicakci
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
M. Vefa Bicakci

Bug Description

Brief Description
-----------------
The Debian build for the QAT device driver uses a single CPU and builds the driver twice due to the following reasons:

The build makefile snippet (debian/rules) calls "make" directly instead of calling "$(MAKE)". The latter allows inheriting the parent make instance's parallel-job settings, but the former does not. This translates to the build system using a single CPU to build the driver. To fix this issue, the following:

  override_dh_auto_build:
          make
          make sample-all

should be replaced with:

  override_dh_auto_build:
          $(MAKE)
          $(MAKE) sample-all

Finally, the debian/rules makefile snippet does not disable the dh_auto_test hook (it does not override this hook). This causes the build system to call "make -j1 check VERBOSE=1" after the main build, but this rebuilds the whole driver one more time, also using a single CPU, due to the use of "-j1" and due to the apparent fact that the "check" target is recognized by the QAT driver's makefiles as another target to rebuild everything. Quoting from the driver's Makefile.in:

  ALL_TARGETS = qat-driver-all quickassist-all adf-rl-all adf-ctl-all qat-service-all
  ...
  check-am: all-am
  check: check-am
  all-am: Makefile config.h all-local
  ...
  all-local: $(ALL_TARGETS)

The resolution of this issue is to define an override for dh_auto_test (in the debian/rules file) that does nothing:

override_dh_auto_test:
       true

Severity
--------
Minor: The identified issues increase the build time by about 13~14 minutes (~ 2 x 7 minutes, because of the standard and preempt-rt variants of the driver build). This is admittedly a minor build optimization issue.

Note
----
I did not fill out the full bug report template. This bug report exists just so that I can publish a commit fixing this issue.

Changed in starlingx:
assignee: nobody → M. Vefa Bicakci (vbicakci)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kernel (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/kernel/+/857741

Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kernel (master)

Reviewed: https://review.opendev.org/c/starlingx/kernel/+/857741
Committed: https://opendev.org/starlingx/kernel/commit/0d091fe7207497c4b7444e420c2da0d56f5cf306
Submitter: "Zuul (22348)"
Branch: master

commit 0d091fe7207497c4b7444e420c2da0d56f5cf306
Author: M. Vefa Bicakci <email address hidden>
Date: Tue Sep 13 21:22:17 2022 +0000

    kernel-modules/qat17: Debian: Increase build speed

    Modify the debian/rules file belonging to the qat device driver so that
    the build lets child make instances use make's job server by calling
    $(MAKE) instead of "make" in the debian/rules file. This allows the
    child make process to utilize more than one CPU.

    Also, remove the call to dh_auto_test during the build by defining a
    make target named "override_dh_auto_test". Allowing dh_auto_test to be
    called makes the Debian build system call "make -j1 check VERBOSE=1".
    However, in the QAT driver's "Makefile.in", the "check" target
    indirectly depends on the "all-local" target, which in turn rebuilds all
    of the code. All this to say, this issue causes driver to be built one
    more time, this time in single-job mode (due to the -j1).

    Below are the durations of builds carried out in a 12-CPU virtual
    machine:

    Without this commit:
      Build needed 00:09:24, 315160k disk space

    With $(MAKE) instead of make:
      Build needed 00:05:04, 321484k disk space

    With $(MAKE) instead of make and with override_dh_auto_test:
      Build needed 00:02:33, 321928k disk space

    Verification
    - "build-pkgs -c -p qat1.7.l" continues to work, but takes a lot less
      time to finish.

    Closes-Bug: 1989601
    Change-Id: I825e0f482ad9a73f9b78c087ca3c7bb57a37f4bd
    Signed-off-by: M. Vefa Bicakci <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Low
tags: added: stx.8.0 stx.debian stx.distro.other
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.