xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Tim Deegan <tim@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Julien Grall <julien.grall@arm.com>
Subject: Re: [PATCH 1/2] page-alloc/x86: don't restrict DMA heap to node 0
Date: Wed, 10 Aug 2016 10:58:28 +0100	[thread overview]
Message-ID: <a1cb3c85-44fe-096f-b42c-ab2ed691aff7@citrix.com> (raw)
In-Reply-To: <57AB0EAE020000780010494F@prv-mh.provo.novell.com>

On 10/08/16 10:23, Jan Beulich wrote:
> --- a/xen/arch/x86/numa.c
> +++ b/xen/arch/x86/numa.c
> @@ -355,11 +355,21 @@ void __init init_cpu_to_node(void)
>      }
>  }
>  
> -EXPORT_SYMBOL(cpu_to_node);
> -EXPORT_SYMBOL(node_to_cpumask);
> -EXPORT_SYMBOL(memnode_shift);
> -EXPORT_SYMBOL(memnodemap);
> -EXPORT_SYMBOL(node_data);
> +unsigned int __init arch_get_dma_bitsize(void)
> +{
> +    unsigned int node;
> +
> +    for_each_online_node(node)
> +        if ( node_spanned_pages(node) &&
> +             !(node_start_pfn(node) >> (32 - PAGE_SHIFT)) )
> +            break;
> +    if ( node >= MAX_NUMNODES )
> +        panic("No node with memory below 4Gb");
> +
> +    return min_t(unsigned int,
> +                 flsl(node_start_pfn(node) + node_spanned_pages(node) / 4 - 1)
> +                 + PAGE_SHIFT, 32);

You have moved the -1 and -2 inside the flsl() call, which alters its
behaviour quite a bit.  Is this intentional or accidental?

~Andrew

> +}
>  
>  static void dump_numa(unsigned char key)
>  {
> --- a/xen/common/page_alloc.c
> +++ b/xen/common/page_alloc.c
> @@ -1368,16 +1368,7 @@ void __init end_boot_allocator(void)
>      init_heap_pages(virt_to_page(bootmem_region_list), 1);
>  
>      if ( !dma_bitsize && (num_online_nodes() > 1) )
> -    {
> -#ifdef CONFIG_X86
> -        dma_bitsize = min_t(unsigned int,
> -                            flsl(NODE_DATA(0)->node_spanned_pages) - 1
> -                            + PAGE_SHIFT - 2,
> -                            32);
> -#else
> -        dma_bitsize = 32;
> -#endif
> -    }
> +        dma_bitsize = arch_get_dma_bitsize();
>  
>      printk("Domain heap initialised");
>      if ( dma_bitsize )


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-08-10  9:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-10  9:17 [PATCH 0/2] NUMA/x86 related adjustments Jan Beulich
2016-08-10  9:23 ` [PATCH 1/2] page-alloc/x86: don't restrict DMA heap to node 0 Jan Beulich
2016-08-10  9:58   ` Andrew Cooper [this message]
2016-08-10 10:21     ` Jan Beulich
2016-08-10 12:18       ` Andrew Cooper
2016-08-10 12:50         ` Jan Beulich
2016-08-11 10:44         ` [PATCH v2 " Jan Beulich
2016-08-11 10:45           ` Andrew Cooper
2016-08-11  9:53   ` [PATCH " Julien Grall
2016-08-11 10:05     ` Jan Beulich
2016-08-10  9:24 ` [PATCH 2/2] x86/NUMA: cleanup Jan Beulich
2016-08-10 10:35   ` Andrew Cooper
2016-08-10 11:47     ` Jan Beulich
2016-08-16 10:02       ` Dario Faggioli

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=a1cb3c85-44fe-096f-b42c-ab2ed691aff7@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).