From: Hannes Reinecke <hare@suse.de>
To: Li Feng <fengli@smartx.com>, Sagi Grimberg <sagi@grimberg.me>
Cc: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@fb.com>,
Christoph Hellwig <hch@lst.de>,
"open list:NVM EXPRESS DRIVER" <linux-nvme@lists.infradead.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] nvme/tcp: Add support to set the tcp worker cpu affinity
Date: Wed, 26 Apr 2023 13:31:12 +0200 [thread overview]
Message-ID: <c15d89c5-4cc2-68b9-d8fa-6c3a8590cfdf@suse.de> (raw)
In-Reply-To: <CAHckoCzBBmn8kCuD+ssRKApvFYNxedj_RkqsvgDis+iwV8g-oA@mail.gmail.com>
On 4/25/23 10:32, Li Feng wrote:
> Hi Sagi,
>
> On Wed, Apr 19, 2023 at 5:32 PM Sagi Grimberg <sagi@grimberg.me> wrote:
>>
>>
>>>> Hey Li,
>>>>
>>>>> The default worker affinity policy is using all online cpus, e.g. from 0
>>>>> to N-1. However, some cpus are busy for other jobs, then the nvme-tcp will
>>>>> have a bad performance.
>>>>> This patch adds a module parameter to set the cpu affinity for the nvme-tcp
>>>>> socket worker threads. The parameter is a comma separated list of CPU
>>>>> numbers. The list is parsed and the resulting cpumask is used to set the
>>>>> affinity of the socket worker threads. If the list is empty or the
>>>>> parsing fails, the default affinity is used.
>>>>
>>>> I can see how this may benefit a specific set of workloads, but I have a
>>>> few issues with this.
>>>>
>>>> - This is exposing a user interface for something that is really
>>>> internal to the driver.
>>>>
>>>> - This is something that can be misleading and could be tricky to get
>>>> right, my concern is that this would only benefit a very niche case.
>>> Our storage products needs this feature~
>>> If the user doesn’t know what this is, they can keep it default, so I thinks this is
>>> not unacceptable.
>>
>> It doesn't work like that. A user interface is not something exposed to
>> a specific consumer.
>>
>>>> - If the setting should exist, it should not be global.
>>> V2 has fixed it.
>>>>
>>>> - I prefer not to introduce new modparams.
>>>>
>>>> - I'd prefer to find a way to support your use-case without introducing
>>>> a config knob for it.
>>>>
>>> I’m looking forward to it.
>>
>> If you change queue_work_on to queue_work, ignoring the io_cpu, does it
>> address your problem?
> Sorry for the late response, I just got my machine back.
> Replace the queue_work_on to queue_work, looks like it has a little
> good performance.
> The busy worker is `kworker/56:1H+nvme_tcp_wq`, and fio binds to
> 90('cpus_allowed=90'),
> I don't know why the worker 56 is selected.
> The performance of 256k read up from 1.15GB/s to 1.35GB/s.
>
>>
>> Not saying that this should be a solution though.
>>
>> How many queues does your controller support that you happen to use
>> queue 0 ?
> Our controller only support one io queue currently.
Ouch.
Remember, NVMe gets most of the performance improvements by using
several queues, and be able to bind the queues to cpu sets.
Exposing just one queue will be invalidating any assumptions we do,
and trying to improve interrupt steering won't work anyway.
I sincerely doubt we should try to 'optimize' for this rather peculiar
setup.
Cheers,
Hannes
next prev parent reply other threads:[~2023-04-26 11:31 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-13 6:23 Li Feng
2023-04-13 6:33 ` Li Feng
2023-04-13 12:53 ` kernel test robot
2023-04-17 13:45 ` Sagi Grimberg
2023-04-18 3:39 ` Li Feng
2023-04-19 9:32 ` Sagi Grimberg
2023-04-25 8:32 ` Li Feng
2023-04-26 11:31 ` Hannes Reinecke [this message]
2023-04-27 12:21 ` Sagi Grimberg
2023-04-27 14:36 ` Ming Lei
2023-04-27 12:11 ` Sagi Grimberg
2023-04-18 3:58 ` Chaitanya Kulkarni
2023-04-18 4:21 ` Li Feng
2023-04-18 9:20 ` Li Feng
2023-04-13 13:29 ` [PATCH v2] " Li Feng
2023-04-14 8:36 ` Hannes Reinecke
2023-04-14 9:35 ` Li Feng
2023-04-15 20:21 ` Chaitanya Kulkarni
2023-04-15 21:06 ` David Laight
2023-04-17 3:31 ` Li Feng
2023-04-17 6:27 ` Hannes Reinecke
2023-04-17 8:32 ` Li Feng
2023-04-17 7:37 ` Ming Lei
2023-04-17 7:50 ` Li Feng
2023-04-17 8:05 ` Ming Lei
2023-04-17 13:33 ` Sagi Grimberg
2023-04-18 3:29 ` Li Feng
2023-04-18 4:33 ` Ming Lei
2023-04-18 9:32 ` Sagi Grimberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c15d89c5-4cc2-68b9-d8fa-6c3a8590cfdf@suse.de \
--to=hare@suse.de \
--cc=axboe@fb.com \
--cc=fengli@smartx.com \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®