[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4D5C4FD7.5070603@kernel.org>
Date: Wed, 16 Feb 2011 14:29:43 -0800
From: Yinghai Lu <yinghai@...nel.org>
To: Cyrill Gorcunov <gorcunov@...il.com>
CC: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...e.hu>,
"H. Peter Anvin" <hpa@...or.com>, Tejun Heo <tj@...nel.org>,
David Rientjes <rientjes@...gle.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86, numa: seperate alloc_numa_distance from numa_reset_distance.
On 02/16/2011 01:44 PM, Cyrill Gorcunov wrote:
> On 02/16/2011 11:57 PM, Yinghai Lu wrote:
>>
>> alloc code is much bigger the setting self.
>>
> ...
>> +
>> + numa_distance = __va(phys);
>> + numa_distance_cnt = cnt;
>> +
>> + /* fill with the default distances */
>> + for (i = 0; i< cnt; i++)
>> + for (j = 0; j< cnt; j++)
>> + numa_distance[i * cnt + j] = i == j ?
>> + LOCAL_DISTANCE : REMOTE_DISTANCE;
>> + printk(KERN_DEBUG "NUMA: Initialized distance table, cnt=%d\n",
>> cnt);
>> +}
>> +
>
> Hi Yinghai, btw would it be convenient to use node_distance() helper here
> (since this snippet is touched anyway and there is a big merging of numa
> code), ie
>
> /* fill with the default distances */
> for (i = 0; i < cnt; i++)
> for (j = 0; j < cnt; j++)
> numa_distance[i * cnt + j] = node_distance(i, j);
>
> though it should be patch on top of yours to not mix with plain code move
do you mean
int __node_distance(int from, int to)
{
if (from >= numa_distance_cnt || to >= numa_distance_cnt)
return from == to ? LOCAL_DISTANCE : REMOTE_DISTANCE;
return numa_distance[from * numa_distance_cnt + to];
}
EXPORT_SYMBOL(__node_distance);
or node_distance()?
then you will have
numa_distance[i * cnt + j] = numa_distance[i * cnt + j];
...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists