-
Notifications
You must be signed in to change notification settings - Fork 185
[WIP] nvme_driver: WORKAROUND: don't defer queue create to after restore #3149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -958,9 +958,9 @@ impl<D: DeviceBacking> NvmeDriver<D> { | |||||||||||||||||||||||||||||||||||||||
| .worker_data | ||||||||||||||||||||||||||||||||||||||||
| .io | ||||||||||||||||||||||||||||||||||||||||
| .iter() | ||||||||||||||||||||||||||||||||||||||||
| .filter(|q| { | ||||||||||||||||||||||||||||||||||||||||
| q.queue_data.qid == 1 || !q.queue_data.handler_data.pending_cmds.commands.is_empty() | ||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||
| // .filter(|q| { | ||||||||||||||||||||||||||||||||||||||||
| // q.queue_data.qid == 1 || !q.queue_data.handler_data.pending_cmds.commands.is_empty() | ||||||||||||||||||||||||||||||||||||||||
| // }) | ||||||||||||||||||||||||||||||||||||||||
| .flat_map(|q| -> Result<IoQueue<D>, anyhow::Error> { | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
957
to
964
|
||||||||||||||||||||||||||||||||||||||||
| let qid = q.queue_data.qid; | ||||||||||||||||||||||||||||||||||||||||
| let cpu = q.cpu; | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -989,12 +989,14 @@ impl<D: DeviceBacking> NvmeDriver<D> { | |||||||||||||||||||||||||||||||||||||||
| &pci_id, | ||||||||||||||||||||||||||||||||||||||||
| q, | ||||||||||||||||||||||||||||||||||||||||
| bounce_buffer, | ||||||||||||||||||||||||||||||||||||||||
| if q.queue_data.handler_data.pending_cmds.commands.is_empty() { | ||||||||||||||||||||||||||||||||||||||||
| if !q.queue_data.handler_data.pending_cmds.commands.is_empty() { | ||||||||||||||||||||||||||||||||||||||||
| drain_after_restore_template.new_draining() | ||||||||||||||||||||||||||||||||||||||||
| } else if q.queue_data.qid == 1 { | ||||||||||||||||||||||||||||||||||||||||
| drain_after_restore_for_qid1 | ||||||||||||||||||||||||||||||||||||||||
| .take() | ||||||||||||||||||||||||||||||||||||||||
| .expect("only QID 1 should be empty in eager restore") | ||||||||||||||||||||||||||||||||||||||||
| .unwrap_or_else(|| drain_after_restore_template.new_self_drained()) | ||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||
| drain_after_restore_template.new_draining() | ||||||||||||||||||||||||||||||||||||||||
| drain_after_restore_template.new_self_drained() | ||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+992
to
1000
|
||||||||||||||||||||||||||||||||||||||||
| )?; | ||||||||||||||||||||||||||||||||||||||||
| tracing::info!(qid, cpu, ?pci_id, "restoring queue: create issuer"); | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -1009,40 +1011,40 @@ impl<D: DeviceBacking> NvmeDriver<D> { | |||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| // (2) Create prototype entries for any queues that don't currently have outstanding commands. | ||||||||||||||||||||||||||||||||||||||||
| // They will be restored on demand later. | ||||||||||||||||||||||||||||||||||||||||
| worker.proto_io = saved_state | ||||||||||||||||||||||||||||||||||||||||
| .worker_data | ||||||||||||||||||||||||||||||||||||||||
| .io | ||||||||||||||||||||||||||||||||||||||||
| .iter() | ||||||||||||||||||||||||||||||||||||||||
| .filter(|q| { | ||||||||||||||||||||||||||||||||||||||||
| q.queue_data.qid != 1 && q.queue_data.handler_data.pending_cmds.commands.is_empty() | ||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||
| .zip(drain_after_restore_for_proto_queues) | ||||||||||||||||||||||||||||||||||||||||
| .map(|(q, drain_after_restore)| { | ||||||||||||||||||||||||||||||||||||||||
| // Create a prototype IO queue entry. | ||||||||||||||||||||||||||||||||||||||||
| tracing::info!( | ||||||||||||||||||||||||||||||||||||||||
| qid = q.queue_data.qid, | ||||||||||||||||||||||||||||||||||||||||
| cpu = q.cpu, | ||||||||||||||||||||||||||||||||||||||||
| ?pci_id, | ||||||||||||||||||||||||||||||||||||||||
| "creating prototype io queue entry", | ||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||
| max_seen_qid = max_seen_qid.max(q.queue_data.qid); | ||||||||||||||||||||||||||||||||||||||||
| let mem_block = restored_memory | ||||||||||||||||||||||||||||||||||||||||
| .iter() | ||||||||||||||||||||||||||||||||||||||||
| .find(|mem| { | ||||||||||||||||||||||||||||||||||||||||
| mem.len() == q.queue_data.mem_len && q.queue_data.base_pfn == mem.pfns()[0] | ||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||
| .expect("unable to find restored mem block") | ||||||||||||||||||||||||||||||||||||||||
| .to_owned(); | ||||||||||||||||||||||||||||||||||||||||
| ( | ||||||||||||||||||||||||||||||||||||||||
| q.cpu, | ||||||||||||||||||||||||||||||||||||||||
| ProtoIoQueue { | ||||||||||||||||||||||||||||||||||||||||
| save_state: q.clone(), | ||||||||||||||||||||||||||||||||||||||||
| mem: mem_block, | ||||||||||||||||||||||||||||||||||||||||
| drain_after_restore, | ||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||
| .collect(); | ||||||||||||||||||||||||||||||||||||||||
| // worker.proto_io = saved_state | ||||||||||||||||||||||||||||||||||||||||
| // .worker_data | ||||||||||||||||||||||||||||||||||||||||
| // .io | ||||||||||||||||||||||||||||||||||||||||
| // .iter() | ||||||||||||||||||||||||||||||||||||||||
| // .filter(|q| { | ||||||||||||||||||||||||||||||||||||||||
| // q.queue_data.qid != 1 && q.queue_data.handler_data.pending_cmds.commands.is_empty() | ||||||||||||||||||||||||||||||||||||||||
| // }) | ||||||||||||||||||||||||||||||||||||||||
| // .zip(drain_after_restore_for_proto_queues) | ||||||||||||||||||||||||||||||||||||||||
| // .map(|(q, drain_after_restore)| { | ||||||||||||||||||||||||||||||||||||||||
| // // Create a prototype IO queue entry. | ||||||||||||||||||||||||||||||||||||||||
| // tracing::info!( | ||||||||||||||||||||||||||||||||||||||||
| // qid = q.queue_data.qid, | ||||||||||||||||||||||||||||||||||||||||
| // cpu = q.cpu, | ||||||||||||||||||||||||||||||||||||||||
| // ?pci_id, | ||||||||||||||||||||||||||||||||||||||||
| // "creating prototype io queue entry", | ||||||||||||||||||||||||||||||||||||||||
| // ); | ||||||||||||||||||||||||||||||||||||||||
| // max_seen_qid = max_seen_qid.max(q.queue_data.qid); | ||||||||||||||||||||||||||||||||||||||||
| // let mem_block = restored_memory | ||||||||||||||||||||||||||||||||||||||||
| // .iter() | ||||||||||||||||||||||||||||||||||||||||
| // .find(|mem| { | ||||||||||||||||||||||||||||||||||||||||
| // mem.len() == q.queue_data.mem_len && q.queue_data.base_pfn == mem.pfns()[0] | ||||||||||||||||||||||||||||||||||||||||
| // }) | ||||||||||||||||||||||||||||||||||||||||
| // .expect("unable to find restored mem block") | ||||||||||||||||||||||||||||||||||||||||
| // .to_owned(); | ||||||||||||||||||||||||||||||||||||||||
| // ( | ||||||||||||||||||||||||||||||||||||||||
| // q.cpu, | ||||||||||||||||||||||||||||||||||||||||
| // ProtoIoQueue { | ||||||||||||||||||||||||||||||||||||||||
| // save_state: q.clone(), | ||||||||||||||||||||||||||||||||||||||||
| // mem: mem_block, | ||||||||||||||||||||||||||||||||||||||||
| // drain_after_restore, | ||||||||||||||||||||||||||||||||||||||||
| // }, | ||||||||||||||||||||||||||||||||||||||||
| // ) | ||||||||||||||||||||||||||||||||||||||||
| // }) | ||||||||||||||||||||||||||||||||||||||||
| // .collect(); | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1029
to
1048
|
||||||||||||||||||||||||||||||||||||||||
| // ); | |
| // max_seen_qid = max_seen_qid.max(q.queue_data.qid); | |
| // let mem_block = restored_memory | |
| // .iter() | |
| // .find(|mem| { | |
| // mem.len() == q.queue_data.mem_len && q.queue_data.base_pfn == mem.pfns()[0] | |
| // }) | |
| // .expect("unable to find restored mem block") | |
| // .to_owned(); | |
| // ( | |
| // q.cpu, | |
| // ProtoIoQueue { | |
| // save_state: q.clone(), | |
| // mem: mem_block, | |
| // drain_after_restore, | |
| // }, | |
| // ) | |
| // }) | |
| // .collect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The queue-restore selection filter has been commented out, leaving dead/commented code in the restore path. Please remove the commented-out code and update the surrounding restore-step comments to reflect the new behavior (restoring all I/O queues eagerly), or gate the behavior behind an explicit flag/config so this doesn’t ship as commented-out logic.