Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1281654 > unrolled thread

[PATCH] blk-mq: Avoid memoryless numa node encoded in hctx numa_node

Started byRaghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
First post2015-12-02 12:30 +0100
Last post2015-12-03 18:00 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] blk-mq: Avoid memoryless numa node encoded in hctx numa_node Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com> - 2015-12-02 12:30 +0100
    Re: [PATCH] blk-mq: Avoid memoryless numa node encoded in hctx  numa_node Sagi Grimberg <sagig@dev.mellanox.co.il> - 2015-12-03 11:10 +0100
    Re: [PATCH] blk-mq: Avoid memoryless numa node encoded in hctx  numa_node Jens Axboe <axboe@kernel.dk> - 2015-12-03 18:00 +0100

#1281654 — [PATCH] blk-mq: Avoid memoryless numa node encoded in hctx numa_node

FromRaghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
Date2015-12-02 12:30 +0100
Subject[PATCH] blk-mq: Avoid memoryless numa node encoded in hctx numa_node
Message-ID<qBdLI-6vD-17@gated-at.bofh.it>
In architecture like powerpc, we can have cpus without any local memory
attached to it (a.k.a memoryless nodes). In such cases cpu to node mapping
can result in memory allocation hints for block hctx->numa_node populated
with node values which does not have real memory.

Instead use local_memory_node(), which is guaranteed to have memory.
local_memory_node is a noop in other architectures that does not support
memoryless nodes.

Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
---
 block/blk-mq-cpumap.c | 2 +-
 block/blk-mq.c        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

 Validated the patch on a memoryless node powerpc system.

diff --git a/block/blk-mq-cpumap.c b/block/blk-mq-cpumap.c
index 8764c24..d0634bc 100644
--- a/block/blk-mq-cpumap.c
+++ b/block/blk-mq-cpumap.c
@@ -113,7 +113,7 @@ int blk_mq_hw_queue_to_node(unsigned int *mq_map, unsigned int index)
 
 	for_each_possible_cpu(i) {
 		if (index == mq_map[i])
-			return cpu_to_node(i);
+			return local_memory_node(cpu_to_node(i));
 	}
 
 	return NUMA_NO_NODE;
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 6ada3b4..74be735 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1794,7 +1794,7 @@ static void blk_mq_init_cpu_queues(struct request_queue *q,
 		 * not, we remain on the home node of the device
 		 */
 		if (nr_hw_queues > 1 && hctx->numa_node == NUMA_NO_NODE)
-			hctx->numa_node = cpu_to_node(i);
+			hctx->numa_node = local_memory_node(cpu_to_node(i));
 	}
 }
 
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1282891 — Re: [PATCH] blk-mq: Avoid memoryless numa node encoded in hctx numa_node

FromSagi Grimberg <sagig@dev.mellanox.co.il>
Date2015-12-03 11:10 +0100
SubjectRe: [PATCH] blk-mq: Avoid memoryless numa node encoded in hctx numa_node
Message-ID<qByZP-3zg-7@gated-at.bofh.it>
In reply to#1281654
Looks good,

Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1283189 — Re: [PATCH] blk-mq: Avoid memoryless numa node encoded in hctx numa_node

FromJens Axboe <axboe@kernel.dk>
Date2015-12-03 18:00 +0100
SubjectRe: [PATCH] blk-mq: Avoid memoryless numa node encoded in hctx numa_node
Message-ID<qBFoC-7HE-5@gated-at.bofh.it>
In reply to#1281654
On 12/02/2015 04:29 AM, Raghavendra K T wrote:
> In architecture like powerpc, we can have cpus without any local memory
> attached to it (a.k.a memoryless nodes). In such cases cpu to node mapping
> can result in memory allocation hints for block hctx->numa_node populated
> with node values which does not have real memory.
>
> Instead use local_memory_node(), which is guaranteed to have memory.
> local_memory_node is a noop in other architectures that does not support
> memoryless nodes.

Applied for 4.5, thanks.

-- 
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web