RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1380334 - s390utils-cpuplugd - cpuplugd daemon does not start on LPAR
Summary: s390utils-cpuplugd - cpuplugd daemon does not start on LPAR
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: s390utils
Version: 7.3
Hardware: s390x
OS: Linux
high
high
Target Milestone: rc
: 7.4
Assignee: Dan Horák
QA Contact: Vilém Maršík
URL:
Whiteboard:
Depends On: 1291892 1309628
Blocks: 1299988 1353018 1416831 1446211
TreeView+ depends on / blocked
 
Reported: 2016-09-29 10:32 UTC by Hendrik Brueckner
Modified: 2017-08-01 18:48 UTC (History)
17 users (show)

Fixed In Version: s390utils-1.23.0-29.el7
Doc Type: Bug Fix
Doc Text:
Clone Of: 1291892
Environment:
Last Closed: 2017-08-01 18:48:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
cpuplugd init script (2.35 KB, text/plain)
2016-09-29 11:16 UTC, Hanns-Joachim Uhl
no flags Details
patch to make cpuplugd startable in LPAR also (564 bytes, patch)
2016-10-18 09:10 UTC, IBM Bug Proxy
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
IBM Linux Technology Center 146983 0 None None None 2016-09-29 11:14:45 UTC
Red Hat Product Errata RHBA-2017:2045 0 normal SHIPPED_LIVE s390utils bug fix and enhancement update 2017-08-01 18:12:58 UTC

Description Hendrik Brueckner 2016-09-29 10:32:23 UTC
+++ This bug was initially created as a clone of Bug #1291892 +++

Comment 1 Hendrik Brueckner 2016-09-29 10:32:55 UTC
cpuplugd service failed to start on LPAR:

[root@s83lp68kvm ~]# systemctl status cpuplugd
? cpuplugd.service - LSB: Start the cpu and memory hotplug daemon for Linux on System z
   Loaded: loaded (/etc/rc.d/init.d/cpuplugd; bad; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:systemd-sysv-generator(8)
[root@s83lp68kvm ~]# systemctl start cpuplugd
Job for cpuplugd.service failed because the control process exited with error code. See "systemctl status cpuplugd.service" and "journalctl -xe" for details.
[root@s83lp68kvm ~]# systemctl status cpuplugd -l
? cpuplugd.service - LSB: Start the cpu and memory hotplug daemon for Linux on System z
   Loaded: loaded (/etc/rc.d/init.d/cpuplugd; bad; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2016-09-28 14:39:32 CEST; 30s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 2314 ExecStart=/etc/rc.d/init.d/cpuplugd start (code=exited, status=150)

Sep 28 14:39:32 s83lp68kvm systemd[1]: Starting LSB: Start the cpu and memory hotplug daemon for Linux on System z...
Sep 28 14:39:32 s83lp68kvm systemd[1]: cpuplugd.service: control process exited, code=exited status=150
Sep 28 14:39:32 s83lp68kvm systemd[1]: Failed to start LSB: Start the cpu and memory hotplug daemon for Linux on System z.
Sep 28 14:39:32 s83lp68kvm systemd[1]: Unit cpuplugd.service entered failed state.
Sep 28 14:39:32 s83lp68kvm systemd[1]: cpuplugd.service failed.
[root@s83lp68kvm ~]#

The problem is in the cpuplugd init script /etc/init.d/cpuplugd, which does not look like an init script for a service from the s390-tools package.
See the attached cpuplugd init script.
The problematic lines are:
    # explicitly load cmm module, needed for memory hotplug
    modprobe $module > /dev/null 2>&1 || exit 150

This modprobe will always fail on LPAR, and there is no error message for this in the init script to explain anything, which is very confusing.

Comment 4 Hanns-Joachim Uhl 2016-09-29 11:16:18 UTC
Created attachment 1205927 [details]
cpuplugd init script

Comment 7 IBM Bug Proxy 2016-10-18 09:10:42 UTC
------- Comment From thorsten.diehl.com 2016-10-18 05:05 EDT-------
I ran into this problem yesterday and found this bug already opened.

@Red Hat: Please consider my attached patch, which I already tested for
a) z/VM with successful load of cmm
b) z/VM with unsuccessful load of cmm
c) LPAR

Comment 8 IBM Bug Proxy 2016-10-18 09:10:49 UTC
Created attachment 1211645 [details]
patch to make cpuplugd startable in LPAR also

Comment 9 Dan Horák 2016-10-18 09:29:20 UTC
Hi Thorsten, thanks for the patch, it's how I intended to fix it. Could you please retry my version with "systemd-detect-virt" instead of grep? It's RHEL-7 and we can rely on systemd.

--- a/cpuplugd.initd
+++ b/cpuplugd.initd
@@ -32,8 +32,8 @@ start() {
     [ -f $config ] || exit 6
     [ `id -u` -eq 0 ] || exit 4
 
-    # explicitly load cmm module, needed for memory hotplug
-    modprobe $module > /dev/null 2>&1 || exit 150
+    # explicitly load cmm module on z/VM, needed for memory hotplug
+    [ `systemd-detect-virt` = 'zvm' ] && { modprobe $module > /dev/null 2>&1 || exit 150; }
 
     echo -n $"Starting $prog: "
     daemon $exec -c $config

Comment 10 IBM Bug Proxy 2016-10-18 09:31:43 UTC
------- Comment From geraldsc.com 2016-10-18 05:20 EDT-------
(In reply to comment #7)
> Created attachment 113096 [details]
> patch to make cpuplugd startable in LPAR also

I don't think it is correct to load the cmm module from the init script at all. It certainly is not correct to exit if module load fails, even on z/VM, because cmm is only needed for the memory hotplug (ballooning) rules of cpuplugd, and those rules are disabled by default. So, exiting when cmm cannot be loaded will also prevent the CPU hotplug feature, even if no memory hotplug rules will be used.

If anyone wants to use the MEM(UN)PLUG rules, the cmm module needs to be loaded manually upfront, as described in the documentation. The only way to do this correctly from the init script would be to parse the cpuplugd config file and check for the MEM(UN)PLUG rules, and of course also the z/VM check as in this patch, but I don't think it is worth the effort.

So I would suggest to simply remove the cmm module loading code from the init script, or at least remove the "exit 150" and just try to load it silently, maybe with the z/VM check as done in this patch.

Comment 11 Dan Horák 2016-10-18 09:52:24 UTC
I have two questions
- what are drawbacks if the CMM module is loaded and not used?
- shouldn't the cpuplugd daemon itself load the module if its config contains any memory hotplug rules?

For RHEL we want a conservative approach, but we can experiment with a better solution in Fedora using latest upstream s390-tools.

Comment 12 IBM Bug Proxy 2016-10-18 09:53:36 UTC
------- Comment From brueckner.com 2016-10-18 05:52 EDT-------
(In reply to comment #9)
> Hi Thorsten, thanks for the patch, it's how I intended to fix it. Could you
> please retry my version with "systemd-detect-virt" instead of grep? It's
> RHEL-7 and we can rely on systemd.
>
> --- a/cpuplugd.initd
> +++ b/cpuplugd.initd
> @@ -32,8 +32,8 @@ start() {
> [ -f $config ] || exit 6
> [ `id -u` -eq 0 ] || exit 4
>
> -    # explicitly load cmm module, needed for memory hotplug
> -    modprobe $module > /dev/null 2>&1 || exit 150
> +    # explicitly load cmm module on z/VM, needed for memory hotplug
> +    [ `systemd-detect-virt` = 'zvm' ] && { modprobe $module > /dev/null
> 2>&1 || exit 150; }
>
> echo -n $"Starting $prog: "
> daemon $exec -c $config

Another idea what be to load the cmm module outside the context of the cpuplugd using systemd'd module loading as described in:

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sec-Persistent_Module_Loading.html

Comment 13 Dan Horák 2016-10-18 10:09:31 UTC
(In reply to IBM Bug Proxy from comment #12)
> ------- Comment From brueckner.com 2016-10-18 05:52 EDT-------
> (In reply to comment #9)
> > Hi Thorsten, thanks for the patch, it's how I intended to fix it. Could you
> > please retry my version with "systemd-detect-virt" instead of grep? It's
> > RHEL-7 and we can rely on systemd.
> >
> > --- a/cpuplugd.initd
> > +++ b/cpuplugd.initd
> > @@ -32,8 +32,8 @@ start() {
> > [ -f $config ] || exit 6
> > [ `id -u` -eq 0 ] || exit 4
> >
> > -    # explicitly load cmm module, needed for memory hotplug
> > -    modprobe $module > /dev/null 2>&1 || exit 150
> > +    # explicitly load cmm module on z/VM, needed for memory hotplug
> > +    [ `systemd-detect-virt` = 'zvm' ] && { modprobe $module > /dev/null
> > 2>&1 || exit 150; }
> >
> > echo -n $"Starting $prog: "
> > daemon $exec -c $config
> 
> Another idea what be to load the cmm module outside the context of the
> cpuplugd using systemd'd module loading as described in:
> 
> https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/
> html/System_Administrators_Guide/sec-Persistent_Module_Loading.html

but this is unconditional load if I read it correctly, another option could be load by udev like the SCSI sg module or create a special systemd unit that would be a dependency of the cpluplugd service or ...

Comment 14 IBM Bug Proxy 2016-10-18 10:40:59 UTC
------- Comment From geraldsc.com 2016-10-18 06:36 EDT-------
(In reply to comment #11)
> I have two questions
> - what are drawbacks if the CMM module is loaded and not used?
> - shouldn't the cpuplugd daemon itself load the module if its config
> contains any memory hotplug rules?
> For RHEL we want a conservative approach, but we can experiment with a
> better solution in Fedora using latest upstream s390-tools.

There are no drawbacks if the CMM module is loaded and not used. The only issue that we have here is the "exit 150", which prevents normal CPU hotplug operation on LPAR (and also on z/VM, if for any reason the load would fail there). So an unconditional (and unchecked) load from the init script seems like the easiest way to go.

Not sure why we decided not to load the module from the daemon itself, but it "works as designed" and documented. It probably was considered to be something that can be done easily outside the daemon.

Comment 15 IBM Bug Proxy 2016-10-18 11:20:25 UTC
------- Comment From thorsten.diehl.com 2016-10-18 07:18 EDT-------
(In reply to comment #9)
> Hi Thorsten, thanks for the patch, it's how I intended to fix it. Could you
> please retry my version with "systemd-detect-virt" instead of grep? It's
> RHEL-7 and we can rely on systemd.
> --- a/cpuplugd.initd
> +++ b/cpuplugd.initd
> @@ -32,8 +32,8 @@ start() {
> [ -f $config ] || exit 6
> [ `id -u` -eq 0 ] || exit 4
>
> -    # explicitly load cmm module, needed for memory hotplug
> -    modprobe $module > /dev/null 2>&1 || exit 150
> +    # explicitly load cmm module on z/VM, needed for memory hotplug
> +    [ `systemd-detect-virt` = 'zvm' ] && { modprobe $module > /dev/null
> 2>&1 || exit 150; }
>
> echo -n $"Starting $prog: "
> daemon $exec -c $config

Hi Dan,

verified, this works the same way, as expected.

Reading the other discussions, it's (for sure) up to you how to implement a solution. I have no preference at the moment.

Comment 16 IBM Bug Proxy 2016-12-27 18:30:30 UTC
------- Comment From ruddk.com 2016-12-27 13:22 EDT-------
This bug appears to have fallen between the cracks.  Did this ever get resolved in an official update?

Comment 17 Dan Horák 2017-01-02 12:20:28 UTC
(In reply to IBM Bug Proxy from comment #16)
> ------- Comment From ruddk.com 2016-12-27 13:22 EDT-------
> This bug appears to have fallen between the cracks.  Did this ever get
> resolved in an official update?

The fix is planned for 7.4.

Comment 18 Hanns-Joachim Uhl 2017-01-26 14:55:33 UTC
fyi ... a related bugzilla is now also open for RHEL6.8 in
LTC bug 1416831 - RHEL6.8 - cpuplugd failed to start on LPAR (s390utils/s390-tools) ...

Comment 20 IBM Bug Proxy 2017-05-04 14:40:36 UTC
------- Comment From Irina.Yashina1.com 2017-05-04 10:39 EDT-------
The fix was verified in RHEL7.4 Alpha, cpuplugd successfully started on LPAR.
The problem has been solved, thank you.

Comment 21 Vilém Maršík 2017-05-04 15:25:06 UTC
Verified by partner. Patch confirmed in GIT (the one from Comment #9, not the version from the attachment). Setting verified.

Comment 22 errata-xmlrpc 2017-08-01 18:48:48 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2045


Note You need to log in before you can comment on or make changes to this bug.