Commit 0d742ef4 authored by Robin Holt's avatar Robin Holt Committed by Tony Luck

[IA64-SGI] Distribute useage of BTE interfaces.

During peak utilization periods, the first interface on a node has
an inordinately large amount of contention.  This is due to all
cpus starting their scan for an interface at 0.  This patch distributes
that based upon the slice the requesting cpu is attached to.
 
Signed-off-by: Robin Holt
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent 8a1f00a8
...@@ -73,6 +73,7 @@ bte_result_t bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification) ...@@ -73,6 +73,7 @@ bte_result_t bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification)
unsigned long itc_end = 0; unsigned long itc_end = 0;
struct bteinfo_s *btes_to_try[MAX_INTERFACES_TO_TRY]; struct bteinfo_s *btes_to_try[MAX_INTERFACES_TO_TRY];
int bte_if_index; int bte_if_index;
int bte_pri, bte_sec;
BTE_PRINTK(("bte_copy(0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%p)\n", BTE_PRINTK(("bte_copy(0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%p)\n",
src, dest, len, mode, notification)); src, dest, len, mode, notification));
...@@ -85,24 +86,33 @@ bte_result_t bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification) ...@@ -85,24 +86,33 @@ bte_result_t bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification)
(src & L1_CACHE_MASK) || (dest & L1_CACHE_MASK)); (src & L1_CACHE_MASK) || (dest & L1_CACHE_MASK));
BUG_ON(!(len < ((BTE_LEN_MASK + 1) << L1_CACHE_SHIFT))); BUG_ON(!(len < ((BTE_LEN_MASK + 1) << L1_CACHE_SHIFT)));
/* CPU 0 (per node) tries bte0 first, CPU 1 try bte1 first */
if (cpuid_to_subnode(smp_processor_id()) == 0) {
bte_pri = 0;
bte_sec = 1;
} else {
bte_pri = 1;
bte_sec = 0;
}
if (mode & BTE_USE_DEST) { if (mode & BTE_USE_DEST) {
/* try remote then local */ /* try remote then local */
btes_to_try[0] = bte_if_on_node(NASID_GET(dest), 0); btes_to_try[0] = bte_if_on_node(NASID_GET(dest), bte_pri);
btes_to_try[1] = bte_if_on_node(NASID_GET(dest), 1); btes_to_try[1] = bte_if_on_node(NASID_GET(dest), bte_sec);
if (mode & BTE_USE_ANY) { if (mode & BTE_USE_ANY) {
btes_to_try[2] = bte_if_on_node(get_nasid(), 0); btes_to_try[2] = bte_if_on_node(get_nasid(), bte_pri);
btes_to_try[3] = bte_if_on_node(get_nasid(), 1); btes_to_try[3] = bte_if_on_node(get_nasid(), bte_sec);
} else { } else {
btes_to_try[2] = NULL; btes_to_try[2] = NULL;
btes_to_try[3] = NULL; btes_to_try[3] = NULL;
} }
} else { } else {
/* try local then remote */ /* try local then remote */
btes_to_try[0] = bte_if_on_node(get_nasid(), 0); btes_to_try[0] = bte_if_on_node(get_nasid(), bte_pri);
btes_to_try[1] = bte_if_on_node(get_nasid(), 1); btes_to_try[1] = bte_if_on_node(get_nasid(), bte_sec);
if (mode & BTE_USE_ANY) { if (mode & BTE_USE_ANY) {
btes_to_try[2] = bte_if_on_node(NASID_GET(dest), 0); btes_to_try[2] = bte_if_on_node(NASID_GET(dest), bte_pri);
btes_to_try[3] = bte_if_on_node(NASID_GET(dest), 1); btes_to_try[3] = bte_if_on_node(NASID_GET(dest), bte_sec);
} else { } else {
btes_to_try[2] = NULL; btes_to_try[2] = NULL;
btes_to_try[3] = NULL; btes_to_try[3] = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment