All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] nvme-fabrics: use default value for nr_io_queues setting
@ 2018-06-24 15:49 Max Gurtovoy
  2018-06-24 16:01 ` Sagi Grimberg
  0 siblings, 1 reply; 6+ messages in thread
From: Max Gurtovoy @ 2018-06-24 15:49 UTC (permalink / raw)


We set default value for nr_io_queues to be num_online_cpus(). No need
to call num_online_cpus() again since we can use the default value we
set earlier.

Signed-off-by: Max Gurtovoy <maxg at mellanox.com>
---
 drivers/nvme/host/fabrics.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index 903eb45..fbfb1ba 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -708,7 +708,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
 			}
 
 			opts->nr_io_queues = min_t(unsigned int,
-					num_online_cpus(), token);
+					opts->nr_io_queues, token);
 			break;
 		case NVMF_OPT_KATO:
 			if (match_int(args, &token)) {
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 1/1] nvme-fabrics: use default value for nr_io_queues setting
  2018-06-24 15:49 [PATCH 1/1] nvme-fabrics: use default value for nr_io_queues setting Max Gurtovoy
@ 2018-06-24 16:01 ` Sagi Grimberg
  2018-06-24 16:06   ` Max Gurtovoy
  0 siblings, 1 reply; 6+ messages in thread
From: Sagi Grimberg @ 2018-06-24 16:01 UTC (permalink / raw)



> We set default value for nr_io_queues to be num_online_cpus(). No need
> to call num_online_cpus() again since we can use the default value we
> set earlier.

We should not override user arguments. plus num_online_cpus can change
from X to 1 and back to X...

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/1] nvme-fabrics: use default value for nr_io_queues setting
  2018-06-24 16:01 ` Sagi Grimberg
@ 2018-06-24 16:06   ` Max Gurtovoy
  2018-06-24 16:16     ` Sagi Grimberg
  0 siblings, 1 reply; 6+ messages in thread
From: Max Gurtovoy @ 2018-06-24 16:06 UTC (permalink / raw)




On 6/24/2018 7:01 PM, Sagi Grimberg wrote:
> 
>> We set default value for nr_io_queues to be num_online_cpus(). No need
>> to call num_online_cpus() again since we can use the default value we
>> set earlier.
> 
> We should not override user arguments. plus num_online_cpus can change
> from X to 1 and back to X...

but we set "opts->nr_io_queues = num_online_cpus();" in the beginning of 
nvmf_parse_options function.

I just don't want to call num_online_cpus() twice in the same function..

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/1] nvme-fabrics: use default value for nr_io_queues setting
  2018-06-24 16:06   ` Max Gurtovoy
@ 2018-06-24 16:16     ` Sagi Grimberg
  2018-06-24 16:44       ` Max Gurtovoy
  0 siblings, 1 reply; 6+ messages in thread
From: Sagi Grimberg @ 2018-06-24 16:16 UTC (permalink / raw)



>>> We set default value for nr_io_queues to be num_online_cpus(). No need
>>> to call num_online_cpus() again since we can use the default value we
>>> set earlier.
>>
>> We should not override user arguments. plus num_online_cpus can change
>> from X to 1 and back to X...
> 
> but we set "opts->nr_io_queues = num_online_cpus();" in the beginning of 
> nvmf_parse_options function.

I misread this and thought that this was in the rdma transport, sorry.

I assume that still theoretically it can change during parse_options.
What is this needed again? Wouldn't it be better to remove it (or bound
it with num_possible_cpus) and have the transport clamp down to
num_online_cpus?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/1] nvme-fabrics: use default value for nr_io_queues setting
  2018-06-24 16:16     ` Sagi Grimberg
@ 2018-06-24 16:44       ` Max Gurtovoy
  2018-06-24 17:00         ` Sagi Grimberg
  0 siblings, 1 reply; 6+ messages in thread
From: Max Gurtovoy @ 2018-06-24 16:44 UTC (permalink / raw)




On 6/24/2018 7:16 PM, Sagi Grimberg wrote:
> 
>>>> We set default value for nr_io_queues to be num_online_cpus(). No need
>>>> to call num_online_cpus() again since we can use the default value we
>>>> set earlier.
>>>
>>> We should not override user arguments. plus num_online_cpus can change
>>> from X to 1 and back to X...
>>
>> but we set "opts->nr_io_queues = num_online_cpus();" in the beginning 
>> of nvmf_parse_options function.
> 
> I misread this and thought that this was in the rdma transport, sorry.
> 
> I assume that still theoretically it can change during parse_options.
> What is this needed again? Wouldn't it be better to remove it (or bound
> it with num_possible_cpus) and have the transport clamp down to
> num_online_cpus?
> 
> 

The transport clamp it. I just noticed we set it twice by calling 
num_online_cpus() in case we connect with --nr-io-queues options instead 
of using the cached value.
If you're ok with this we can leave it "as is".

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/1] nvme-fabrics: use default value for nr_io_queues setting
  2018-06-24 16:44       ` Max Gurtovoy
@ 2018-06-24 17:00         ` Sagi Grimberg
  0 siblings, 0 replies; 6+ messages in thread
From: Sagi Grimberg @ 2018-06-24 17:00 UTC (permalink / raw)



>>>>> We set default value for nr_io_queues to be num_online_cpus(). No need
>>>>> to call num_online_cpus() again since we can use the default value we
>>>>> set earlier.
>>>>
>>>> We should not override user arguments. plus num_online_cpus can change
>>>> from X to 1 and back to X...
>>>
>>> but we set "opts->nr_io_queues = num_online_cpus();" in the beginning 
>>> of nvmf_parse_options function.
>>
>> I misread this and thought that this was in the rdma transport, sorry.
>>
>> I assume that still theoretically it can change during parse_options.
>> What is this needed again? Wouldn't it be better to remove it (or bound
>> it with num_possible_cpus) and have the transport clamp down to
>> num_online_cpus?
>>
>>
> 
> The transport clamp it. I just noticed we set it twice by calling 
> num_online_cpus() in case we connect with --nr-io-queues options instead 
> of using the cached value.
> If you're ok with this we can leave it "as is".

I think it would be good to have default of num_online_cpus and bound
the user with num_possible_cpus instead (if the user asked for more than
online). The transport will clamp it down regardless, but if/when more
cpus come in, transport can re-adjust in the next reset.

thoughts?

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-06-24 17:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-24 15:49 [PATCH 1/1] nvme-fabrics: use default value for nr_io_queues setting Max Gurtovoy
2018-06-24 16:01 ` Sagi Grimberg
2018-06-24 16:06   ` Max Gurtovoy
2018-06-24 16:16     ` Sagi Grimberg
2018-06-24 16:44       ` Max Gurtovoy
2018-06-24 17:00         ` Sagi Grimberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.