Patent Description:
Files are a type of data structure that are used by applications to manage user data. As such, efficient processing, storage, security, and general management of the data is important to information technology (IT) systems. Applications use and depend upon file systems, operating systems (OSs), and other such system software for file management and access related operations.

Solid state drives (SSDs) are components of persistent data storage for modern IT infrastructure, as vast amounts of data are being generated by various applications, such as, for example, Internet of things (IOT), social networks, autonomous vehicles, etc. NAND flash media based SSD storage devices are also components of the IT infrastructure.

When applications require data, the desired data portions of stored files are fetched from an SSD storage device. Since SSDs provide high performance persistent storage, some system performance bottlenecks have shifted towards system software layers. File read latency of such operations is an important factor in the performance and end-user experience of applications (e.g., gaming and online shopping applications).

<CIT> discloses: A storage device includes: a nonvolatile storage including a first region and a second region, a storage controller controlling operation of the nonvolatile storage, and a buffer memory connected to the storage controller. The storage controller stores user data received from a host device in the second region, stores metadata associated with management of the user data and generated by a file system of the host device in the first region, loads the metadata from the first region to the buffer memory in response to address information for an index node (inode) associated with the metadata, and accesses the target data in the second region using the metadata loaded to the buffer memory.

<CIT> discloses: A system for facilitating data organization. The system receives a request which indicates a file to be read from a non-volatile storage, which is divided into a plurality of logical chunks, wherein a chunk is divided into a plurality of bulks. The system determines a chunk index, a first offset between a beginning of the file and a beginning of a chunk corresponding to the chunk index, and a requested length of the file. The system calculates a bulk index for the requested file based on the chunk index and the first offset. The system identifies a location in the non-volatile storage based on the bulk index. The system reads the requested file from the identified location in the non-volatile storage based on the requested length.

Hereinafter, embodiments of the present disclosure are described in detail with reference to the accompanying drawings. It should be noted that the same elements will be designated by the same reference numerals although they are shown in different drawings. In the following description, specific details such as detailed configurations and components are merely provided to assist with the overall understanding of the embodiments of the present disclosure. Therefore, it should be apparent to those skilled in the art that various changes and modifications of the embodiments described herein may be made. In addition, descriptions of well-known functions and constructions are omitted for clarity and conciseness. The terms described below are terms defined in consideration of the functions in the present disclosure, and may be different according to users, intentions of the users, or customs. Therefore, the definitions of the terms should be determined based on the contents throughout this specification.

The present disclosure may have various modifications and various embodiments, among which embodiments are described below in detail with reference to the accompanying drawings. However, it should be understood that the present disclosure is not limited to the embodiments, but includes all modifications, equivalents, and alternatives within the scope of the appended claims.

The electronic device according to one embodiment may be one of various types of electronic devices utilizing storage devices and/or non-volatile memory express (NVMe). The electronic devices may include, for example, a portable communication device (e.g., a smart phone), a computer, a portable multimedia device, a portable medical device, a camera, a wearable device, or a home appliance. According to one embodiment of the disclosure, an electronic device is not limited to those described above.

The terms used in the present disclosure are not intended to limit the present disclosure but are intended to include various changes, equivalents, or replacements for a corresponding embodiment. With regard to the descriptions of the accompanying drawings, similar reference numerals may be used to refer to similar or related elements. A singular form of a noun corresponding to an item may include one or more of the things, unless the relevant context clearly indicates otherwise. As used herein, terms such as "<NUM>st," "2nd," "first," and "second" may be used to distinguish a corresponding component from another component, but are not intended to limit the components in other aspects (e.g., importance or order). It is intended that if an element (e.g., a first element) is referred to, with or without the term "operatively" or "communicatively", as "coupled with," "coupled to," "connected with," or "connected to" another element (e.g., a second element), it indicates that the element may be coupled with the other element directly (e.g., wired), wirelessly, or via a third element.

As used herein, the term "module" may include a unit implemented in hardware, software, firmware, or combination thereof, and may interchangeably be used with other terms, for example, "logic," "logic block," "part," and "circuitry. " A module may be a single integral component, or a minimum unit or part thereof, adapted to perform one or more functions. For example, according to one embodiment, a module may be implemented in a form of an application-specific integrated circuit (ASIC).

File data structures are used by applications to organize and manage user data. Applications process large and varied amount of user data as part of their execution. Applications may generate new data and/or access data generated by other applications. Applications often process data and transform that data to generate new data items. The end user experience of the applications often depends upon efficient data processing and sharing.

At a basic level, a file name can denote a block of unique user data. The user data may have unique and different formats, organization, layouts, and meanings. The applications that process that data may understand the semantics of such data. However, beyond the semantics, such data must be preserved persistently in storage media. Also, such data can be protected against various physical degrading effects, can be made available to the applications when needed, can be protected for security and privacy, and, at times, can be shared with other data processing processes. These aspects of data management can be agnostic to the semantics of the data.

Files are data structures to manage these data semantics agnostic aspects of the user data, and user applications depend upon other system software layers such as file systems to manage those aspects. File system themselves use services and the assistance of many other software and hardware components to achieve the desired data management functions. Some examples of such software components are operating systems (OSs), application programming interface (API) libraries, and various drivers. Some examples of hardware components are storage devices, redundant array of independent disks (RAID) controllers, network interface cards, etc..

Applications may use file system APIs to create files, store data into those files, and read data from the files for processing. File systems implement APIs that can be used by the applications to perform above functions. File systems and the software and hardware components implemented for this purpose are extremely complex.

For example, relatively complex algorithms can be used to achieve desired data management functions. Such complexity may result in longer execution times of data read and write operations for the applications. The data read operation latency may be a relevant factor for the applications. Longer data read times may manifest as sluggish user experiences or as user interface freeze or perceived hangs. Hence, it may be desirable to reduce and optimize data read latencies.

For example, a longer latency to update game scenes could make a gaming experience less enjoyable to a gamer, and the gamer may lose interest in that gaming system. Similarly, sluggish online shopping systems may result in the loss of valuable potential customers.

In accordance with an aspect of the disclosure, a system and method are provided to improve file read latency by avoiding traversal of some of the system software layers and performing some of the look-up functions in advance. That is, an application may send file read requests directly to a storage device instead of going through the file system. By sending the file read requests directly to the storage device, some overhead in the system software stack is bypassed. Specifically, the file pointer to logical block address (LBA) look-up steps are bypassed in the system software and are performed efficiently in the attached storage device.

To achieve such an efficient file read operation, some file system functions may be modified to monitor and mirror the file pointer to LBA mapping table to the SSD Controller. The SSD controller architecture may be optimized to maintain and use an OFT to keep file pointer, LBA, and PBA mappings. The SSD Controller accepts direct file read requests and then obtains PBAs from the OFT. The file read calls issued by the applications may be directly sent to the SSD Controller using a storage protocol such as NVMe or similar protocols. After the desired PBAs are identified, the SSD controller directly deposits user data into the application buffers, thereby significantly improving file data read latency.

The OFT may include at least one of a file pointer column, an LBA list column, a PBA list column, and a file read offset column. The file data may be provided to the application using the file read offset column. The file read calls may include an amount of data to be read from the memory and a file read offset, and the file read offset column may be updated using the file read offset of the file read calls. An updated file pointer-LBA list mapping for an entry of the OFT may be received from the host device, and the entry of the OFT may be updated with PBA list information retrieved based on the mapping.

While an LBA-based system architecture is described herein, the embodiments are not limited thereto and are equally applicable to key/value or other object based storage system architectures.

According to an embodiment, a system and method are provided, in which the file read operation is intercepted and directly sent to an SSD controller, instead of going through the file system, in order to improve latency. An example of file read operation by an application is shown below in Table <NUM>.

<FIG> is a flowchart illustrating a file read operation. When an fread() function call <NUM> is executed, the file pointer (file handle or file descriptor) is used by a file system layer <NUM> to look-up file system blocks associated with that file, at <NUM>. At a storage block layer <NUM>, the file system blocks are converted to corresponding storage blocks or sectors, referred to as LBAs, at <NUM>. The storage block layer <NUM> and a storage device driver layer <NUM> send a storage input/output (I/O) read command to the SSD, at <NUM>. In an SSD controller (flash translation layer <NUM>), the LBAs are converted into NAND flash media PBAs, at <NUM>. The user data is read from NAND flash media <NUM> and returned to the application.

As shown in <FIG>, a file read operation traverses multiple system software layers to fetch the user data. These translations and traversals through the system software layers add latency.

According to an embodiment, some of the translation steps described above may be performed in advance, to avoid latency.

An SSD controller maintains Table <NUM> in the SSD device. The file pointer and LBA list columns are updated by new file system function calls described in detail below. The PBA list column is initialized and maintained by the SSD controller. The file read offset column may be updated by the host and the SSD controller.

According to an embodiment, a set of new file operation function calls includes:.

Other file system APIs can also be modified in similar fashion to assist with the proposed mechanism. The SSD controller architecture is optimized to create, update, maintain, and use the OFT to return user data in an expedited manner.

The application code example of Table <NUM> is shown in Table <NUM> below using the new file operation function calls.

<FIG> is a flowchart illustrating an fopen_OFT() call at a host device, according to an embodiment. Any components or any combination of the components described in <FIG> and <FIG> can be used to perform one or more of the operations in the flowchart. The operations are exemplary and may involve various additional steps that are not explicitly described. The temporal order of the operations may be varied.

An fopen_OFT() function call <NUM> of Table <NUM> is used by an application in place of an fopen() function call of Table <NUM>. This function call internally opens a specified file with the file system to obtain a file pointer, at <NUM>. The function call queries the file system with the file pointer using file system software, at <NUM>, and obtains associated file system blocks, at <NUM>. The function call then queries the storage block layer with the file system block using storage block layer system software, at <NUM>, and obtains an associated LBA mapping for the file system blocks, at <NUM>. Once the LBA mapping for the file is obtained, the fopen_OFT() function call programs the file pointer and LBA mappings in the associated SSD controller, at <NUM>. This programming may be achieved through SSD driver software, such as, for example, an NVMe device driver, and may use vendor defined NVMe commands. After the mappings are provided to the SSD controller, the function call returns.

It may also be possible to use fopen_OFT() to initialize an offset column value to zero (or another value).

As described above, the fopen_OFT() function call passes the file pointer and LBA mappings to the SSD controller. The SSD controller may receive this information in the form of vendor defined NVMe commands. The SSD controller allocates a free entry in the OFT and records the file pointer, LBA mapping. The SSD controller also updates the associated LBA, PBA mapping in the OFT. The PBA address may include a Flash channel identifier, a NAND die index, a plane, a block ID, a page number, etc. The PBA address is used to read the user data from Flash media and send the read user data back to the host device.

The SSD controller may also update the PBA column of the OFT during a garbage collection (GC) process. At times, user data stored in the NAND flash media is moved to different physical locations for reasons such as retention, bad block management, recycling, etc. Hence, an SSD controller should update the LBA, PBA mapping if and when such events occur.

<FIG> is a flowchart illustrating a method for updating a PBA column of an OFT at an SSD controller, according to an embodiment. Any components or any combination of the components described in <FIG> and <FIG> can be used to perform one or more of the operations in the flowchart. The operations are exemplary and may involve various additional steps that are not explicitly described. The temporal order of the operations may be varied.

Based on an update_PBA_OFT() function call <NUM>, the SSD controller detects a PBA-LBA mapping change due to GC, at <NUM>. The SSD controller retrieves LBA from the OFT, at <NUM>, and updates PBA information in the OFT entry based on an LBA-PBA flash translation layer (FTL) table, at <NUM>, after which the function call returns. Alternatively, in response to the update_PBA_OFT() function call <NUM>, the SSD controller receives file pointer(s), LBA tuples from the host device, at <NUM>. At <NUM>, the SSD controller determines whether all received entries are updated. In the case that all received entries are not updated, the SSD controller looks up the LBA-PBA flash translation layer (FTL) table, at <NUM>, and the SSD controller updates PBA information in the OFT entry, at <NUM>. When all received entries are updated, the function call returns.

Accordingly, host software and SSD controller FTL firmware keep the OFT up-to-date so that it can be used by the applications during data read. Applications use a new, optimized file read function call, as shown in Table <NUM>.

<FIG> is a flowchart illustrating an fread_OFT() function call at a host device, according to an embodiment. Any components or any combination of the components described in <FIG> and <FIG> can be used to perform one or more of the operations in the flowchart. The operations are exemplary and may involve various additional steps that are not explicitly described. The temporal order of the operations may be varied.

An fread_OFT() function call <NUM>, of a host device <NUM>, directly communicates with an SSD controller and sends the file pointer, amount of data to read, and optionally, an offset to read from, at <NUM>. The fread_OFT() function call may send this information using a vendor defined NVMe command to the SSD controller. This function call then awaits the SSD controller to provide the data via direct memory access (DMA), at <NUM>. At <NUM>, the function returns.

<FIG> is a flowchart illustrating an fread_OFT() function call at an SSD controller, according to an embodiment. Any components or any combination of the components described in <FIG> and <FIG> can be used to perform one or more of the operations in the flowchart. The operations are exemplary and may involve various additional steps that are not explicitly described. The temporal order of the operations may be varied.

An SSD controller <NUM> receives a vendor defined NVMe command having information provided by an fread_OFT() function call <NUM>, at <NUM>. After receiving the command, the SSD controller <NUM> looks up the file pointer entry in the OFT, and obtains the list of PBAs associated with that file, at <NUM>. The SSD controller <NUM> then reads the appropriate user data from the NAND flash media using the PBAs, at <NUM>. The SSD controller <NUM> sends the read user data back to the user application (e.g., host memory buffer) via DMA, at <NUM>, and completes the NVMe command, at <NUM>.

If the command indicates any specific offset read address, the SSD controller uses that while returning the data. If the command does not specify any read offset, the SSD controller may use the offset from the OFT to return the data. After returning the data, the SSD controller may update the new file offset value in the OFT against the file pointer entry, at <NUM>. By default, the OFT entry of an offset is zero when the entry is created.

According to an embodiment, an fwrite_OFT() function call can be used to update the file pointer and associated LBAs in an OFT when data is written to a file. Although the file write operations may not be in the read latency critical path, some use cases and applications may benefit from updating the OFT after data write. Alternatively, other data write related file system calls, such as fflush() and fsync(), can be supported with similar systems and methods.

Host software may use another function call, such as fseek_OFT(), to reset or change the read offset value in the OFT. When the SSD controller receives a new offset value for a given file pointer from the host device, it may update the corresponding OFT entry. Once the OFT entry is updated, the new offset value may be used for subsequent user data read operations for that file.

An fclose_OFT() function call may reset the offset entry when a file is closed. It may also instruct (or request) the SSD controller to remove the file pointer entry from the OFT. An SSD controller that receives the request from host software, may update the OFT as requested.

<FIG> illustrates a block diagram of an electronic device <NUM> in a network environment <NUM>, according to one embodiment. The electronic device <NUM> may communicate with the electronic device <NUM> via the server <NUM>. The electronic device <NUM> may include a processor <NUM>, a memory <NUM>, an input device <NUM>, a sound output device <NUM>, a display device <NUM>, an audio module <NUM>, a sensor module <NUM>, an interface <NUM>, a haptic module <NUM>, a camera module <NUM>, a power management module <NUM>, a battery <NUM>, a communication module <NUM>, a subscriber identification module (SIM) <NUM>, or an antenna module <NUM>. In one embodiment, at least one (e.g., the display device <NUM> or the camera module <NUM>) of the components may be omitted from the electronic device <NUM>, or one or more other components may be added to the electronic device <NUM>. In one embodiment, some of the components may be implemented as a single integrated circuit (IC). For example, the sensor module <NUM> (e.g., a fingerprint sensor, an iris sensor, or an illuminance sensor) may be embedded in the display device <NUM> (e.g., a display).

The processor <NUM> may execute, for example, software (e.g., a program <NUM>) to control at least one other component (e.g., a hardware or a software component) of the electronic device <NUM> coupled with the processor <NUM>, and may perform various data processing or computations. As at least part of the data processing or computations, the processor <NUM> may load a command or data received from another component (e.g., the sensor module <NUM> or the communication module <NUM>) in volatile memory <NUM>, process the command or the data stored in the volatile memory <NUM>, and store resulting data in non-volatile memory <NUM>. The processor <NUM> may include a main processor <NUM> (e.g., a CPU or an application processor (AP)), and an auxiliary processor <NUM> (e.g., a graphics processing unit (GPU), an image signal processor (ISP), a sensor hub processor, or a communication processor (CP)) that is operable independently from, or in conjunction with, the main processor <NUM>. Additionally or alternatively, the auxiliary processor <NUM> may be adapted to consume less power than the main processor <NUM>, or execute a particular function. The auxiliary processor <NUM> may be implemented as being separate from, or a part of, the main processor <NUM>.

The auxiliary processor <NUM> may control at least some of the functions or states related to at least one component (e.g., the display device <NUM>, the sensor module <NUM>, or the communication module <NUM>) among the components of the electronic device <NUM>, instead of the main processor <NUM> while the main processor <NUM> is in an inactive (e.g., sleep) state, or together with the main processor <NUM> while the main processor <NUM> is in an active state (e.g., executing an application). According to one embodiment, the auxiliary processor <NUM> (e.g., an image signal processor or a communication processor) may be implemented as part of another component (e.g., the camera module <NUM> or the communication module <NUM>) functionally related to the auxiliary processor <NUM>.

The communication module <NUM> may include one or more communication processors that are operable independently from the processor <NUM> (e.g., the AP) and supports a direct (e.g., wired) communication or a wireless communication. According to one embodiment, the communication module <NUM> may include a wireless communication module <NUM> (e.g., a cellular communication module, a short-range wireless communication module, or a global navigation satellite system (GNSS) communication module) or a wired communication module <NUM> (e.g., a local area network (LAN) communication module or a power line communication (PLC) module). A corresponding one of these communication modules may communicate with the external electronic device via the first network <NUM> (e.g., a short-range communication network, such as Bluetooth™, wireless-fidelity (Wi-Fi) direct, or a standard of the Infrared Data Association (IrDA)) or the second network <NUM> (e.g., a long-range communication network, such as a cellular network, the Internet, or a computer network (e.g., LAN or wide area network (WAN)). These various types of communication modules may be implemented as a single component (e.g., a single IC), or may be implemented as multiple components (e.g., multiple ICs) that are separate from each other.

According to one embodiment, commands or data may be transmitted or received between the electronic device <NUM> and the external electronic device <NUM> via the server <NUM> coupled with the second network <NUM>.

According to one embodiment, each component (e.g., a module or a program) of the above-described components may include a single entity or multiple entities. One or more of the above-described components may be omitted, or one or more other components may be added. In this case, the integrated component may still perform one or more functions of each of the plurality of components in the same or similar manner as they are performed by a corresponding one of the plurality of components before the integration. Operations performed by the module, the program, or another component may be carried out sequentially, in parallel, repeatedly, or heuristically, or one or more of the operations may be executed in a different order or omitted, or one or more other operations may be added.

<FIG> illustrates a diagram of a storage system <NUM>, according to an embodiment. The storage system <NUM> includes a host <NUM> and a storage device <NUM>. Although one host and one storage device is depicted, the storage system <NUM> may include multiple hosts and/or multiple storage devices. The storage device <NUM> may be a solid state device (SSD), a universal flash storage (UFS), etc. The storage device <NUM> includes a controller <NUM> and a storage medium <NUM> connected to the controller <NUM>. The controller <NUM> may be an SSD controller, a UFS controller, etc. The storage medium <NUM> may include a volatile memory, a non-volatile memory, or both, and may include one or more flash memory chips (or other storage media). The controller <NUM> may include one or more processors, one or more error correction circuits, one or more field programmable gate arrays (FPGAs), one or more host interfaces, one or more flash bus interfaces, etc., or a combination thereof. The controller <NUM> may be configured to facilitate transfer of data/commands between the host <NUM> and the storage medium <NUM>. The host <NUM> sends data/commands to the storage device <NUM> to be received by the controller <NUM> and processed in conjunction with the storage medium <NUM>. As described herein, the methods, processes and algorithms may be implemented on a storage device controller, such as controller <NUM>. The arbiters, command fetchers, and command processors may be implemented in the controller <NUM> of the storage device <NUM>, and the processors and buffers may be implemented in the host <NUM>.

Claim 1:
A method of a storage device, comprising:
receiving (<NUM>), from an application at a host device (<NUM>), at a controller (<NUM>) of the storage device (<NUM>), a read command comprising at least a file pointer of a file;
retrieving (<NUM>), at the controller (<NUM>), a physical block address, PBA, list associated with file data from a table maintained at the controller (<NUM>) using the file pointer; and
reading (<NUM>), by the controller (<NUM>), the file data from a memory using the PBA list, and providing (<NUM>) the file data, from the controller (<NUM>), to the application at the host device (<NUM>),
wherein the table comprises an offloaded file table, OFT, that comprises a file pointer column, a logical block address, LBA, list column, a PBA list column, and a file read offset column;
receiving (<NUM>), from the host device (<NUM>), at the controller (<NUM>), an updated file pointer-LBA list mapping for an entry of the OFT;
retrieving (<NUM>), by the controller (<NUM>), PBA list information from a flash translation layer, FTL, table based on the updated file pointer-LBA list mapping; and
updating (<NUM>), by the controller (<NUM>), the entry of the OFT with the retrieved PBA list information,
wherein the read command further comprises an amount of file data to be read from the memory and a file read offset, and
wherein the file data is provided to the application using the file read offset of the read command, and the file read offset column is updated using the file read offset of the read command.