The present disclosure relates generally to memory for use with processor systems and, more particularly, to methods and apparatus to manage intermittently connectable storage media.
Processor systems including computers, tablets, mobile devices, Internet appliances, and other computing and/or connected devices are provided with memory to store instructions and/or data. Processor systems may also be used with removable storage media such as universal serial bus (USB) flash drives, secure digital (SD) memory cards, etc. Removable storage media can be used to expand data storage capacities of processor systems and/or to make data physically portable between different devices. Using such removable storage media, storage capacity expansion and data portability is achievable using external memory/accessory interfaces on processor systems such as USB interfaces, memory card interfaces, etc.
To access data on removable storage media, a user plugs the removable storage media device into a corresponding external interface port on a processor system. The processor system detects the connected device and executes a drive/volume mounting process to mount the removable storage media device as an accessible drive/volume in an operating system (OS) environment of the processor system. Subsequently, the user can unmount, eject, or otherwise physically disconnect the removable storage media device from the processor system. At that point, the user expects data to be stored on the removable storage media device in a persistent, non-volatile manner. The user also expects the persisted data to be accessible at a later time using the same or a different processor system.
The figures are not to scale. Wherever possible, the same reference numbers will be used throughout the drawing(s) and accompanying written description to refer to the same or like parts.
Examples disclosed herein may be used to manage intermittently connectable storage media. Intermittently connectable storage media include hardware devices such as removable storage media devices (e.g., removable solid-state nonvolatile storage media) and network attached storage (NAS) devices. Removable storage media include hardware memory/storage devices that connect to local wired or wireless physical interfaces (e.g., universal serial bus (USB) interfaces, secure digital (SD) interfaces, Wi-Fi wireless interfaces, Bluetooth wireless interfaces, etc.) of host systems. Removable solid-state nonvolatile storage media are prolific in computer systems in the form of universal serial bus (USB) thumb drives, secure digital (SD)/micro-SD cards, wireless connectivity capable drives, and other types of removable media. These types of low-cost storage devices are typically used for temporary storage of data, but have some disadvantages. For example, removable storage media today usually is slow (e.g., typically over 10 times lower performance than internal solid-state drives (SSDs) that systems ship with), causing systems to appear slow and/or unresponsive. In addition, removable storage media devices like SD cards, USB drives, or wireless connectivity capable drives can be removed from the system by the end-user with no notification to the operating system or applications which may be running and accessing the removable storage media devices. Such abrupt removal or surprise removal of the removable storage media can result in data corruption of blocks of data, individual files, or all data stored on the removable storage media.
NAS media includes hardware memory/storage devices capable of being associated with or attached to host systems via network connections. For example, a NAS may include a solid-state memory device or other type of memory technology to store information that is accessible over a network by one or more host systems. The NAS is provided with a network interface (e.g., a network interface card (NIC)) that can be connected to a network through a wired interface (e.g., an Ethernet connection) and/or a wireless interface (e.g., a Wi-Fi connection, a Bluetooth connection, etc.). Like removable nonvolatile storage media, NAS media devices also have disadvantages including user-perceived slow performance and the possibility of abrupt disconnection. The user-perceived slow performance is often due to network connectivity/congestion issues between the NAS device and the host system. Abrupt disconnection is often due to a host system dropping a network connection, which may be caused by losing wireless connectivity range of an access point, a dropped Internet connection, a dropped virtual private network (VPN) connection, a failing switch, a failing router, etc. Such abrupt removal or disconnection of a NAS device can result in data corruption of blocks of data, individual files, or all data stored on the NAS device.
Prior solutions to the surprise removal issue of plug-in type or mechanical insert-type removable storage media (e.g., USB drives, SD media cards, etc.) rely on mechanical interlocks and/or frequent use of synchronization primitives to help mitigate disruptions of any write operations that are in-flight or in progress at the time the removable storage media device is being removed. That is, mechanical interlock solutions rely on hardware switches to signal a host processor to undertake some action in response to the hardware switches detecting that the removable storage media device is being removed from a host system. For example, mechanical interlocks create a time window at which a hardware switch engaged by the removable storage media signals the host processor that the removable storage media is being disengaged. This time window is of uncertain duration because timing of mechanical interlock signaling is typically a function of how fast a removable memory card is physically removed from a host system. Although the time window is of uncertain duration, it can provide the host processor sufficient time to complete a single in-flight or in-process sub-operation of a write operation to the removable storage media. While this may help preserve consistency of data corresponding to a single operation on the removable storage media, it does not address operations that take more time than the available time window (e.g., a large data file being written to the media has not completed at the time the removable storage media device is removed from the host system, resulting in data corruption or inaccessibility of the file). Alternative prior solutions of using frequent synchronization primitives as checkpointing have the same disadvantages as prior mechanical interlock solutions. In addition, using frequent synchronization primitives as checkpointing also significantly reduces system performance resulting from data queues needing to be flushed on each synchronization operation.
To overcome performance disadvantages associated with prior management techniques for removable storage media devices, prior solutions create dynamic random access memory (DRAM) caches for data of removable storage media devices. Such DRAM caches of prior techniques are used to improve data access performance by caching data from removable storage media devices to host system DRAM. Data on host system DRAM can be accessed faster than data on removable storage media devices. However, such DRAM-based cache has marginal effectiveness because the cache size allowed in host memory is far smaller than the storage capacity of the removable storage media device itself. In addition, DRAM-based cache speeds up removable media accesses for read operations but not for write operations because write operations are typically flushed (e.g., written back) from the DRAM cache to the removable storage media device immediately to prevent data corruption in the possible event of surprise media removal. If such surprise media removal occurs before a cache flush to the removable storage media device completes, prior cache management techniques discard the data in the DRAM cache in response to the removable storage media device being separated from the host platform. In addition, DRAM-based cache must be reconstructed each time the removable storage media device is reconnected to the host platform even if no data on the removable storage media device changed relative to the previous time the removable storage media device was mounted on the host platform.
Examples disclosed herein overcome the above drawbacks associated with prior removable storage media devices. For example, examples disclosed herein may be used to implement nonvolatile caches on primary/permanent nonvolatile storage devices of host platforms for use with removable storage media devices, NAS devices, and/or any other type of intermittently connectable storage media. When an intermittently connectable storage media device is removably connected to such a host platform, examples disclosed herein can be used to copy data from the intermittently connectable storage media device to the nonvolatile cache for fast data access. In addition, examples disclosed herein provide cache management techniques to manage data caching in the nonvolatile cache and to preserve data consistency between changes made to data in the nonvolatile cache and data in the intermittently connectable storage media even when such intermittently connectable storage media is abruptly or unexpectedly removed from the host system.
In examples disclosed herein, a drive reference is created as a nonvolatile cache by a nonvolatile cache manager (e.g., implemented in hardware and/or software) when the intermittently connectable storage media device is mounted to a host platform. Examples disclosed herein preserve the drive reference upon abrupt or unexpected removal or disconnection of the intermittently connectable storage media from the host platform so that the host platform does not become aware of the intermittently connectable media disappearing. Examples disclosed herein also manage cache writes differently from prior removable media management techniques. For example, upon detecting that intermittently connectable storage media is disconnected from the host platform, examples disclosed herein change cache writes from a write-through cache mode (e.g., mode to immediately flush data from nonvolatile cache to intermittently connectable storage media) to a write-back cache mode (e.g., a mode to store changed data in nonvolatile cache and flush to intermittently connectable storage media at a later time such as when the intermittently connectable storage media is reconnected to the host platform). In this manner, upon removal or connection loss of the intermittently connectable storage media from the host platform, the nonvolatile cache absorbs or accepts new writes and satisfies requested reads based on cached data. This allows a program to continue accessing locally cached data that is associated with the intermittently connectable storage media in the event of an abrupt or unexpected removal or connection loss of the intermittently connectable storage media from the host platform. In this manner, by employing the nonvolatile cache, data accesses that are in progress and/or initiated by the program after removal or disconnection of the intermittently connectable storage media do not cause the program to crash or hang. When a user reconnects or remounts an intermittently connectable storage media device to the host platform, examples disclosed herein can be employed to manage data synchronization between the nonvolatile cache and the intermittently connectable storage media device while substantially reducing or eliminating program faults/crashes.
Examples disclosed herein may be used in connection with any type of intermittently connectable storage media that can be dynamically connected and/or disconnected from the host platform. Examples of such intermittently connectable storage media include USB flash drives, memory cards (e.g., SD memory cards, Personal Computer Memory Card International Association (PCMCIA) memory cards, etc.), memory devices integrated into docking stations and/or connected to docking stations, wireless connectivity capable drives, NAS devices, etc. For example, for memory devices connected to docking stations, examples disclosed herein may be used to manage accesses to such memory devices to improve data access performance and to substantially eliminate or reduce likelihoods of data corruption when host platforms (e.g., a laptop, a tablet, etc.) are abruptly or unexpectedly removed from the docking stations.
The example volatile memory 108 may be implemented using any type of volatile storage. The example volatile memory 108 may be a storage medium that requires power to maintain the state of data stored by the medium. Examples of volatile memory that may be used to implement the volatile memory 108 include various types of random access memory (RAM), such as dynamic random access memory (DRAM) or static random access memory (SRAM). An example types of DRAM that may be used in a memory module to implement the volatile memory 108 is synchronous dynamic random access memory (SDRAM). In some examples, DRAM of a memory component may comply with a standard promulgated by JEDEC, such as JESD79F for DDR SDRAM, JESD79-2F for DDR2 SDRAM, JESD79-3F for DDR3 SDRAM, JESD79-4A for DDR4 SDRAM, JESD209 for Low Power DDR (LPDDR), JESD209-2 for LPDDR2, JESD209-3 for LPDDR3, and JESD209-4 for LPDDR4 (these standards are available at www.jedec.org). Such standards (and similar standards) may be referred to as DDR-based standards, and communication interfaces of the storage devices that implement such standards may be referred to as DDR-based interfaces. The memory device may refer to the die itself and/or to a packaged memory product.
The I/O hub 110 of the illustrated example includes an example fixed nonvolatile storage interface 112 configured to fixedly connect to the nonvolatile storage 104. The example fixed nonvolatile storage interface 112 may be implemented using a Peripheral Component Interconnect Express (PCIe) interface and a Non-volatile Memory Express (NVMe) transfer protocol (e.g., a PCIe NVMe interface). As used herein, NVMe refers to a logical device interface (http://www.nvmexpress.org) for accessing non-volatile storage media attached via a Peripheral Component Interconnect Express (PCIe) bus (http://www.pcsig.com). For example, NVMe may be used to access low latency storage devices in computer systems, including personal and enterprise computer systems, and can also be deployed in data centers requiring scaling of thousands of low latency storage devices.
In examples disclosed herein, fixedly connecting storage refers to a memory being connected to or mounted to the host system 100 in such a manner that the memory is not intended to be unmounted or disconnected from the host system 100 during operation of the host system 100. Instead, a memory that is fixedly connected to the example host system 100 is intended to be mounted/connected to the host system 100 before the host system 100 boots, and the memory is intended to remain mounted or connected to the host system 100 until the host system 100 is shutdown (e.g., no longer running or no longer powered up). In some examples, the nonvolatile storage 104 is in circuit with or connected with the I/O hub 110 to store a master boot record (MBR), operating system (OS) files, system files, etc. that need to be persisted through times when power is removed from the host system 100. For example, upon power up, the host system 100 may boot from and load an OS from the nonvolatile storage 104.
The I/O hub 110 of the illustrated example also includes an example intermittently connectable storage media interface 114 configured to removably connect to intermittently connectable storage media devices such as the intermittently connectable storage media device 106. The example intermittently connectable storage media interface 114 can be implemented using a USB interface, a memory card interface (e.g., an SD memory card interface, a PCMCIA interface, etc.), a docking station interface, etc. In some examples in which the intermittently connectable storage media 106 is a NAS device, the intermittently connectable storage media interface 114 is a NIC interface that enables the host system 100 to connect to the NAS device over a network connection. In some examples in which the intermittently connectable storage media 106 is a wireless storage device, the intermittently connectable storage media interface 114 is configured to connect to a radio module (e.g., a Wi-Fi module, a Bluetooth module, etc.). In other examples, a NIC and/or a radio module may interface directly with the processor(s) 102 instead of through the I/O hub 110. In examples disclosed herein, intermittently connectable storage media that can be removably connected to a host system 100 refers to memory intended to be mounted/connected to and/or unmounted/disconnected from the host system 100 during operation of the host system 100. For example, the intermittently connectable storage media device 106 may be connected/mounted to the host system 100 after the host system 100 is booted and is in a runtime execution environment (e.g., in an OS environment). In addition, the intermittently connectable storage media device 106 may be disconnected/unmounted from the host system 100 while the host system 100 is still running in the runtime execution environment. That is, it is not necessary for the host system 100 to be shut down before removing the intermittently connectable storage media device 106 because the host system 100 is provided with hardware and/or software to manage dynamically disconnecting/unmounting of the intermittently connectable storage media device 106 during operation of the host system 100.
In the illustrated example
In examples disclosed herein, the nonvolatile cache 122 is a storage area to which the processor 102 and/or I/O hub 110 write data that is intended to be written to the intermittently connectable storage media 106 and from which the processor 102 and/or I/O hub 110 reads data that is intended to be read from the intermittently connectable storage media 106. That is, when a write request indicates a destination memory address corresponding to the intermittently connectable storage media 106 as a destination for data to be written, the processor 102 and/or the I/O hub 110 can instead write the data to one or more corresponding cache lines of the nonvolatile cache 122. The data can subsequently be flushed through to the intermittently connectable storage media 106. In addition, when a read request indicates a source memory address corresponding to the intermittently connectable storage media 106 from which data is to be read, the processor 102 and/or the I/O hub 110 can instead read the data from one or more corresponding cache lines of the nonvolatile cache 122 if the requested data is cached in the nonvolatile cache 122. In some examples, the nonvolatile cache manager 118 establishes and concurrently maintains multiple nonvolatile caches 122 for different intermittently connectable storage media devices 106 connected concurrently or at different times to the host system 100.
In the illustrated example, using the nonvolatile storage 104 to create the nonvolatile cache 122 allows cached data from the intermittently connectable storage media device 106 to be preserved or persisted in a nonvolatile manner across system power events (e.g., shutdowns, reboots, power failures, etc.). This is advantageous over volatile DRAM-based caches that lose contents upon removal of power. In the illustrated example, when data is read from the intermittently connectable storage media device 106, the nonvolatile cache manager 118 manages copying 126 (or caching) the read data (e.g., block(s) of data, a file, or a partial file) to the nonvolatile cache 122. In this manner, any subsequent read access of the same data (e.g., the same block(s) of data, the same file, or the same partial file) intended to be read from a memory address of the intermittently connectable storage media device 106 can be serviced by reading the data from the nonvolatile cache 122. In addition, when a process of the host system 100 modifies data intended to be written to a memory address of the intermittently connectable storage media device 106, the nonvolatile cache manager 118 instead writes the modified data to the nonvolatile cache 122. In some examples, reading and/or writing to/from the nonvolatile cache 122 instead of the intermittently connectable storage media device 106 can be quicker. The nonvolatile cache manager 118 subsequently manages cache flushing 128 the modified data (e.g., dirty writes) from the cache 122 to the intermittently connectable storage media device 106 in a manner that does not negatively impact the performance of the process that modified the data.
In the illustrated example, the nonvolatile cache manager 118 sets a cache flush mode of the nonvolatile cache 122 to a write through cache mode so that data writes directed to the intermittently connectable storage media device 106 are cached in the nonvolatile cache 122 and immediately flushed or written to the intermittently connectable storage media device 106 while the intermittently connectable storage media device 106 is connected to the host system 100. Also, while the intermittently connectable storage media device 106 is connected to the host system 100, when a cache hit occurs on requested data, the data is retrieved from the cache, but when a cache miss occurs, the requested data is retrieved from the intermittently connectable storage media device 106. When the intermittently connectable storage media device 106 is disconnected from the host system 100, the nonvolatile cache manager 118 sets a cache flush mode of the nonvolatile cache 122 to a writeback mode to delay flushes of cache data until, for example, the intermittently connectable storage media device 106 is reconnected to the host system 100.
In the illustrated example, the nonvolatile cache manager 118 is configured to manage a number of different intermittently connectable storage media devices that are removably connected to the host system 100 either concurrently or at different times. For example, although only one intermittently connectable storage media interface 114 is shown, the I/O hub 110 may include multiple intermittently connectable storage media interfaces 114 such that two or more intermittently connectable storage media devices may be connected or mounted to the host system 100 concurrently. Alternatively, the intermittently connectable storage media interface 114 may connect to multiple intermittently connectable storage media devices concurrently. To track the different ones of the intermittently connectable storage media devices, the nonvolatile cache manager 118 stores intermittently connectable storage media device IDs (IDICM) of the different intermittently connectable storage media devices. For example, in
In the illustrated example of
In the illustrated example, the nonvolatile cache manager 118 stores a local copy of the write count (CNTICM) 138 in association with the local intermittently connectable storage media device ID (IDICM) 134 shown in
In some examples, after receiving a data read request corresponding to data that is not cached in the nonvolatile cache 122 or after receiving a data write request when the nonvolatile cache 122 is full (e.g., cannot store additional data), the nonvolatile cache manager 118 may cause the host system 100 to display a user interface dialog box prompting the user to reconnect the intermittently connectable storage media device 106. In some examples, this may be done by informing a user that the local cache (e.g., the nonvolatile cache 122) of the intermittently connectable storage media device 106 is full and/or lacks the requested data, and that the user needs to reconnect the intermittently connectable storage media device 106 to the host system 100. In some examples, a graphical user interface (GUI) of a filesystem may be displayed to show available files and unavailable files from the intermittently connectable media storage device 106 based on which files are cached in the nonvolatile cache 122. For example, available cached files may be shown as user selectable darkened icons, and non-cached files may be shown as greyed out icons that are not user-selectable. In some examples, OS-supported reparse points may be used to display the grayed-out icons. In such examples, when the reports points are selected by a user, the nonvolatile cache manager 118 may cause a host system 100 to display a message requesting the user to reconnect the intermittently connectable storage media device 106. Also in such examples, when the intermittently connectable storage media device 106 is reconnected, the reparse points corresponding to the grayed-out icons are converted to user-selectable darkened icons for their corresponding files that are available in the intermittently connectable storage media device 106.
In examples disclosed herein, block(s) of data and/or files, or more generally data, cached in the nonvolatile cache 122 are considered master copies in that if the block(s) of data and/or files are modified in the nonvolatile cache 122 when the intermittently connectable storage media device 106 is no longer connected, and are not modified in the intermittently connectable storage media device 106, cache associations between the master copies of the block(s) of data and/or files in the nonvolatile cache 122 and corresponding block(s) of data and/or files in the intermittently connectable storage media device 106 can be reestablished when the intermittently connectable storage media device 106 is remounted or reconnected to the host system 100. When the master copies of the block(s) of data and/or files are modified in the nonvolatile cache 122 while the intermittently connectable storage media device 106 is unmounted or disconnected from the host system 100, the local write count (CNTL) 142 is not updated. Instead, in the illustrated example, the local write count (CNTL) 142 remains the same as the most recent copy of the intermittently connectable storage media write count (CNTICM) 138 from the intermittently connectable storage media device 106 before the intermittently connectable storage media device 106 was disconnected. Keeping the local write count (CNTL) 142 unchanged in the illustrated example enables the nonvolatile cache manager 118 to determine whether block(s) of data and/or files on the intermittently connectable storage media device 106 were modified by another host system during the time that the intermittently connectable storage media device 106 was not mounted to the host system 100 of
When there is a mismatch between the local write count (CNTL) 142 and the intermittently connectable storage media write count (CNTICM) 138, the nonvolatile cache manager 118 determines which data has changed. For example, the nonvolatile cache manager 118 may compare metadata of cache files in the nonvolatile cache 122 to metadata of corresponding non-cache files in the intermittently connectable storage media device 106 to identify which data of the intermittently connectable storage media device 106 was modified relative to cached versions of the data in the nonvolatile cache 122. Example metadata that may be used by the nonvolatile cache manager 118 includes last modified date and her last modified time of files. In some examples, the nonvolatile cache manager 118 disassociates (e.g., invalidates) the nonvolatile cache 122 entirely from the intermittently connectable storage media device 106 when there are newer versions of modified data in the intermittently connectable storage media device 106 relative to corresponding data previously cached in the nonvolatile cache 122. In some examples, the nonvolatile cache manager 118 disassociates (e.g., invalidates) only portions of the nonvolatile cache 122 corresponding to newer versions of data on the intermittently connectable storage media device 106 while maintaining associations between other portions of the nonvolatile cache 122 storing cache data that correspond to non-modified non-cache data in the intermittently connectable storage media device 106. In yet other examples, the nonvolatile cache manager 118 maintains association of all cache data in the nonvolatile cache 122 in its entirety with the intermittently connectable storage media device 106 when none of the non-cache data on the intermittently connectable storage media device 106 has been modified relative to corresponding cache data in the nonvolatile cache 122 (e.g., the local write count (CNTL) 142 matches the intermittently connectable storage media write count (CNTICM) 138).
In examples disclosed herein, when the nonvolatile cache manager 118 detects that the cache data in the nonvolatile cache 122 contains dirty writes (e.g., the cache data was modified by write operations in the nonvolatile cache 122), the nonvolatile cache manager 118 flushes the dirty writes to the intermittently connectable storage media device 106 when the intermittently connectable storage media device 106 is reconnected to the host system 100. In examples disclosed herein, dirty writes are tracked in the nonvolatile cache 122 using any suitable cache modification tracking technique (e.g., setting dirty bits or modified bits for corresponding cache lines or other blocks of the nonvolatile cache 122).
In some examples, when one or more files on the intermittently connectable storage media device 106 have been modified by another host system, the nonvolatile cache manager 118 can cause the host system 100 to prompt a user for confirmation of which file to keep. In such examples, the user can be given the option to keep the cache version of the file stored in the nonvolatile cache 122 or to keep the non-cache version of the file in the intermittently connectable storage media device 106. If the user selects to keep the cache version of the file stored in the nonvolatile cache 122, the nonvolatile cache manager 118 writes back the cache version of the file from the nonvolatile cache 122 to the intermittently connectable storage media device 106 (e.g., overwriting the non-cache version of the file in the intermittently connectable storage media device 106). Alternatively, if the user selects to keep the non-cache version of the file in the intermittently connectable storage media device 106, the nonvolatile cache manager 118 disassociates the cache version of the file from the intermittently connectable storage media device 106. In this manner, the cache version of the file in the nonvolatile cache 122 is discarded (e.g., can be subsequently overwritten by other cache data).
In examples disclosed herein, creating a communicative connection between the intermittently connectable storage media device 106 and the host system 100 is referred to as mounting or connecting, and breaking or removing a communicative connection between the intermittently connectable storage media device 106 and the host system 100 is referred to as unmounting or disconnecting. As used herein, mounting or connecting refers to physically and/or logically mounting or connecting the intermittently connectable storage media device 106 to the host system 100, and unmounting or disconnecting refers to physically and/or logically unmounting or disconnecting the intermittently connectable storage media device 106 from the host system 100. For example, in examples disclosed herein mounting or connecting of the intermittently connectable storage media device 106 causes, effectuates, or triggers the nonvolatile cache manager 118 to initialize the nonvolatile cache 122. Also in examples disclosed herein, unmounting or disconnecting other intermittently connectable storage media device 106 from the host system 100 causes, effectuates, or triggers the nonvolatile cache manager 118 to configure the nonvolatile cache 122 for operation in a writeback mode such that cache flushes to the intermittently connectable storage media device 106 are not immediate (e.g., because the intermittently connectable storage media device 106 is unmounted or disconnected). As such, examples disclosed herein may be caused to configure the nonvolatile cache 122 in response to logical and/or physical mounting or connecting and logical and/or physical unmounting or disconnecting of the intermittently connectable storage media device 106.
In some examples, when the intermittently connectable storage media device 106 is a NAS device, the connection status detector 202 may receive a notification from an operating system of the host system 100 via a registered software callback to indicate that the intermittently connectable storage media device 106 will be disconnected or has been disconnected.
The example cache initializer 204 is provided to initialize the nonvolatile cache 122 (
The example comparator 210 is provided to compare the local write count (CNTL) 142 with the intermittently connectable storage media write count (CNTICM) 138 of
The example metadata analyzer 212 is provided to analyze metadata of data (e.g., metadata of blocks of data and/or files) stored in the nonvolatile cache 122 relative to metadata of corresponding data stored on the intermittently connectable storage media device 106. In this manner, when the comparator 210 finds a mismatch between the local write count (CNTL) 142 and the intermittently connectable storage media write count (CNTICM) 138, the metadata analyzer 212 can compare metadata of cache data in the nonvolatile cache 122 with metadata of corresponding non-cache data in the intermittently connectable storage media device 106 to identify which data (e.g., which one or more bocks of data and/or files) on the intermittently connectable storage media device 106 was modified during the time that the intermittently connectable storage media device 106 was not mounted to the host system 100.
In the illustrated example of
While an example manner of implementing the nonvolatile cache manager 118 of
Flowcharts representative of example machine readable instructions for implementing the nonvolatile cache manager 118 of
As mentioned above, the example processes of
The example process of
Subsequently, during the example reconnection phase 304, the example comparator 316 determines that the intermittently connectable storage media device 106 is reconnected to the host system 100 (block 316). For example, the comparator 316 confirms a match between the device ID (IDICM) 134 of the intermittently connectable storage media device 106 and the device ID (IDICM) 134 stored in the host system 100. The example cache access manager 208 disassociates one or more portions of the nonvolatile cache 122 corresponding to modified data (e.g., one or more blocks of data or one or more files) on the intermittently connectable storage media device 106 (block 318). For example, the cache access manager 208 disassociates one or more portions of the nonvolatile cache 122 from the intermittently connectable storage media device 106 based on the portion(s) of the nonvolatile cache 122 corresponding to data (e.g., one or more blocks of data or one or more files) modified on the intermittently connectable storage media device 106 relative to the portion(s) of the nonvolatile cache 122. The example cache access manager 208 associates one or more portions of the nonvolatile cache 122 corresponding to data not modified on the intermittently connectable storage media device 106 (block 320). For example, the cache access manager 208 associates one or more portions of the nonvolatile cache 122 with the intermittently connectable storage media device 106 based on the portion(s) of the nonvolatile cache 122 corresponding to data not modified on the intermittently connectable storage media device 106 relative to the portion(s) of the nonvolatile cache 122. The example process of
Although the example flow diagram of
After the unmounting detection, the example cache flush manager 206 (
If the cache access manager determines at block 412 that there are no data access operations requiring completion, control advances to block 416. At block 416, the example cache access manager 208 stores the media device ID (IDICM) 134. In addition, the example cache access manager 208 stores the local write count (CNTL) 142 (block 418) as a copy of the write count (CNTICM) 138 of the intermittently connectable storage media device 106. In some examples, the cache access manager 208 copies the media device ID (IDICM) 134 and the write count (CNTICM) 138 from the intermittently connectable storage media device 106 immediately after the connection status detector 202 detects an imminent disconnection of the intermittently connectable storage media device 106 (e.g., a circuit or mechanical switch generates a signal that the intermittently connectable storage media device 106 is about to be disconnected from the host system 100, or disconnection is identified based on a network signal or network connection loss). In this manner, by performing the copy operation immediately upon an imminent unmounting detection, the cache access manager 208 has sufficient time to read the media device ID (IDICM) 134 and the write count (CNTICM) 138 from the intermittently connectable storage media device 106 before complete disconnection. In yet other examples, the cache access manager 208 reads the device ID (IDICM) 134 and the write count (CNTICM) 138 from the intermittently connectable storage media device 106 at block 404 during initialization of the nonvolatile cache 122 and stores the values in the host system 100 as the device ID (IDICM) 134 and the local write count (CNTL) 142. In such examples, the cache access manager 208, updates local write count (CNTL) 142 each time a write is performed to the intermittently connectable storage media device 106 and the write count (CNTICM) 138 is incremented in the intermittently connectable storage media device 106.
In the illustrated example, since the contents of the nonvolatile cache 122 are maintained or preserved after the intermittently connectable storage media device 106 is disconnected from the host system 100, the nonvolatile cache manager 118 allows processes to continue to issue data access requests corresponding to the intermittently connectable storage media device 106 (e.g., read requests intended to read data from one or more memory addresses of the intermittently connectable storage media device 106, write requests intended to write data to one or more memory addresses of the intermittently connectable storage media device 106, etc.). In this manner, the nonvolatile cache manager 118 may continue to allow such data access requests to be serviced until the nonvolatile cache 122 is full and/or until a data access request corresponds to data that is not locally cached in the nonvolatile cache 122 (e.g., the data would need to be accessed in the intermittently connectable storage media device 106). In the illustrated example, upon receiving a subsequent data access request corresponding to the intermittently connectable storage media device 106, the example cache manager 118 determines whether the data access request is a write operation (block 420). If the data access request is not a write operation, the cache access manager 208 handles the data access request as a read operation and determines whether the requested data causes a read hit in the nonvolatile cache 122 (block 422). In the illustrated example, if the requested data is locally cached in the nonvolatile cache 122 (e.g., a read hit), the cache access manager 208 cause the data to be read from the nonvolatile cache 122 (block 424). The example process of
If the example cache access manager 208 determines at block 420 that the data access request is a write operation, the cache access manager 208 determines whether there is sufficient available capacity in the nonvolatile cache 122 to service the write operation (block 426). If there is sufficient available capacity in the nonvolatile cache 122 to store data from the write operation, the cache access manager 208 allows the write operation to write data to the nonvolatile cache 122 (block 428). For example, the cache access manager 208 allows or notifies the I/O hub 110 to perform the write operation on the nonvolatile cache 122. The example process of
In the illustrated example of
If the comparator 210 determines at block 506 that there is a write count mismatch, the example metadata analyzer 212 (
If the metadata analyzer 212 determines at block 508 that cache data and corresponding non-cache data were not modified, the example cache access manager 208 associates the cache data in the nonvolatile cache 122 with the intermittently connectable storage media device 106 (block 514). If the metadata analyzer 212 determines at block 508 that cache data and/or corresponding non-cache data were modified, the example cache access manager 208 determines whether to keep the cache data in the nonvolatile cache 122 (block 510). For example, the host system 100 may prompt a user to select which one of the cache data in the nonvolatile cache 122 or the non-cache data in the intermittently connectable storage media device 106 to keep.
If the cache access manger 208 determines at block 510 to keep the cache data in the nonvolatile cache 122 (e.g., and discard, invalidate, and/or overwrite the non-cache data in the intermittently connectable storage media device 106), the example cache flush manager 206 flushes data from the cache data in the nonvolatile cache 122 to the intermittently connectable storage media device 106 (block 512). For example, the cache flush manager 206 flushes dirty writes from the nonvolatile cache 122 to the intermittently connectable storage media device 106. In the illustrated example, the cache flush from the nonvolatile cache 122 may result in overwriting a portion of a corresponding non-cache data in the intermittently connectable storage media device 106 or the entirety of the corresponding non-cache data. The example cache access manager 208 then associates the cache data in the nonvolatile cache 122 with the intermittently connectable storage media device 106 (block 514).
If the cache access manager determines at block 510 to keep the non-cache data in the intermittently connectable storage media device 106 (e.g., and discard, invalidate, and/or overwrite the cache data in the nonvolatile cache 122), control advances to block 516 at which the example cache access manager 208 disassociates the cache data in the nonvolatile cache 122 from the corresponding modified non-cache data in the intermittently connectable storage media device 106. For example, the cache access manager 208 may invalidate and discard the cache data in the nonvolatile cache 122 so that any subsequent accesses of the data are performed using the non-cache data in the intermittently connectable storage media device 106. The example nonvolatile cache manager 118 may perform the operations of blocks 508, 510, 512, 514, 516 a number of times to process any number of cache lines of data in the nonvolatile cache 122 and corresponding non-cache data stored in the intermittently connectable storage media device 106. In the illustrated example, the cache access manager 208 determines whether there is more data to analyze (block 518). If there is more data to analyze, control returns to block 508. Otherwise, the example process
The processor platform 600 of the illustrated example includes one or more processors 612. The processor(s) 612 may be used to implement the processor(s) 102 of
The processor 612 of the illustrated example includes a local memory 613 (e.g., a cache). The processor 612 of the illustrated example is in communication with a main memory including a volatile memory 614 and a nonvolatile memory 616 via a bus 618. In the illustrated example, the volatile memory 614 may be used to implement the volatile memory 108 of
The processor platform 600 of the illustrated example also includes an interface circuit 620. The interface circuit 620 may be implemented by any type of interface standard, such as an Ethernet interface, a universal serial bus (USB), and/or a PCI express interface.
In the illustrated example, one or more input devices 622 are connected to the interface circuit 620. The input device(s) 622 permit(s) a user to enter data and/or commands into the processor 612. The input device(s) can be implemented by, for example, an audio sensor, a microphone, a camera (still or video), a keyboard, a button, a mouse, a touchscreen, a track-pad, a trackball, isopoint and/or a voice recognition system.
One or more output devices 624 are also connected to the interface circuit 620 of the illustrated example. The output devices 624 can be implemented, for example, by display devices (e.g., a light emitting diode (LED), an organic light emitting diode (OLED), a liquid crystal display, a cathode ray tube display (CRT), a touchscreen, a tactile output device, a printer and/or speakers). The interface circuit 620 of the illustrated example, thus, typically includes a graphics driver card, a graphics driver chip and/or a graphics driver processor.
The interface circuit 620 of the illustrated example also includes a communication device such as a transmitter, a receiver, a transceiver, a modem and/or network interface card to facilitate exchange of data with external machines (e.g., computing devices of any kind) via a network 626 (e.g., an Ethernet connection, a digital subscriber line (DSL), a telephone line, coaxial cable, a cellular telephone system, etc.).
The processor platform 600 of the illustrated example also includes one or more mass storage devices 628 for storing software and/or data. Examples of such mass storage devices 628 include floppy disk drives, hard drive disks, compact disk drives, Blu-ray disk drives, RAID systems, and digital versatile disk (DVD) drives.
Coded instructions 632 used to implement the machine readable instructions of
Examples disclosed herein are useful to improve performance of data access corresponding to intermittently connectable media storage devices and to improve data consistency between local nonvolatile cache in a host system and intermittently connectable storage media devices connectable to the host system. For example, examples disclosed herein may be used to implement a nonvolatile cache on a primary/permanent nonvolatile storage device of a host system. When an intermittently connectable storage media device is removably connected to such host system, examples disclosed herein can be used to copy data from the intermittently connectable storage media device to the nonvolatile cache for fast data access from the nonvolatile cache. In addition, examples disclosed herein provide cache management techniques to manage data caching in the nonvolatile cache and to preserve data consistency between changes made to data in the nonvolatile cache and data in the intermittently connectable storage media even when such intermittently connectable storage media is abruptly or unexpectedly disconnected from the host system.
The following pertain to further examples disclosed herein.
Example 1 is an apparatus to manage intermittently connectable storage media. The apparatus of Example 1 includes a cache initializer to initialize a nonvolatile cache corresponding to an intermittently connectable storage media device connected to a host system; a cache flush manager to change a cache flush mode associated with the nonvolatile cache from a cache write through mode to a cache write back mode based on the intermittently connectable storage media device being disconnected from the host system; a cache access manager to: maintain the nonvolatile cache after the intermittently connectable storage media device is disconnected; and in response to a data access request corresponding to the intermittently connectable storage media device, perform a corresponding data access operation using the nonvolatile cache.
In Example 2, the subject matter of Example 1 can optionally include that the cache initializer is to initialize the nonvolatile cache by allocating the nonvolatile cache in nonvolatile storage fixedly mounted to the host system.
In Example 3, the subject matter of any one of Examples 1-2 can optionally include that after the intermittently connectable storage media device is reconnected to the host system, the cache access manager is further to: disassociate a first portion of the nonvolatile cache from the intermittently connectable storage media device based on the first portion of the nonvolatile cache corresponding to a data modified on the intermittently connectable storage media device relative to the first portion of the nonvolatile cache; and associate a second portion of the nonvolatile cache with the intermittently connectable storage media device based on the second portion of the nonvolatile cache corresponding to data not modified on the intermittently connectable storage media device relative to the second portion of the nonvolatile cache.
In Example 4, the subject matter of any one of Examples 1-3 can optionally include a comparator to determine that the intermittently connectable storage media device is reconnected to the host system based on a match between a first device identifier in the host system and a second device identifier in the intermittently connectable storage media device.
In Example 5, the subject matter of any one of Examples 1-4 can optionally include a comparator to determine that the first portion of the nonvolatile cache corresponds to the data modified on the intermittently connectable storage media device by: determining a mismatch between a first write count stored on the host system and a second write count of the intermittently connectable storage media device; and determining a mismatch between first file metadata corresponding to the first portion of the nonvolatile cache and second file metadata corresponding to the data modified on the intermittently connectable storage media device.
In Example 6, the subject matter of any one of Examples 1-5 can optionally include that the associating of the second portions of the nonvolatile cache with the intermittently connectable storage media device includes flushing dirty writes from the second portions of the nonvolatile cache to the intermittently connectable storage media device.
In Example 7, the subject matter of any one of Examples 1-6 can optionally include that the intermittently connectable storage media device is one of a removable memory card, a universal serial bus memory device, or a network attached storage device.
In Example 8, the subject matter of any one of Examples 1-7 can optionally include a network interface; and one or more processors in communication with the network interface, the one or more processors including the cache initializer, the cache flush manager, and the cache access manager.
Example 9 is at least one article of manufacture comprising machine readable instructions that, when executed, cause a processor to at least: initialize a nonvolatile cache corresponding to an intermittently connectable storage media device connected to a host system; based on the intermittently connectable storage media device being disconnected from the host system: change a cache flush mode associated with the nonvolatile cache from a cache write through mode to a cache write back mode; maintain the nonvolatile cache after the intermittently connectable storage media device is disconnected; and in response to a data access request corresponding to the intermittently connectable storage media device, perform a corresponding data access operation using the nonvolatile cache.
In Example 10, the subject matter of Example 9 can optionally include that the instructions are to initialize the nonvolatile cache by allocating the nonvolatile cache in nonvolatile storage fixedly mounted to the host system.
In Example 11, the subject matter of any one of Examples 9-10 can optionally include that the instructions are further to cause the processor to, after the intermittently connectable storage media device is reconnected to the host system: disassociate a first portion of the nonvolatile cache from the intermittently connectable storage media device based on the first portion of the nonvolatile cache corresponding to a data modified on the intermittently connectable storage media device relative to the first portion of the nonvolatile cache; and associate a second portion of the nonvolatile cache with the intermittently connectable storage media device based on the second portion of the nonvolatile cache corresponding to data not modified on the intermittently connectable storage media device relative to the second portion of the nonvolatile cache.
In Example 12, the subject matter of any one of Examples 9-11 can optionally include that the instructions are further to cause the processor to determine that the intermittently connectable storage media device is reconnected to the host system is based on a match between a first device identifier in the host system and a second device identifier in the intermittently connectable storage media device.
In Example 13, the subject matter of any one of Examples 9-12 can optionally include that the instructions are further to cause the processor to determine that the first portion of the nonvolatile cache corresponds to the data modified on the intermittently connectable storage media device by: determining a mismatch between a first write count stored on the host system and a second write count of the intermittently connectable storage media device; and determining a mismatch between first file metadata corresponding to the first portion of the nonvolatile cache and second file metadata corresponding to the data modified on the intermittently connectable storage media device.
In Example 14, the subject matter of any one of Examples 9-13 can optionally include that the instructions are to cause the processor to associate the second portions of the nonvolatile cache with the intermittently connectable storage media device by flushing dirty writes from the second portions of the nonvolatile cache to the intermittently connectable storage media device.
In Example 15, the subject matter of any one of Examples 9-14 can optionally include that the intermittently connectable storage media device is one of a removable memory card, a universal serial bus memory device, or a network attached storage device.
Example 16 is a method to manage intermittently connectable storage media. The method of Example 16 includes initializing a nonvolatile cache corresponding to an intermittently connectable storage media device connected to a host system; based on the intermittently connectable storage media device being disconnected from the host system: changing a cache flush mode associated with the nonvolatile cache from a cache write through mode to a cache write back mode; maintaining the nonvolatile cache after the intermittently connectable storage media device is disconnected; and in response to a data access request corresponding to the intermittently connectable storage media device, performing a corresponding data access operation using the nonvolatile cache.
In Example 17, the subject matter of Example 16 can optionally include that the initializing of the nonvolatile cache includes allocating the nonvolatile cache in nonvolatile storage fixedly mounted to the host system.
In Example 18, the subject matter of any one of Examples 16-17 can optionally include, after the intermittently connectable storage media device is reconnected to the host system: disassociating a first portion of the nonvolatile cache from the intermittently connectable storage media device based on the first portion of the nonvolatile cache corresponding to a data modified on the intermittently connectable storage media device relative to the first portion of the nonvolatile cache; and associating a second portion of the nonvolatile cache with the intermittently connectable storage media device based on the second portion of the nonvolatile cache corresponding to data not modified on the intermittently connectable storage media device relative to the second portion of the nonvolatile cache.
In Example 19, the subject matter of any one of Examples 16-18 can optionally include that the determining that the intermittently connectable storage media device is reconnected to the host system is based on a match between a first device identifier in the host system and a second device identifier in the intermittently connectable storage media device.
In Example 20, the subject matter of any one of Examples 16-19 can optionally include determining that the first portion of the nonvolatile cache corresponds to the data modified on the intermittently connectable storage media device by: determining a mismatch between a first write count stored on the host system and a second write count of the intermittently connectable storage media device; and determining a mismatch between first file metadata corresponding to the first portion of the nonvolatile cache and second file metadata corresponding to the data modified on the intermittently connectable storage media device.
In Example 21, the subject matter of any one of Examples 16-20 can optionally include that the associating of the second portions of the nonvolatile cache with the intermittently connectable storage media device includes flushing dirty writes from the second portions of the nonvolatile cache to the intermittently connectable storage media device.
In Example 22, the subject matter of any one of Examples 16-21 can optionally include that the intermittently connectable storage media device is one of a removable memory card, a universal serial bus memory device, or a network attached storage device.
Example 23 is an apparatus to manage intermittently connectable storage media. The apparatus of Example 23 includes means for initializing nonvolatile cache to initialize a nonvolatile cache corresponding to an intermittently connectable storage media device connected to a host system; means for flushing cached data to change a cache flush mode associated with the nonvolatile cache from a cache write through mode to a cache write back mode based on the intermittently connectable storage media device being disconnected from the host system; means for managing cache accesses to: maintain the nonvolatile cache after the intermittently connectable storage media device is disconnected; and in response to a data access request corresponding to the intermittently connectable storage media device, perform a corresponding data access operation using the nonvolatile cache.
In Example 24, the subject matter of claim 23 can optionally include that the means for initializing nonvolatile cache is to initialize the nonvolatile cache by allocating the nonvolatile cache in nonvolatile storage fixedly mounted to the host system.
In Example 25, the subject matter of any one of claims 23-24 can optionally include that, after the intermittently connectable storage media device is reconnected to the host system, the means for managing cache accesses is further to: disassociate a first portion of the nonvolatile cache from the intermittently connectable storage media device based on the first portion of the nonvolatile cache corresponding to a data modified on the intermittently connectable storage media device relative to the first portion of the nonvolatile cache; and associate a second portion of the nonvolatile cache with the intermittently connectable storage media device based on the second portion of the nonvolatile cache corresponding to data not modified on the intermittently connectable storage media device relative to the second portion of the nonvolatile cache.
In Example 26, the subject matter of any one of claims 23-25 can optionally include means for comparing to determine that the intermittently connectable storage media device is reconnected to the host system based on a match between a first device identifier in the host system and a second device identifier in the intermittently connectable storage media device.
In Example 27, the subject matter of any one of claims 23-26 can optionally include means for comparing to determine that the first portion of the nonvolatile cache corresponds to the data modified on the intermittently connectable storage media device by: determining a mismatch between a first write count stored on the host system and a second write count of the intermittently connectable storage media device; and determining a mismatch between first file metadata corresponding to the first portion of the nonvolatile cache and second file metadata corresponding to the data modified on the intermittently connectable storage media device.
In Example 28, the subject matter of any one of claims 23-27 can optionally include that the associating of the second portions of the nonvolatile cache with the intermittently connectable storage media device includes flushing dirty writes from the second portions of the nonvolatile cache to the intermittently connectable storage media device.
In Example 29, the subject matter of any one of claims 23-28 can optionally include that the intermittently connectable storage media device is one of a removable memory card, a universal serial bus memory device, or a network attached storage device.
In Example 30, the subject matter of any one of claims 23-29 can optionally include a network interface; and one or more processors in communication with the network interface, the one or more processors including the means for initializing nonvolatile cache, the means for flushing cached data, and the means for managing cache accesses.
Although certain example methods, apparatus and articles of manufacture have been disclosed herein, the scope of coverage of this patent is not limited thereto. On the contrary, this patent covers all methods, apparatus and articles of manufacture fairly falling within the scope of the claims of this patent.