Skip to contentSkip to conversation

Linux KSM not compiled in (MADV_MERGEABLE always undef)

Qemu-devel Walter Haidinger 1 participant 4 messages Dec 9, 2010 – Dec 13, 2010

lore
Share & tools
lore
#0 lore raw

Public bug reported:

Linux KSM support is not enabled because MADV_MERGEABLE remains undefined.
It seems that asm-generic/mman-common.h is not included. Maybe some kind of header dependency problem?

Adding
#include <asm-generic/mman-common.h>
to exec.c of qemu-kvm-0.13.0 enables use of KSM and values change in /sys/kernel/mm/ksm/.

Tested under CentOS 5.5 with custom kernel 2.6.32.26 and OpenSUSE 11.2 with custom kernel 2.6.36.1, both x86_64 platform. Please note that I configure with--kerneldir=/lib/modules/2.6.../build and even --extra-cflags="-I/lib/modules/2.6.../build/include".

** Affects: qemu
Importance: Undecided
Status: New

Signature · 20 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/687733

Title:
  Linux KSM not compiled in (MADV_MERGEABLE always undef)

Status in QEMU:
  New

Bug description:
  Linux KSM support is not enabled because MADV_MERGEABLE remains undefined.
It seems that asm-generic/mman-common.h is not included. Maybe some kind of header dependency problem?

Adding 
#include <asm-generic/mman-common.h>
to exec.c of qemu-kvm-0.13.0 enables use of KSM and values change in /sys/kernel/mm/ksm/.

Tested under CentOS 5.5 with custom kernel 2.6.32.26 and OpenSUSE 11.2 with custom kernel 2.6.36.1, both x86_64 platform.
Please note that I configure with--kerneldir=/lib/modules/2.6.../build and even --extra-cflags="-I/lib/modules/2.6.../build/include".
#1 lore raw

To clarify: custom kernel == vanilla Linux kernel, i.e. not distribution kernel.

Signature · 20 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/687733

Title:
  Linux KSM not compiled in (MADV_MERGEABLE always undef)

Status in QEMU:
  New

Bug description:
  Linux KSM support is not enabled because MADV_MERGEABLE remains undefined.
It seems that asm-generic/mman-common.h is not included. Maybe some kind of header dependency problem?

Adding 
#include <asm-generic/mman-common.h>
to exec.c of qemu-kvm-0.13.0 enables use of KSM and values change in /sys/kernel/mm/ksm/.

Tested under CentOS 5.5 with custom kernel 2.6.32.26 and OpenSUSE 11.2 with custom kernel 2.6.36.1, both x86_64 platform.
Please note that I configure with--kerneldir=/lib/modules/2.6.../build and even --extra-cflags="-I/lib/modules/2.6.../build/include".
author
#2 lore raw
In reply to Walter Haidinger

Not a qemu bug. madvise and (associated constants via sys/mman.h) are supplied by glibc. You need to update your C library.

** Changed in: qemu
Status: New => Invalid

Signature · 20 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/687733

Title:
  Linux KSM not compiled in (MADV_MERGEABLE always undef)

Status in QEMU:
  Invalid

Bug description:
  Linux KSM support is not enabled because MADV_MERGEABLE remains undefined.
It seems that asm-generic/mman-common.h is not included. Maybe some kind of header dependency problem?

Adding 
#include <asm-generic/mman-common.h>
to exec.c of qemu-kvm-0.13.0 enables use of KSM and values change in /sys/kernel/mm/ksm/.

Tested under CentOS 5.5 with custom kernel 2.6.32.26 and OpenSUSE 11.2 with custom kernel 2.6.36.1, both x86_64 platform.
Please note that I configure with--kerneldir=/lib/modules/2.6.../build and even --extra-cflags="-I/lib/modules/2.6.../build/include".
#3 lore raw
In reply to Walter Haidinger

I see. Never considered a glibc header dependency. In fact, I thought that having at least kernel 2.6.32 and recent qemu-kvm would suffice...

How about an "--enable-ksm" configure option which checks and requires MADV_MERGABLE to be defined? That way, people (like me) would notice instead of having qemu silently not using KSM at all.

Especially if the "fix" to make it "just work" on older distributions is as simple as here by just including the required header file.

Signature · 20 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/687733

Title:
  Linux KSM not compiled in (MADV_MERGEABLE always undef)

Status in QEMU:
  Invalid

Bug description:
  Linux KSM support is not enabled because MADV_MERGEABLE remains undefined.
It seems that asm-generic/mman-common.h is not included. Maybe some kind of header dependency problem?

Adding 
#include <asm-generic/mman-common.h>
to exec.c of qemu-kvm-0.13.0 enables use of KSM and values change in /sys/kernel/mm/ksm/.

Tested under CentOS 5.5 with custom kernel 2.6.32.26 and OpenSUSE 11.2 with custom kernel 2.6.36.1, both x86_64 platform.
Please note that I configure with--kerneldir=/lib/modules/2.6.../build and even --extra-cflags="-I/lib/modules/2.6.../build/include".