Page MenuHomeFreeBSD

nvme: nvd/nda call disk_resize() when namespace changed async event happened
Changes PlannedPublic

Authored by wanpengqian_gmail.com on Nov 17 2021, 9:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Mar 16, 11:29 AM
Unknown Object (File)
Feb 10 2024, 4:37 AM
Unknown Object (File)
Jan 13 2024, 3:08 AM
Unknown Object (File)
Dec 10 2023, 8:21 PM
Unknown Object (File)
Dec 1 2023, 12:46 AM
Unknown Object (File)
Nov 29 2023, 1:27 PM
Unknown Object (File)
Nov 29 2023, 7:17 AM
Unknown Object (File)
Nov 5 2023, 4:10 AM
Subscribers

Details

Reviewers
imp
chuck
jhb
Group Reviewers
cam
Summary

Take D32963 and make nvd/nda resize after namespace changed async event trigger.

create a new thread and this thread will update namespace data when needed.

nvd can now call resize_disk() and update the disk size properly.

for nda, after NVME_PROBE_IDENTIFY_NS is finish, fire a AC_GETDEV_CHANGED event,
and it will call resize_disk() to adjust disk size.

Test Plan

When bhyve vm resize disk, verify diskinfo output inside guest, both nvd and nda.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 43079
Build 39967: arc lint + arc unit

Event Timeline

imp requested changes to this revision.Nov 17 2021, 4:04 PM

Like I said before, we shouldn't be basing this off the async callback, but instead the namespace change stuff.
Namespaces can arrive and depart, and this doesn't cope with that aspect of things, just the size change.

sys/cam/nvme/nvme_da.c
717

You can't do this in the kernel. the stack is too small.

939

I think this should be after we set the other parameters.

sys/dev/nvme/nvme.c
281 ↗(On Diff #98635)

No. Like I said before, we do not want to parse the NVME log pages in the clients. This change is wrong.

sys/dev/nvme/nvme_ctrlr.c
760

I think this is wrong on many levels.

sys/dev/nvme/nvme_sim.c
381

this is also wrong. It doesn't handle the multiple name spaces arriving or departing. It only handles the size change.

This revision now requires changes to proceed.Nov 17 2021, 4:04 PM
wanpengqian_gmail.com retitled this revision from nvme: nda call disk_resize() when namespace changed async event happened to nvme: nvd/nda call disk_resize() when namespace changed async event happened.Dec 1 2021, 8:38 AM
wanpengqian_gmail.com edited the summary of this revision. (Show Details)
wanpengqian_gmail.com added inline comments.
sys/cam/nvme/nvme_da.c
717

OK, remove this output.

939

Yes, I did not match the original sequence.

sys/dev/nvme/nvme_ctrlr.c
760

since notify_ns will query the namespace, that will cause kernel panic. here we post a query request to queue. other thread will query and construct_ns and call notify_ns after that.

sys/dev/nvme/nvme_sim.c
381

I will not use async callback this time.

wanpengqian_gmail.com marked an inline comment as done.

after NVME_PROBE_IDENTIFY_NS is done, fire a AC_GETDEV_CHANGED async event.

wanpengqian_gmail.com edited the test plan for this revision. (Show Details)

I tested with 14.0-CURRENT Oct 10 2022, and it works. Is it the right direction for dynamically changing the disk size after hosts resize the disk?