From: David Matlack <dmatlack@google.com>
To: Vipin Sharma <vipinsh@google.com>
Cc: bgardon@google.com, seanjc@google.com, pbonzini@redhat.com,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [Patch v2 2/2] KVM: x86/mmu: Allocate page table pages on NUMA node of underlying pages
Date: Thu, 8 Dec 2022 16:27:57 -0800 [thread overview]
Message-ID: <Y5KBDXzPFw3PaSVD@google.com> (raw)
In-Reply-To: <20221201195718.1409782-3-vipinsh@google.com>
On Thu, Dec 01, 2022 at 11:57:18AM -0800, Vipin Sharma wrote:
> Page table pages of a VM are currently allocated based on the current
> task's NUMA node or its mempolicy. This can cause suboptimal remote
> accesses by the vCPU if it is accessing physical pages local to its NUMA
> node but the page table pages mapping those physcal pages were created
> by some other vCPU which was on different NUMA node or had different
> policy.
>
> Allocate page table pages on the same NUMA node where underlying
> physical page exists. Page table at level 5, 4, and 3 might not end up
> on the same NUMA node as they can span multiple NUMA nodes.
>
> Signed-off-by: Vipin Sharma <vipinsh@google.com>
> ---
...
> @@ -6284,13 +6326,16 @@ static int shadow_mmu_try_split_huge_page(struct kvm *kvm,
> gfn = kvm_mmu_page_get_gfn(huge_sp, spte_index(huge_sptep));
> level = huge_sp->role.level;
> spte = *huge_sptep;
> + nid = kvm_pfn_to_refcounted_page_nid(spte_to_pfn(spte));
> + if (nid == NUMA_NO_NODE)
> + nid = numa_mem_id();
What do you think about renaming kvm_pfn_to_refcounted_page_nid() to
kvm_pfn_to_page_table_nid() and having it return numa_mem_id() instead
of NUMA_NO_NODE (with a comment)? I think that will clean up this patch
quite a bit by getting rid of all the NUMA_NO_NODE checks.
next prev parent reply other threads:[~2022-12-09 0:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-01 19:57 [Patch v2 0/2] NUMA aware page table allocation Vipin Sharma
2022-12-01 19:57 ` [Patch v2 1/2] KVM: x86/mmu: Allocate page table pages on TDP splits during dirty log enable on the underlying page's numa node Vipin Sharma
2022-12-05 18:24 ` Ben Gardon
2022-12-05 18:47 ` Sean Christopherson
2022-12-05 18:51 ` Ben Gardon
2022-12-05 21:07 ` Sean Christopherson
2022-12-08 22:44 ` Vipin Sharma
2022-12-01 19:57 ` [Patch v2 2/2] KVM: x86/mmu: Allocate page table pages on NUMA node of underlying pages Vipin Sharma
2022-12-05 18:17 ` Ben Gardon
2022-12-05 23:40 ` Vipin Sharma
2022-12-06 18:17 ` Ben Gardon
[not found] ` <CAHVum0f_6UQvcqWAJxDJyL_LN-6ryAXNuh9xY6nFtLxCOMtoXA@mail.gmail.com>
[not found] ` <CANgfPd-XkHPZyFsPe75WbUrufLpKtdr1Neri1JrrApQrjRLRJw@mail.gmail.com>
[not found] ` <CAHVum0dkKSY9e90xgfBVBHUqntwJOmONK+TYBXFEwg6acvUrAw@mail.gmail.com>
2022-12-07 19:05 ` Vipin Sharma
2022-12-09 0:06 ` David Matlack
2022-12-09 18:47 ` Vipin Sharma
2022-12-09 0:27 ` David Matlack [this message]
2022-12-09 18:51 ` Vipin Sharma
2022-12-09 0:21 ` [Patch v2 0/2] NUMA aware page table allocation David Matlack
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=Y5KBDXzPFw3PaSVD@google.com \
--to=dmatlack@google.com \
--cc=bgardon@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=vipinsh@google.com \
/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.