All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yang, Xiaowei" <xiaowei.yang@intel.com>
To: Keir Fraser <keir.fraser@eu.citrix.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: Memory allocation in NUMA system
Date: Fri, 25 Jul 2008 18:26:31 +0800	[thread overview]
Message-ID: <4889AA57.5010403@intel.com> (raw)
In-Reply-To: <C4AF4585.1B8DD%keir.fraser@eu.citrix.com>

Keir Fraser wrote:
> On 25/7/08 08:51, "Yang, Xiaowei" <xiaowei.yang@intel.com> wrote:
> 
>  >> How about by default we guarantee no more than 25% of a node's memory is
>  >> classed as 'DMA memory', and we reduce the DMA address width 
> variable in Xen
>  >> to ensure that?
>  >>
>  >> So, in your example, we would reduce dma_bitsize to 30.
>  >>
>  >>  -- Keir
>  >>
>  >>
>  > Yes, a good suggestion!
> 
> Indeed the only reason we still have dma_bitsize is to break the
> select-NUMA-node-first memory allocation search strategy. So tweaking the
> dma_bitsize approach further to strike the correct NUMA-vs-DMA balance does
> seem the right thing to do. Feel free to work up a patch.
> 
>  -- Keir
> 
> 
> 
How about this one?

diff -r 63317b6c3eab xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Mon Jul 14 15:21:03 2008 +0100
+++ b/xen/common/page_alloc.c	Fri Jul 25 18:24:16 2008 +0800
@@ -55,7 +55,7 @@
  /*
   * Bit width of the DMA heap.
   */
-static unsigned int dma_bitsize = CONFIG_DMA_BITSIZE;
+static unsigned int dma_bitsize;
  static void __init parse_dma_bits(char *s)
  {
      unsigned int v = simple_strtol(s, NULL, 0);
@@ -583,6 +583,16 @@
              init_heap_pages(pfn_dom_zone_type(i), mfn_to_page(i), 1);
      }

+    /* Reserve up to 25% of node0's memory for DMA */
+    if ( dma_bitsize == 0 )
+    {
+        dma_bitsize = 
pfn_dom_zone_type(NODE_DATA(0)->node_spanned_pages / 4)
+                      + PAGE_SHIFT;
+
+        ASSERT(dma_bitsize <= BITS_PER_LONG + PAGE_SHIFT);
+        ASSERT(dma_bitsize > PAGE_SHIFT + 1);
+    }
+
      printk("Domain heap initialised: DMA width %u bits\n", dma_bitsize);
  }
  #undef avail_for_domheap
diff -r 63317b6c3eab xen/include/asm-x86/config.h
--- a/xen/include/asm-x86/config.h	Mon Jul 14 15:21:03 2008 +0100
+++ b/xen/include/asm-x86/config.h	Fri Jul 25 18:24:16 2008 +0800
@@ -96,8 +96,6 @@

  /* Primary stack is restricted to 8kB by guard pages. */
  #define PRIMARY_STACK_SIZE 8192
-
-#define CONFIG_DMA_BITSIZE 32

  #define BOOT_TRAMPOLINE 0x8c000
  #define bootsym_phys(sym)                                 \


Thanks,
Xiaowei

  reply	other threads:[~2008-07-25 10:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-25  3:34 Memory allocation in NUMA system Yang, Xiaowei
2008-07-25  6:53 ` Keir Fraser
2008-07-25  7:22   ` Yang, Xiaowei
2008-07-25  7:27     ` Keir Fraser
2008-07-25  7:51       ` Yang, Xiaowei
2008-07-25  7:55         ` Keir Fraser
2008-07-25 10:26           ` Yang, Xiaowei [this message]
2008-07-25 12:56             ` Keir Fraser
2008-07-28 12:21               ` Andre Przywara
2008-07-28 12:38                 ` Keir Fraser
2008-07-28 14:26                   ` Andre Przywara
2008-07-28 14:53                     ` Keir Fraser

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=4889AA57.5010403@intel.com \
    --to=xiaowei.yang@intel.com \
    --cc=keir.fraser@eu.citrix.com \
    --cc=xen-devel@lists.xensource.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.