locked
NUMA and code memory RRS feed

  • Question

  • The problem is this: If I have a machine with multiple NUMA nodes (in my case there are 8 nodes) running a single OS instance (windows server 2008 R2) and start an application: In which NUMA node is the code loaded.

    In addition. If I run a single process with threads on all cores, it there any way to control where the code for each memory is loaded (obviously I want the code loaded on the same node as the thread is running).

    And what about Kernel32 and and alike. From what I understand they are shared between processes but if so are they always loaded on a specific NUMA node.

    I can seem to find any information about this and there seems to be no way to for example instruct LoadLibrary where I want the code loaded. Would appriciate is someone could explain or direct me to any information available about this.

    Friday, December 10, 2010 12:03 PM

Answers

  • Hi eriohl

    You will find a great blog on that matter here: http://code.msdn.microsoft.com/64plusLP

    There is a sample code that will show how to allocate memory close certain NUMA nodes..

    Thanks

    Ameen


    mameen
    • Proposed as answer by Dana Groff Monday, December 13, 2010 5:51 AM
    • Marked as answer by Dana Groff Tuesday, February 1, 2011 9:08 AM
    Saturday, December 11, 2010 1:37 AM

All replies

  • As I understand it: According to documentation the default behaviour of memory allocation is to try to allocate memory from the node the allocating thread is running on.

    If so and this applies to code as well then the obvious way to control this would be to start a process with processor affinity set to run on only a specific node and it I want to run an application on multiple nodes I would need to run it in multiple processes.

    Friday, December 10, 2010 12:20 PM
  • Hi eriohl

    You will find a great blog on that matter here: http://code.msdn.microsoft.com/64plusLP

    There is a sample code that will show how to allocate memory close certain NUMA nodes..

    Thanks

    Ameen


    mameen
    • Proposed as answer by Dana Groff Monday, December 13, 2010 5:51 AM
    • Marked as answer by Dana Groff Tuesday, February 1, 2011 9:08 AM
    Saturday, December 11, 2010 1:37 AM