* A question about numa_set_membind()
@ 2012-06-03 3:45 Wei Chen
2012-06-03 18:31 ` Andi Kleen
0 siblings, 1 reply; 3+ messages in thread
From: Wei Chen @ 2012-06-03 3:45 UTC (permalink / raw)
To: linux-numa
Dear all,
Recently I am confused about numa_set_membind() for global arrays. If
we have a global array and later we call numa_set_membind() in our
code, will that global array be set to the node specified by the
nodemask_t. As I know, global array is allocated in the global data
area by the compiler before program executes. So I wonder whether
numa_set_membind() affects global variables and how. Besides, I would
like to know if there is one global data area for each node or all
memory only share one global data area. If all memory only share one
global data area, how to decide the distance between each node and the
global data area?
Thank you. I am looking forward to hearing from you.
Best regards,
Chen
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: A question about numa_set_membind()
2012-06-03 3:45 A question about numa_set_membind() Wei Chen
@ 2012-06-03 18:31 ` Andi Kleen
2012-06-04 1:45 ` Wei Chen
0 siblings, 1 reply; 3+ messages in thread
From: Andi Kleen @ 2012-06-03 18:31 UTC (permalink / raw)
To: Wei Chen; +Cc: linux-numa
On Sun, Jun 03, 2012 at 12:45:07PM +0900, Wei Chen wrote:
> Dear all,
>
> Recently I am confused about numa_set_membind() for global arrays. If
> we have a global array and later we call numa_set_membind() in our
> code, will that global array be set to the node specified by the
> nodemask_t. As I know, global array is allocated in the global data
> area by the compiler before program executes. So I wonder whether
> numa_set_membind() affects global variables and how. Besides, I would
> like to know if there is one global data area for each node or all
> memory only share one global data area. If all memory only share one
> global data area, how to decide the distance between each node and the
> global data area?
The memory of the global array is only faulted in at first touch.
That is when the memory policy takes affect.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: A question about numa_set_membind()
2012-06-03 18:31 ` Andi Kleen
@ 2012-06-04 1:45 ` Wei Chen
0 siblings, 0 replies; 3+ messages in thread
From: Wei Chen @ 2012-06-04 1:45 UTC (permalink / raw)
To: Andi Kleen; +Cc: linux-numa
Thank you for your reply, Andi. You mean that the memory for the
global array won't be allocated until the program runs and first
accesses the array, right? So how about ordinary global variable like
"int sum;"? Is it the same with the array, faulted in at first touch?
Thank you.
Best regards,
Chen
On Mon, Jun 4, 2012 at 3:31 AM, Andi Kleen <andi@firstfloor.org> wrote:
> On Sun, Jun 03, 2012 at 12:45:07PM +0900, Wei Chen wrote:
>> Dear all,
>>
>> Recently I am confused about numa_set_membind() for global arrays. If
>> we have a global array and later we call numa_set_membind() in our
>> code, will that global array be set to the node specified by the
>> nodemask_t. As I know, global array is allocated in the global data
>> area by the compiler before program executes. So I wonder whether
>> numa_set_membind() affects global variables and how. Besides, I would
>> like to know if there is one global data area for each node or all
>> memory only share one global data area. If all memory only share one
>> global data area, how to decide the distance between each node and the
>> global data area?
>
>
> The memory of the global array is only faulted in at first touch.
> That is when the memory policy takes affect.
>
> -Andi
>
> --
> ak@linux.intel.com -- Speaking for myself only.
--
Wei Chen
平治齊修正誠致格
天國家身心意知物
下
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-06-04 1:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-03 3:45 A question about numa_set_membind() Wei Chen
2012-06-03 18:31 ` Andi Kleen
2012-06-04 1:45 ` Wei Chen
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).