Skip to content

Upgrade irqbalance to 1.9.5 and add patches to fix ENOSPC handling#16746

Open
suresh-thelkar wants to merge 2 commits into3.0-devfrom
sthelkar/irqbalance-work
Open

Upgrade irqbalance to 1.9.5 and add patches to fix ENOSPC handling#16746
suresh-thelkar wants to merge 2 commits into3.0-devfrom
sthelkar/irqbalance-work

Conversation

@suresh-thelkar
Copy link
Copy Markdown
Contributor

@suresh-thelkar suresh-thelkar commented Apr 20, 2026

Merge Checklist

All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)

  • The toolchain has been rebuilt successfully (or no changes were made to it)
  • The toolchain/worker package manifests are up-to-date
  • Any updated packages successfully build (or no packages were changed)
  • Packages depending on static components modified in this PR (Golang, *-static subpackages, etc.) have had their Release tag incremented.
  • Package tests (%check section) have been verified with RUN_CHECK=y for existing SPEC files, or added to new SPEC files
  • All package sources are available
  • cgmanifest files are up-to-date and sorted (./cgmanifest.json, ./toolkit/scripts/toolchain/cgmanifest.json, .github/workflows/cgmanifest.json)
  • LICENSE-MAP files are up-to-date (./LICENSES-AND-NOTICES/SPECS/data/licenses.json, ./LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md, ./LICENSES-AND-NOTICES/SPECS/LICENSE-EXCEPTIONS.PHOTON)
  • All source files have up-to-date hashes in the *.signatures.json files
  • sudo make go-tidy-all and sudo make go-test-coverage pass
  • Documentation has been updated to match any changes to the build system
  • Ready to merge

Summary

What does the PR accomplish, why was it needed?

  • Upgraded irqbalance from 1.9.3 → 1.9.5 and updated the source tarball hash in SPECS/irqbalance/irqbalance.signatures.json.
  • Dropped the now-unneeded IRQBALANCE_ARGS env patch since it’s covered upstream.
  • Added an upstream backport patch to improve behavior under interrupt vector exhaustion (ENOSPC): slot-aware placement (penalize low “slots_left” CPUs) and a fallback mechanism that retries within the configured balance_level scope instead of blacklisting/giving up immediately. These are the changes that I have already contributed to upstream.
  • Packaging cleanup: remove unintended %{_prefix}/etc artifacts from the staged install root to avoid shipping config under /usr/etc (SPECS/irqbalance/irqbalance.spec).
Change Log
  • NA
Does this affect the toolchain?

NO

Associated issues
  • #xxxx
Links to CVEs
  • NA
Test Methodology

@microsoft-github-policy-service microsoft-github-policy-service Bot added Packaging 3.0-dev PRs Destined for AzureLinux 3.0 labels Apr 20, 2026
@suresh-thelkar suresh-thelkar force-pushed the sthelkar/irqbalance-work branch from a6c9ee9 to b448d36 Compare April 20, 2026 04:22
@suresh-thelkar suresh-thelkar marked this pull request as ready for review April 20, 2026 05:03
@suresh-thelkar suresh-thelkar requested a review from a team as a code owner April 20, 2026 05:03
@suresh-thelkar
Copy link
Copy Markdown
Contributor Author

@microsoft/cbl-mariner-stable-maintainers, Could you please help review this PR? We are planning to include it in the upcoming monthly release, hence requesting a priority review.

@kgodara912
Copy link
Copy Markdown
Contributor

Buddy build after recent force push.

@suresh-thelkar suresh-thelkar marked this pull request as draft April 27, 2026 09:45
@suresh-thelkar
Copy link
Copy Markdown
Contributor Author

Marking this PR as a draft for now to test an edge case identified which does not come in normal scenarios.

@suresh-thelkar suresh-thelkar force-pushed the sthelkar/irqbalance-work branch from b448d36 to 6bf2d09 Compare April 28, 2026 07:11
@suresh-thelkar
Copy link
Copy Markdown
Contributor Author

Buddy build results after the recent push to GitHub are given below.
https://dev.azure.com/mariner-org/mariner/_build/results?buildId=1104229&view=results

@suresh-thelkar suresh-thelkar marked this pull request as ready for review April 28, 2026 09:48
@suresh-thelkar
Copy link
Copy Markdown
Contributor Author

Note on PR Checks: One of the ptests for libguestfs is failing, which is a known issue and not related to irqbalance.

Copy link
Copy Markdown
Contributor

@kgodara912 kgodara912 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patch matched with both the upstream merged PRs of irqbalancer. The analysis of patch with AI says that the patch is good. The extra changes are few corner cases in original patch and are accepted at upstream quickly. Buddy build is successful.

@suresh-thelkar
Copy link
Copy Markdown
Contributor Author

Patch matched with both the upstream merged PRs of irqbalancer. The analysis of patch with AI says that the patch is good. The extra changes are few corner cases in original patch and are accepted at upstream quickly. Buddy build is successful.

thanks for the review and sign off.

Comment thread SPECS/irqbalance/irqbalance.spec Outdated

%install
make DESTDIR=%{buildroot} install
rm -rf %{buildroot}%{_prefix}/etc
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question(blocking): Could you double-check the generated irqbalance.service in the built RPM? In 1.9.5, upstream’s service template uses EnvironmentFile=@pkgconfdir@/irqbalance.env, and pkgconfdir appears to default to $prefix/etc/default (/usr/etc/default with --prefix=/usr). This
PR then removes %{buildroot}%{_prefix}/etc and installs the env file as /etc/sysconfig/irqbalance.

I’m worried the final unit may require /usr/etc/default/irqbalance.env while the RPM only ships /etc/sysconfig/irqbalance, which could make the service fail to start. The old sed for /path/to/irqbalance.env may no longer match 1.9.5.

Copy link
Copy Markdown
Contributor Author

@suresh-thelkar suresh-thelkar Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question(blocking): Could you double-check the generated irqbalance.service in the built RPM? In 1.9.5, upstream’s service template uses EnvironmentFile=@pkgconfdir@/irqbalance.env, and pkgconfdir appears to default to $prefix/etc/default (/usr/etc/default with --prefix=/usr). This PR then removes %{buildroot}%{_prefix}/etc and installs the env file as /etc/sysconfig/irqbalance.

I’m worried the final unit may require /usr/etc/default/irqbalance.env while the RPM only ships /etc/sysconfig/irqbalance, which could make the service fail to start. The old sed for /path/to/irqbalance.env may no longer match 1.9.5.

Thanks for the review and catching this. Modified the spec file to fix this packaging issue at the configure step instead of post-install:

  • Pass --with-pkgconfdir=%{_sysconfdir}/sysconfig and --sysconfdir=%{_sysconfdir} so configure substitutes @pkgconfdir@/etc/sysconfig directly in the unit. Nothing ever lands under /usr/etc, so the rm -rf %{buildroot}%{_prefix}/etc is gone.
  • Replaced the obsolete /path/to/irqbalance.env sed with one that matches the actual 1.9.5 substituted path (/etc/sysconfig/irqbalance.env/etc/sysconfig/irqbalance), keeping the historical env file path for upgrade compatibility.
  • Install the unit manually (make install skips it when pkg-config can't resolve systemdsystemunitdir).

Also verified the following after installing the RPM and once again completed all the testing. Everything went well.

sthelkar@TDC4164394045 [ /workspace/AfterUpstrmMerge ]$  rpm -q irqbalance
irqbalance-1.9.5-1.azl3.x86_64
sthelkar@TDC4164394045 [ /workspace/AfterUpstrmMerge ]$ sudo systemctl restart irqbalance
sthelkar@TDC4164394045 [ /workspace/AfterUpstrmMerge ]$ systemctl is-active irqbalance
active
sthelkar@TDC4164394045 [ /workspace/AfterUpstrmMerge ]$ sudo journalctl -u irqbalance -b --no-pager
Apr 30 05:14:54 TDC4164394045 systemd[1]: Started irqbalance.service - irqbalance daemon.
Apr 30 05:31:42 TDC4164394045 systemd[1]: Stopping irqbalance.service - irqbalance daemon...
Apr 30 05:31:42 TDC4164394045 systemd[1]: irqbalance.service: Deactivated successfully.
Apr 30 05:31:42 TDC4164394045 systemd[1]: Stopped irqbalance.service - irqbalance daemon.
Apr 30 05:31:42 TDC4164394045 systemd[1]: Started irqbalance.service - irqbalance daemon.

Service starts cleanly, no EnvironmentFile not found or non-absolute-path warnings.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've once again ran the buddy build. Here are the results -
https://dev.azure.com/mariner-org/mariner/_build/results?buildId=1106074&view=results

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@christopherco, I've addressed your comments. Can you please take a look at the latest commit and let me know if you have any further feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.0-dev PRs Destined for AzureLinux 3.0 Packaging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants