From: Alexander Graf <agraf@suse.de>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: benh@kernel.crashing.org, paulus@samba.org,
linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org,
kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: PPC: BOOK3S: HV: Don't try to allocate from kernel page allocator for hash page tab
Date: Mon, 05 May 2014 11:26:16 +0000 [thread overview]
Message-ID: <53677558.50900@suse.de> (raw)
In-Reply-To: <1399224322-22028-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
On 05/04/2014 07:25 PM, Aneesh Kumar K.V wrote:
> We reserve 5% of total ram for CMA allocation and not using that can
> result in us running out of numa node memory with specific
> configuration. One caveat is we may not have node local hpt with pinned
> vcpu configuration. But currently libvirt also pins the vcpu to cpuset
> after creating hash page table.
I don't understand the problem. Can you please elaborate?
Alex
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> ---
> arch/powerpc/kvm/book3s_64_mmu_hv.c | 23 ++++++-----------------
> 1 file changed, 6 insertions(+), 17 deletions(-)
>
> diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c
> index fb25ebc0af0c..f32896ffd784 100644
> --- a/arch/powerpc/kvm/book3s_64_mmu_hv.c
> +++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c
> @@ -52,7 +52,7 @@ static void kvmppc_rmap_reset(struct kvm *kvm);
>
> long kvmppc_alloc_hpt(struct kvm *kvm, u32 *htab_orderp)
> {
> - unsigned long hpt;
> + unsigned long hpt = 0;
> struct revmap_entry *rev;
> struct page *page = NULL;
> long order = KVM_DEFAULT_HPT_ORDER;
> @@ -64,22 +64,11 @@ long kvmppc_alloc_hpt(struct kvm *kvm, u32 *htab_orderp)
> }
>
> kvm->arch.hpt_cma_alloc = 0;
> - /*
> - * try first to allocate it from the kernel page allocator.
> - * We keep the CMA reserved for failed allocation.
> - */
> - hpt = __get_free_pages(GFP_KERNEL | __GFP_ZERO | __GFP_REPEAT |
> - __GFP_NOWARN, order - PAGE_SHIFT);
> -
> - /* Next try to allocate from the preallocated pool */
> - if (!hpt) {
> - VM_BUG_ON(order < KVM_CMA_CHUNK_ORDER);
> - page = kvm_alloc_hpt(1 << (order - PAGE_SHIFT));
> - if (page) {
> - hpt = (unsigned long)pfn_to_kaddr(page_to_pfn(page));
> - kvm->arch.hpt_cma_alloc = 1;
> - } else
> - --order;
> + VM_BUG_ON(order < KVM_CMA_CHUNK_ORDER);
> + page = kvm_alloc_hpt(1 << (order - PAGE_SHIFT));
> + if (page) {
> + hpt = (unsigned long)pfn_to_kaddr(page_to_pfn(page));
> + kvm->arch.hpt_cma_alloc = 1;
> }
>
> /* Lastly try successively smaller sizes from the page allocator */
WARNING: multiple messages have this Message-ID (diff)
From: Alexander Graf <agraf@suse.de>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: paulus@samba.org, linuxppc-dev@lists.ozlabs.org,
kvm-ppc@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: PPC: BOOK3S: HV: Don't try to allocate from kernel page allocator for hash page table.
Date: Mon, 05 May 2014 13:26:16 +0200 [thread overview]
Message-ID: <53677558.50900@suse.de> (raw)
In-Reply-To: <1399224322-22028-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
On 05/04/2014 07:25 PM, Aneesh Kumar K.V wrote:
> We reserve 5% of total ram for CMA allocation and not using that can
> result in us running out of numa node memory with specific
> configuration. One caveat is we may not have node local hpt with pinned
> vcpu configuration. But currently libvirt also pins the vcpu to cpuset
> after creating hash page table.
I don't understand the problem. Can you please elaborate?
Alex
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> ---
> arch/powerpc/kvm/book3s_64_mmu_hv.c | 23 ++++++-----------------
> 1 file changed, 6 insertions(+), 17 deletions(-)
>
> diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c
> index fb25ebc0af0c..f32896ffd784 100644
> --- a/arch/powerpc/kvm/book3s_64_mmu_hv.c
> +++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c
> @@ -52,7 +52,7 @@ static void kvmppc_rmap_reset(struct kvm *kvm);
>
> long kvmppc_alloc_hpt(struct kvm *kvm, u32 *htab_orderp)
> {
> - unsigned long hpt;
> + unsigned long hpt = 0;
> struct revmap_entry *rev;
> struct page *page = NULL;
> long order = KVM_DEFAULT_HPT_ORDER;
> @@ -64,22 +64,11 @@ long kvmppc_alloc_hpt(struct kvm *kvm, u32 *htab_orderp)
> }
>
> kvm->arch.hpt_cma_alloc = 0;
> - /*
> - * try first to allocate it from the kernel page allocator.
> - * We keep the CMA reserved for failed allocation.
> - */
> - hpt = __get_free_pages(GFP_KERNEL | __GFP_ZERO | __GFP_REPEAT |
> - __GFP_NOWARN, order - PAGE_SHIFT);
> -
> - /* Next try to allocate from the preallocated pool */
> - if (!hpt) {
> - VM_BUG_ON(order < KVM_CMA_CHUNK_ORDER);
> - page = kvm_alloc_hpt(1 << (order - PAGE_SHIFT));
> - if (page) {
> - hpt = (unsigned long)pfn_to_kaddr(page_to_pfn(page));
> - kvm->arch.hpt_cma_alloc = 1;
> - } else
> - --order;
> + VM_BUG_ON(order < KVM_CMA_CHUNK_ORDER);
> + page = kvm_alloc_hpt(1 << (order - PAGE_SHIFT));
> + if (page) {
> + hpt = (unsigned long)pfn_to_kaddr(page_to_pfn(page));
> + kvm->arch.hpt_cma_alloc = 1;
> }
>
> /* Lastly try successively smaller sizes from the page allocator */
WARNING: multiple messages have this Message-ID (diff)
From: Alexander Graf <agraf@suse.de>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: benh@kernel.crashing.org, paulus@samba.org,
linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org,
kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: PPC: BOOK3S: HV: Don't try to allocate from kernel page allocator for hash page table.
Date: Mon, 05 May 2014 13:26:16 +0200 [thread overview]
Message-ID: <53677558.50900@suse.de> (raw)
In-Reply-To: <1399224322-22028-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
On 05/04/2014 07:25 PM, Aneesh Kumar K.V wrote:
> We reserve 5% of total ram for CMA allocation and not using that can
> result in us running out of numa node memory with specific
> configuration. One caveat is we may not have node local hpt with pinned
> vcpu configuration. But currently libvirt also pins the vcpu to cpuset
> after creating hash page table.
I don't understand the problem. Can you please elaborate?
Alex
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> ---
> arch/powerpc/kvm/book3s_64_mmu_hv.c | 23 ++++++-----------------
> 1 file changed, 6 insertions(+), 17 deletions(-)
>
> diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c
> index fb25ebc0af0c..f32896ffd784 100644
> --- a/arch/powerpc/kvm/book3s_64_mmu_hv.c
> +++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c
> @@ -52,7 +52,7 @@ static void kvmppc_rmap_reset(struct kvm *kvm);
>
> long kvmppc_alloc_hpt(struct kvm *kvm, u32 *htab_orderp)
> {
> - unsigned long hpt;
> + unsigned long hpt = 0;
> struct revmap_entry *rev;
> struct page *page = NULL;
> long order = KVM_DEFAULT_HPT_ORDER;
> @@ -64,22 +64,11 @@ long kvmppc_alloc_hpt(struct kvm *kvm, u32 *htab_orderp)
> }
>
> kvm->arch.hpt_cma_alloc = 0;
> - /*
> - * try first to allocate it from the kernel page allocator.
> - * We keep the CMA reserved for failed allocation.
> - */
> - hpt = __get_free_pages(GFP_KERNEL | __GFP_ZERO | __GFP_REPEAT |
> - __GFP_NOWARN, order - PAGE_SHIFT);
> -
> - /* Next try to allocate from the preallocated pool */
> - if (!hpt) {
> - VM_BUG_ON(order < KVM_CMA_CHUNK_ORDER);
> - page = kvm_alloc_hpt(1 << (order - PAGE_SHIFT));
> - if (page) {
> - hpt = (unsigned long)pfn_to_kaddr(page_to_pfn(page));
> - kvm->arch.hpt_cma_alloc = 1;
> - } else
> - --order;
> + VM_BUG_ON(order < KVM_CMA_CHUNK_ORDER);
> + page = kvm_alloc_hpt(1 << (order - PAGE_SHIFT));
> + if (page) {
> + hpt = (unsigned long)pfn_to_kaddr(page_to_pfn(page));
> + kvm->arch.hpt_cma_alloc = 1;
> }
>
> /* Lastly try successively smaller sizes from the page allocator */
next prev parent reply other threads:[~2014-05-05 11:26 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-04 17:25 [PATCH] KVM: PPC: BOOK3S: HV: Don't try to allocate from kernel page allocator for hash page table Aneesh Kumar K.V
2014-05-04 17:37 ` Aneesh Kumar K.V
2014-05-04 17:25 ` Aneesh Kumar K.V
2014-05-05 11:26 ` Alexander Graf [this message]
2014-05-05 11:26 ` Alexander Graf
2014-05-05 11:26 ` Alexander Graf
2014-05-05 14:35 ` Aneesh Kumar K.V
2014-05-05 14:47 ` [PATCH] KVM: PPC: BOOK3S: HV: Don't try to allocate from kernel page allocator for hash page tab Aneesh Kumar K.V
2014-05-05 14:35 ` [PATCH] KVM: PPC: BOOK3S: HV: Don't try to allocate from kernel page allocator for hash page table Aneesh Kumar K.V
2014-05-05 15:16 ` [PATCH] KVM: PPC: BOOK3S: HV: Don't try to allocate from kernel page allocator for hash page tab Alexander Graf
2014-05-05 15:16 ` [PATCH] KVM: PPC: BOOK3S: HV: Don't try to allocate from kernel page allocator for hash page table Alexander Graf
2014-05-05 15:16 ` Alexander Graf
2014-05-05 15:40 ` Aneesh Kumar K.V
2014-05-05 15:52 ` [PATCH] KVM: PPC: BOOK3S: HV: Don't try to allocate from kernel page allocator for hash page tab Aneesh Kumar K.V
2014-05-05 15:40 ` [PATCH] KVM: PPC: BOOK3S: HV: Don't try to allocate from kernel page allocator for hash page table Aneesh Kumar K.V
2014-05-06 0:06 ` [PATCH] KVM: PPC: BOOK3S: HV: Don't try to allocate from kernel page allocator for hash page tab Benjamin Herrenschmidt
2014-05-06 0:06 ` [PATCH] KVM: PPC: BOOK3S: HV: Don't try to allocate from kernel page allocator for hash page table Benjamin Herrenschmidt
2014-05-06 0:06 ` Benjamin Herrenschmidt
2014-05-06 7:05 ` [PATCH] KVM: PPC: BOOK3S: HV: Don't try to allocate from kernel page allocator for hash page tab Alexander Graf
2014-05-06 7:05 ` [PATCH] KVM: PPC: BOOK3S: HV: Don't try to allocate from kernel page allocator for hash page table Alexander Graf
2014-05-06 7:05 ` Alexander Graf
2014-05-06 7:19 ` [PATCH] KVM: PPC: BOOK3S: HV: Don't try to allocate from kernel page allocator for hash page tab Benjamin Herrenschmidt
2014-05-06 7:19 ` [PATCH] KVM: PPC: BOOK3S: HV: Don't try to allocate from kernel page allocator for hash page table Benjamin Herrenschmidt
2014-05-06 7:19 ` Benjamin Herrenschmidt
2014-05-06 7:21 ` [PATCH] KVM: PPC: BOOK3S: HV: Don't try to allocate from kernel page allocator for hash page tab Alexander Graf
2014-05-06 7:21 ` [PATCH] KVM: PPC: BOOK3S: HV: Don't try to allocate from kernel page allocator for hash page table Alexander Graf
2014-05-06 7:21 ` Alexander Graf
2014-05-06 14:20 ` Aneesh Kumar K.V
2014-05-06 14:32 ` [PATCH] KVM: PPC: BOOK3S: HV: Don't try to allocate from kernel page allocator for hash page tab Aneesh Kumar K.V
2014-05-06 14:20 ` [PATCH] KVM: PPC: BOOK3S: HV: Don't try to allocate from kernel page allocator for hash page table Aneesh Kumar K.V
2014-05-06 14:25 ` [PATCH] KVM: PPC: BOOK3S: HV: Don't try to allocate from kernel page allocator for hash page tab Alexander Graf
2014-05-06 14:25 ` [PATCH] KVM: PPC: BOOK3S: HV: Don't try to allocate from kernel page allocator for hash page table Alexander Graf
2014-05-06 14:25 ` Alexander Graf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53677558.50900@suse.de \
--to=agraf@suse.de \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.