Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1499492

Summary: qemu_madvise doesn't support MADV_DONTDUMP
Product: Red Hat Enterprise Linux 7 Reporter: Mota Kardeh <mkardeh>
Component: qemu-kvm-rhevAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7.3CC: aarcange, chayang, coli, fdanapfe, hhuang, jinzhao, juzhang, knoel, michen, mkardeh, mtessun, pbonzini, riel, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-10-10 11:24:17 UTC 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: 1018952    
Attachments:
Description Flags
XML_KVM_for_SAP_Performance_testing none

Description Mota Kardeh 2017-10-07 22:32:06 UTC
Description of problem:

Hello,

I'm trying to strart the kvm on my machine and get the following error:

# virsh start <KVM-host>

error: internal error: process exited while connecting to monitor: qemu_madvise: Invalid argument
madvise doesn't support MADV_DONTDUMP, but dump_guest_core=off specified
2017-10-07T22:22:04.731784Z qemu-kvm: -object memory-backend-file,id=ram-node0,prealloc=yes,mem-path=/dev/hugepages/libvirt/qemu/2-ls3059v1,size=387352363008,host-nodes=0,policy=bind: cannot bind memory to host NUMA nodes: Invalid argument



Version-Release number of selected component (if applicable):

I'm using qemu-kvm-rhev 2.6.0-28.el7_3.12


Please help me to change the configuration or fix the bug ASAP. SAP is waiting for solution.

Thanks and best regards,
Motahareh Kardeh


​
Red Hat Software Engineer @ SAP LinuxLab
Email: mkardeh
Phone : +49 6227 761645

Comment 2 Mota Kardeh 2017-10-08 14:23:33 UTC
Hi,

the following part of the code has raised the error:

exec.c
------------------------------------------------------------------------
+static void qemu_ram_setup_dump(void *addr, ram_addr_t size)
+{
+    int ret;
+    QemuOpts *machine_opts;
+
+    /* Use MADV_DONTDUMP, if user doesn't want the guest memory in the core */
+    machine_opts = qemu_opts_find(qemu_find_opts("machine"), 0);
+    if (machine_opts &&
+        !qemu_opt_get_bool(machine_opts, "dump-guest-core", true)) {
+        ret = madvise(addr, size, MADV_DONTDUMP);
+        if (ret) {
+            perror("qemu_madvise");
+            fprintf(stderr, "madvise doesn't support MADV_DONTDUMP, "
+                            "but dump_guest_core=off specified\n");
+        }
+    }
+}
------------------------------------------------------------------------

Please also review and comment the function madvise_behavior_valid(int behavior) and send me the link to the unit test.

I think the bug is caused by missing documentation/wrong understanding or wrong implementation.


BR, Mota

Comment 3 Karen Noel 2017-10-09 02:01:25 UTC
Please provide the version of RHEL running on the host. Is it RHEL 7.3? 

In particular, what is the host kernel version? 

For completeness, please also provide the libvirt XML for this VM and the libvirt version. Thanks.

Comment 4 Mota Kardeh 2017-10-09 06:32:33 UTC
Created attachment 1336133 [details]
XML_KVM_for_SAP_Performance_testing

Comment 5 Mota Kardeh 2017-10-09 06:37:06 UTC
Yes, they are both RHEL 7.3.

Host and VM kernel versions are:

3.10.0-514.32.2.el7.x86_64 #1 SMP Mon Sep 11 05:36:21 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux

# libvirtd --version
libvirtd (libvirt) 3.2.0


I attached to the Bug the XML for VM:
XML_KVM_for_SAP_Performance_testing

More Info:

I'm using the following qemu versions:

- qemu-img-rhev 2.6.0-28.el7_3.12
- qemu-kvm-common-rhev 2.6.0-28.el7_3.12
- qemu-kvm-rhev 2.6.0-28.el7_3.12
- qemu-kvm-tools-rhev 2.6.0-28.el7_3.12


Thanks,
BR, Mota

Comment 6 Martin Tessun 2017-10-09 07:34:14 UTC
Hi Mota,

> memory-backend-file,id=ram-node0,prealloc=yes,mem-path=/dev/hugepages/
> libvirt/qemu/2-ls3059v1,size=387352363008,host-nodes=0,policy=bind: cannot
> bind memory to host NUMA nodes: Invalid argument

as already discussed in email, this error probably is related to your cmdline setting for disabling memory cgroups. As such the NUMA pinning can't be applied correctly.

Please remove the setting
  cgroup_disable=memory
from your kernel cmdline and try starting the VM again.

Thanks!
Martin

Comment 7 Martin Tessun 2017-10-09 11:28:22 UTC
(In reply to Martin Tessun from comment #6)
> Hi Mota,
> 
> > memory-backend-file,id=ram-node0,prealloc=yes,mem-path=/dev/hugepages/
> > libvirt/qemu/2-ls3059v1,size=387352363008,host-nodes=0,policy=bind: cannot
> > bind memory to host NUMA nodes: Invalid argument
> 
> as already discussed in email, this error probably is related to your
> cmdline setting for disabling memory cgroups. As such the NUMA pinning can't
> be applied correctly.
> 
> Please remove the setting
>   cgroup_disable=memory
> from your kernel cmdline and try starting the VM again.
> 
> Thanks!
> Martin

After doing the math correctly the error is quite obvious:
1. We have 1GB hugepages defined
2. We align 1443GB to a total of 4 Numa Nodes
3. As we distribute equally, we end up with 360.75GB per Numa Node.

So increasing the memory by 1GB and adjusting the NUMA Node memory to 361GB per cell, got the machine starting. So at least the last message could be solved this way and the VM does start now.

Comment 8 Mota Kardeh 2017-10-09 14:36:20 UTC
Hi All,

first of all my special thanks to Martin Tessun. He did a great job, great to have you in the team. 

After Martin has changed the NUMA configuration as he described, the VM is on running again and I can continue with the Performance testing.

We will adjust the "SAP HANA on KVM: Best Practices Resource Guide".

Thanks and best regards,
Mota

Comment 9 Karen Noel 2017-10-10 11:24:17 UTC
Closing as not a bug. If you feel otherwise, please reopen. Thanks!