Block device interface using non-volatile pinned memory
A method includes receiving, at a block device interface, an instruction to write data, the instruction comprising a memory location of the data; copying the data to pinned memory; performing, by a vector processor, one or more invertible transforms on the data; and writing the data from the pinned memory to one or more storage devices asynchronously. The pinned memory of the data corresponds to a location in pinned memory, the pinned memory being accessible by the vector processor and one or more other processors.
1. A method comprising:
receiving, at a block device interface, an instruction to write data, the instruction comprising a memory location of the data;
copying the data to pinned memory;
indicating to a sender of the instruction that the data in the pinned memory has been written to one or more storage devices before performing one or more invertible transforms on the data;
performing, by a vector processor, the one or more invertible transforms on the data to generate transformed data;
writing the transformed data to the pinned memory; and
initiating a transfer of the transformed data from the pinned memory to the one or more storage devices in response to a block device driver determining that the transformed data must be moved from the pinned memory to the one or more storage devices,
wherein contents of the pinned memory are accessible by the vector processor and a central processing unit (CPU) directly over a data bus.
2. The method of claim 1 , wherein the pinned memory is configured as a write-back cache.
3. The method of claim 2 , further comprising:
determining that a part of the write-back cache associated with the transformed data is dirty;
writing the transformed data to the one or more storage devices; and
marking the part of the write-back cache as clean.
4. The method of claim 2 , wherein the write-back cache comprises a plurality of partitions, each partition being associated with a source.
5. The method of claim 1 ,
wherein the pinned memory comprises a plurality of memory units, and
wherein the transformed data in the pinned memory is located in each of the plurality of memory units.
6. The method of claim 5 , wherein the plurality of memory units comprises one or more pairs of non-volatile dual in-line memory modules (NV-DIMMs).
7. The method of claim 5 , further comprising:
determining that a first one of the plurality of memory units has been replaced; and
mirroring the data from a second one of the plurality of memory units to the first memory unit.
8. The method of claim 1 , wherein the block device interface comprises a block device interface for a meta-device corresponding to the one or more storage devices.
9. The method of claim 2 ,
wherein receiving an instruction to write data comprises receiving an instruction to modify data stored on the one or more storage devices and reading the data stored on the one or more storage devices to the write-back cache, and
wherein writing the data to a the write-back cache comprises modifying the data in the write-back cache based on the instruction.
10. The method of claim 1 , further comprising providing the block device interface.
11. The method of claim 1 , wherein performing, by the vector processor, the one or more invertible transforms on the data comprises one or more of encryption, encoding, compressing, deduplicating, or logging.