lkml.org 
[lkml]   [2023]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [Patch v4 12/18] KVM: x86/mmu: Allocate NUMA aware page tables on TDP huge page splits
On Thu, Mar 23, 2023 at 3:15 PM David Matlack <dmatlack@google.com> wrote:
>
> On Mon, Mar 06, 2023 at 02:41:21PM -0800, Vipin Sharma wrote:
> > +
> > +void *kvm_mmu_get_free_page(gfp_t gfp, int nid)
> > +{
> > +#ifdef CONFIG_NUMA
>
> Is this #ifdef necessary? alloc_pages_node() is defined regardless of
> CONFIG_NUMA.
>

It is not necessary. Only advantage will be skipping the if()
condition check. I will remove it.

> > + struct page *page;
> > +
> > + if (nid != NUMA_NO_NODE) {
> > + page = alloc_pages_node(nid, gfp, 0);
> > + if (!page)
> > + return (void *)0;
> > + return page_address(page);
> > + }
> > +#endif /* CONFIG_NUMA */
> > + return (void *)__get_free_page(gfp);
> > +}
> > +

\
 
 \ /
  Last update: 2023-03-28 19:13    [W:0.108 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site