From: Ming Lei <ming.lei@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Jens Axboe <axboe@kernel.dk>, Keith Busch <keith.busch@intel.com>,
linux-nvme@lists.infradead.org, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 7/8] blk-mq: create hctx for each present CPU
Date: Thu, 8 Jun 2017 10:28:20 +0800 [thread overview]
Message-ID: <20170608022819.GB5602@ming.t460p> (raw)
In-Reply-To: <20170607190659.GA32550@lst.de>
On Wed, Jun 07, 2017 at 09:06:59PM +0200, Christoph Hellwig wrote:
> On Wed, Jun 07, 2017 at 05:10:46PM +0800, Ming Lei wrote:
> > One thing not sure is that we may need to handle new CPU hotplug
> > after initialization. Without the CPU hotplug handler, system may
> > not scale well when more CPUs are added to sockets.
>
> Adding physical CPUs to sockets is a very rare activity, and we
> should not optimize for it. Taking CPUs that are physically present
> offline and online is the case that is interesting, and that's what
> this patchset changes.
Yeah, I understand. It depends if there are real use cases in which
system can't be rebooted, but sometimes CPUs need to be added or removed
for some reasons. Looks CONFIG_HOTPLUG_CPU addresses this requirement,
>From searching on google, looks there are some for virtualization,
and both Qemu and Vmware support that.
>
> > Another thing is that I don't see how NVMe handles this situation,
> > blk_mq_update_nr_hw_queues() is called in nvme_reset_work(), so
> > that means RESET need to be triggered after new CPUs are added to
> > system?
>
> Yes.
Unfortunately I don't see the Reset comes when new CPU cores becomes
online.
>
> > I have tried to add new CPUs runtime on Qemu, and not see
> > new hw queues are added no matter this patchset is applied or not.
>
> Do you even see the CPUs in your VM? For physical hotplug you'll
> need to reserve spots in the cpumap beforehand.
Yes, I can add the new CPUs in console of Qemu, and these CPUs become
present first in VM, then switched online via command line after the hotplug,
but number of hw queues doesn't change.
Please see the following log:
root@ming:/sys/kernel/debug/block# echo "before adding one CPU"
before adding one CPU
root@ming:/sys/kernel/debug/block#
root@ming:/sys/kernel/debug/block# lscpu | head -n 10
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 2
Socket(s): 2
NUMA node(s): 1
Vendor ID: GenuineIntel
root@ming:/sys/kernel/debug/block# ls nvme0n1/
hctx0 hctx1 hctx2 hctx3 poll_stat requeue_list state
root@ming:/sys/kernel/debug/block#
root@ming:/sys/kernel/debug/block# echo "one CPU will be added"
one CPU will be added
root@ming:/sys/kernel/debug/block#
device: 'cpu4': device_add
bus: 'cpu': add device cpu4
PM: Adding info for cpu:cpu4
CPU4 has been hot-added
bus: 'cpu': driver_probe_device: matched device cpu4 with driver processor
bus: 'cpu': really_probe: probing driver processor with device cpu4
processor cpu4: no default pinctrl state
devices_kset: Moving cpu4 to end of list
driver: 'processor': driver_bound: bound to device 'cpu4'
bus: 'cpu': really_probe: bound device cpu4 to driver processor
root@ming:/sys/kernel/debug/block# echo 1 > /sys/devices/system/cpu/cpu4/online
smpboot: Booting Node 0 Processor 4 APIC 0x4/sys/devices/system/cpu/cpu4/online
kvm-clock: cpu 4, msr 2:7ff5e101, secondary cpu clock
TSC ADJUST compensate: CPU4 observed 349440008297 warp. Adjust: 2147483647
TSC ADJUST compensate: CPU4 observed 347292524597 warp. Adjust: 2147483647
TSC synchronization [CPU#1 -> CPU#4]:
Measured 347292524561 cycles TSC warp between CPUs, turning off TSC clock.
tsc: Marking TSC unstable due to check_tsc_sync_source failed
KVM setup async PF for cpu 4
kvm-stealtime: cpu 4, msr 27fd0d900
Will online and init hotplugged CPU: 4
device: 'cooling_device4': device_add
PM: Adding info for No Bus:cooling_device4
device: 'cache': device_add
PM: Adding info for No Bus:cache
device: 'index0': device_add
PM: Adding info for No Bus:index0
device: 'index1': device_add
PM: Adding info for No Bus:index1
device: 'index2': device_add
PM: Adding info for No Bus:index2
device: 'index3': device_add
PM: Adding info for No Bus:index3
device: 'machinecheck4': device_add
bus: 'machinecheck': add device machinecheck4
PM: Adding info for machinecheck:machinecheck4
root@ming:/sys/kernel/debug/block# lscpu | head -n 10
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 5
On-line CPU(s) list: 0-4
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 3
NUMA node(s): 1
Vendor ID: GenuineIntel
root@ming:/sys/kernel/debug/block# ls nvme0n1/
hctx0 hctx1 hctx2 hctx3 poll_stat requeue_list state
Thanks,
Ming
next prev parent reply other threads:[~2017-06-08 2:28 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-03 14:03 spread MSI(-X) vectors to all possible CPUs V2 Christoph Hellwig
2017-06-03 14:03 ` [PATCH 1/8] genirq: allow assigning affinity to present but not online CPUs Christoph Hellwig
2017-06-04 15:14 ` Sagi Grimberg
2017-06-17 23:21 ` Thomas Gleixner
2017-06-03 14:03 ` [PATCH 2/8] genirq: move pending helpers to internal.h Christoph Hellwig
2017-06-04 15:15 ` Sagi Grimberg
2017-06-03 14:03 ` [PATCH 3/8] genirq/affinity: factor out a irq_affinity_set helper Christoph Hellwig
2017-06-04 15:15 ` Sagi Grimberg
2017-06-16 10:23 ` Thomas Gleixner
2017-06-16 11:08 ` Thomas Gleixner
2017-06-16 12:00 ` Thomas Gleixner
2017-06-17 23:14 ` Thomas Gleixner
2017-06-03 14:03 ` [PATCH 4/8] genirq/affinity: assign vectors to all present CPUs Christoph Hellwig
2017-06-04 15:17 ` Sagi Grimberg
2017-06-22 17:10 ` [tip:irq/core] genirq/affinity: Assign " tip-bot for Christoph Hellwig
2017-06-03 14:04 ` [PATCH 5/8] genirq/affinity: update CPU affinity for CPU hotplug events Christoph Hellwig
2017-06-16 10:26 ` Thomas Gleixner
2017-06-16 10:29 ` Thomas Gleixner
2017-06-03 14:04 ` [PATCH 6/8] blk-mq: include all present CPUs in the default queue mapping Christoph Hellwig
2017-06-04 15:11 ` Sagi Grimberg
2017-06-03 14:04 ` [PATCH 7/8] blk-mq: create hctx for each present CPU Christoph Hellwig
2017-06-04 15:11 ` Sagi Grimberg
2017-06-07 9:10 ` Ming Lei
2017-06-07 19:06 ` Christoph Hellwig
2017-06-08 2:28 ` Ming Lei [this message]
2017-06-07 22:04 ` Omar Sandoval
2017-06-08 6:58 ` Christoph Hellwig
2017-06-03 14:04 ` [PATCH 8/8] nvme: allocate queues for all possible CPUs Christoph Hellwig
2017-06-04 15:13 ` Sagi Grimberg
2017-06-16 6:48 ` spread MSI(-X) vectors to all possible CPUs V2 Christoph Hellwig
2017-06-16 7:28 ` Thomas Gleixner
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=20170608022819.GB5602@ming.t460p \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=keith.busch@intel.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=tglx@linutronix.de \
/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®