Re: [PATCH] kvmtool: ARM: madvise mergeable and hugepage separately

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 08/08/16 08:01, Stefan Agner wrote:
> The madvise behavior is not a bit field and hence can not be or'ed.
> Also madvise_behavior_valid checks the flag using a case statement
> hence only one behavior is supposed to be supplied. Call madvise
> twice, once for MERGEABLE and once for HUGEPAGE.

thanks for that catch! Indeed we are only setting HUGEPAGE right now,
dropping MERGEABLE due to the OR'ing.

Acked-by: Andre Przywara <andre.przywara@xxxxxxx>

Cheers,
Andre.

> 
> Signed-off-by: Stefan Agner <stefan@xxxxxxxx>
> ---
>  arm/kvm.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/arm/kvm.c b/arm/kvm.c
> index ce40897..3cfa90a 100644
> --- a/arm/kvm.c
> +++ b/arm/kvm.c
> @@ -80,7 +80,10 @@ void kvm__arch_init(struct kvm *kvm, const char *hugetlbfs_path, u64 ram_size)
>  					SZ_2M);
>  
>  	madvise(kvm->arch.ram_alloc_start, kvm->arch.ram_alloc_size,
> -		MADV_MERGEABLE | MADV_HUGEPAGE);
> +		MADV_MERGEABLE);
> +
> +	madvise(kvm->arch.ram_alloc_start, kvm->arch.ram_alloc_size,
> +		MADV_HUGEPAGE);
>  
>  	/* Create the virtual GIC. */
>  	if (gic__create(kvm, kvm->cfg.arch.irqchip))
> 
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux