[PATCH] NVMe: avoid kmalloc/kfree for smaller IO

Keith Busch keith.busch at intel.com
Thu Jan 22 11:26:29 PST 2015


On Thu, 22 Jan 2015, Andrey Kuzmin wrote:
> According to 1.2 (that's what I've got at hand, see the quote below), controller reports min/max supported page size, and the host then sets memory page size (via CC.MPS register) within the reported limits. So those negotiations
> should be in charge of setting and storing the page size, whereupon Jens's code can just utilize the setting the driver has applied to CC.MPS.

Right, and that was the suggestion. :)

The spec doesn't call this out, but the host can set CC.MPS to any value
in the controller's capable range as long as that value is less than or
equal to the host's true size.

... actually you could probably make it work the other way around (host
size smaller than the device's), but that'd force a lot of IO splitting
and no such device exists anyway.

> 3.1.5 Offset 14h: CC – Controller Configuration
> This register modifies settings for the controller. Host software shall set the Arbitration Mechanism
> (CC.AMS), the Memory Page Size (CC.MPS), and the Command Set (CC.CSS) to valid values prior to
> enabling the controller by setting CC.EN to ‘1’.
> 
> Memory Page Size (MPS): This field indicates the host memory page size.
> The memory page size is (2 ^ (12 + MPS)). Thus, the minimum host memory page size is 4KB and the maximum host memory page size is 128MB. The
> value set by host software shall be a supported value as indicated by the CAP.MPSMAX and CAP.MPSMIN fields. This field describes the value used for PRP entry size. This field shall only be modified when EN is cleared to ‘0’.


More information about the Linux-nvme mailing list