Thread (17 messages) 17 messages, 5 authors, 2017-07-05

Re: [PATCH 1/1] blk-mq: map all HWQ also in hyperthreaded system

From: Max Gurtovoy <hidden>
Date: 2017-06-28 15:09:34
Also in: linux-nvme


On 6/28/2017 5:58 PM, Sagi Grimberg wrote:
quoted
+static int cpu_to_queue_index(unsigned int nr_queues, const int cpu,
+                  const struct cpumask *online_mask)
  {
-    return cpu * nr_queues / nr_cpus;
+    /*
+     * Non online CPU will be mapped to queue index 0.
+     */
+    if (!cpumask_test_cpu(cpu, online_mask))
+        return 0;
Why not map offline cpus to what they would've map to if they were
online?
I didn't change logic for offline cpu's.
Should it be done in this patch ?
quoted
+        if (cpu < nr_queues) {
+            map[cpu] = cpu_to_queue_index(nr_queues, cpu, online_mask);
+        } else {
+            first_sibling = get_first_sibling(cpu);
+            if (first_sibling == cpu)
+                map[cpu] = cpu_to_queue_index(nr_queues, cpu,
online_mask);
This seems to be the only reference to online_mask left (on each side of
the if statement. I think you can just not pass it and use
cpu_online_mask in cpu_to_queue_index.
Another user of cpu_to_queue_index may want to send different mask.
Currently it's a static function so I guess we can do it.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help