1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:27:44 +00:00

Kernel: Add polling support to NVMe

Add polling support to NVMe so that it does not use interrupt to
complete a IO but instead actively polls for completion. This probably
is not very efficient in terms of CPU usage but it does not use
interrupts to complete a IO which is beneficial at the moment as there
is no MSI(X) support and it can reduce the latency of an IO in a very
fast NVMe device.

The NVMeQueue class has been made the base class for NVMeInterruptQueue
and NVMePollQueue. The factory function `NVMeQueue::try_create` will
return the appropriate queue to the controller based on the polling
boot parameter.

The polling mode can be enabled by adding an extra boot parameter:
`nvme_poll`.
This commit is contained in:
Pankaj Raghav 2022-01-27 16:44:58 +05:30 committed by Andreas Kling
parent aa832ee251
commit d234e6b801
13 changed files with 211 additions and 83 deletions

View file

@ -23,7 +23,7 @@ class StorageManagement {
public:
StorageManagement();
static bool initialized();
void initialize(StringView boot_argument, bool force_pio);
void initialize(StringView boot_argument, bool force_pio, bool nvme_poll);
static StorageManagement& the();
NonnullRefPtr<FileSystem> root_filesystem() const;
@ -36,7 +36,7 @@ public:
private:
bool boot_argument_contains_partition_uuid();
void enumerate_controllers(bool force_pio);
void enumerate_controllers(bool force_pio, bool nvme_poll);
void enumerate_storage_devices();
void enumerate_disk_partitions();