1. Field of Invention
The present invention relates to the memory management, and more specifically to more efficient utilization of physical storage via creation of virtual sectors for unused space.
2. Background
Data that is consumed and/or created by electronic apparatuses may be retained in accordance with various memory implementations. Example memories for storing electronic data may be static or dynamic, may be removable from, or fixed within, apparatuses and may comprise electronic, electromechanical, magnetic and/or optical technologies. The particular configuration of memory that is implemented in an apparatus may depend on the operational requirements (or limitations) of the apparatus/system in which the memory is being utilized.
Memories for electronic data storage are typically divided into addressable units in which information may be stored (e.g., sectors). These addressable units are, in many cases, the smallest increment of memory into which data may be stored. Sectors may be grouped (e.g., in blocks) in order to expedite read and/or write activities, because managing a large number of sectors each on an individual basis may not be convenient with metadata structures becoming larger, and thus, requiring more storage space, etc. In particular, faster operation may be attained through accessing and storing the grouped sectors at substantially the same instance. While such group operation may be beneficial overall, program files or data that may be smaller than even a single sector must still occupy an entire block. This occurs because though the data is, in actuality, much smaller in size than an entire block of sectors, data must be read/written a full block at a time. Therefore, these small files/data must occupy an entire block of sectors.
In view of the above limitation, it is foreseeable that large portions of memories could remain unused when the information to be stored comprises many distinct data files that are substantially smaller than the read/write block size. Defragmentation cannot alleviate this problem as the data does not comprise fragmented parts of a larger file, and therefore, despite rearrangement the information will still be bound by the limitation of one file per memory block. As a result, large amounts of this type of file (e.g., individual files/data that are smaller that the smallest read/write unit, such as operating system files) will result in a sizable portion of unused memory space being wasted, which may be detrimental in apparatuses where memory is limited.
Various example embodiments of the present invention may be directed to a method, apparatus and computer program product for facilitating enhanced storage efficiency. Operational scenarios that include, for example, many distinct files that are smaller than the standard read/write block size in an apparatus may result in large portions of unused memory. According to various embodiments of the present invention, sectors that would have normally fallen within a block occupied by a small file may be replaced by “virtual” sectors. The virtual sectors may be mapped in an intermediate control level so that small files may still be read using a standard block size without wasting actual physical memory space. The physical sectors that were previously virtualized may then, for example, be used to “extend” the available memory.
In accordance with at least one example implementation, an apparatus may realize a need to access stored information. This may occur, for example, due to activity occurring at the program file (e.g., application) level within the apparatus. Upon identification of at least one read/write block in which the data is to be accessed resides, a determination may be made as to whether each logical sector address in the range of logical sector addresses comprised within the read/write block is a physical sector or a virtual sector. Virtual sectors may be “place holders” for logical sector addresses that are defined for short periods of time when data is being accessed by the intermediate control layer. Virtual sectors do not contain information, and may be used merely so that standard block reads/writes can be performed when accessing small files. For instance, the apparatus may determine that a logical sector address points to a physical sector if the address is higher than the address of the last virtual sector. This determination may be made using a table that maps the various virtual and physical sectors that are defined in the memory.
If a physical sector is identified by the logical address, the location of the physical sector may be resolved and information may be accessed and/or written. Otherwise, one or more alternative activities may occur as orchestrated by, for example, the intermediate control layer. Alternative activities may include such actions as responding with default or “dummy” data, returning no information, or returning a message or error indicating that the sector is virtual.
The foregoing summary includes example embodiments of the present invention that are not intended to be limiting. The above embodiments are used merely to explain selected aspects or steps that may be utilized in implementations of the present invention. However, it is readily apparent that one or more aspects, or steps, pertaining to an example embodiment can be combined with one or more aspects, or steps, of other embodiments to create new embodiments still within the scope of the present invention. Therefore, persons of ordinary skill in the art would appreciate that various embodiments of the present invention may incorporate aspects from other embodiments, or may be implemented in combination with other embodiments.
The invention will be further understood from the following description of various example embodiments, taken in conjunction with appended drawings, in which:
While the invention has been described below in terms of a multitude of example embodiments, various changes can be made therein without departing from the spirit and scope of the invention, as described in the appended claims.
An example of a system that is usable for implementing various embodiments of the present invention is disclosed in
Computing device 100 may be, for example, a laptop computer. Elements that represent basic example components comprising functional elements in computing device 100 are disclosed at 102-108. Processor 102 may include one or more devices configured to execute instructions. In at least one scenario, the execution of program code (e.g., groups of computer-executable instructions stored in a memory) by processor 102 may cause computing device 100 to perform processes including, for example, method steps that may result in data, events or other output activities. Processor 102 may be a dedicated (e.g., monolithic) microprocessor device, or may be part of a composite device such as an ASIC, gate array, multi-chip module (MCM), etc.
Processor 102 may be electronically coupled to other functional components in computing device 100 via a wired or wireless bus. For example, processor 102 may access memory 102 in order to obtain stored information (e.g., program code, data, etc.) for use during processing. Memory 104 may generally include removable or imbedded memories that operate in a static or dynamic mode. Further, memory 104 may include read only memories (ROM), random access memories (RAM), and rewritable memories such as Flash, EPROM, etc. Code may include any interpreted or compiled computer language including computer-executable instructions. The code and/or data may be used to create software modules such as operating systems, communication utilities, user interfaces, more specialized program modules, etc.
One or more interfaces 106 may also be coupled to various components in computing device 100. These interfaces may allow for inter-apparatus communication (e.g., a software or protocol interface), apparatus-to-apparatus communication (e.g., a wired or wireless communication interface) and even apparatus to user communication (e.g., a user interface). These interfaces allow components within computing device 100, other apparatuses and users to interact with computing device 100. Further, interfaces 106 may communicate machine-readable data, such as electronic, magnetic or optical signals embodied on a computer readable medium, or may translate the actions of users into activity that may be understood by computing device 100 (e.g., typing on a keyboard, speaking into the receiver of a cellular handset, touching an icon on a touch screen device, etc.) Interfaces 106 may further allow processor 102 and/or memory 104 to interact with other modules 108. For example, other modules 108 may comprise one or more components supporting more specialized functionality provided by computing device 100.
Computing device 100 may interact with other apparatuses via various networks as further shown in
Further, interaction with remote devices may be supported by various providers of short and long range wireless communication 140. These providers may use, for example, long range terrestrial-based cellular systems and satellite communication, and/or short-range wireless access points in order to provide a wireless connection to Internet 120. For example, personal digital assistant (PDA) 142 and cellular handset 144 may communicate with computing device 100 via an Internet connection provided by a provider of wireless communication 140. Similar functionality may be included in devices, such as laptop computer 146, in the form of hardware and/or software resources configured to allow short and/or long range wireless communication.
Now referring to
Memory 200 will be used for the sake of explanation in the following disclosure. However, it is important to note that the various example embodiments of the present invention are not limited to operation on this particular memory structure or solely in the disclosed manner. The principals or strategies disclosed herein may also be applied to other memory configurations.
In the example memory 200 disclosed in
Example operations involving memory 200 are disclosed in
While not extremely efficient, such operation may not create critical problems for systems having large amounts of memory 200 (e.g., servers, desktop/laptop/palmtop computers, etc.). However, apparatuses with memory, processing and/or power limitations may experience substantial negative impacts from this type of behavior. For instance, software in mobile devices is often designed to be compact given the limited amount of storage space. These apparatuses are also often powered by batteries, which means that power-conscious, and therefore simpler, interfaces may be implemented. These measures may result in the software for mobile devices comprising many small individual pieces. These small programs, files, interfaces, etc., while having being more efficient from the standpoint of execution, may actually be inefficient from the standpoint of storage as many sectors may be left unused due to the read/write block size.
Now referring to
Physical sectors that become available after being replaced by virtual sectors, or “virtualized” sectors, are also shown in
In at least one example implementation, intermediate layer 412 may be inserted between file system/application layer 410 and HW layer 414. In
In at least one example implementation, entities (e.g., applications) in file system layer 410 that attempt to access data residing in HW layer 414 will first access intermediate layer 412. In the example of
Blocks 202 in file system layer 410 that are not, to a large extent, filled (e.g., due to small file being stored in sectors 202) may be virtualized and reallocated, while the remaining sectors 202 may continue to operate in the manner of traditional physical sectors. The resulting total size of memory 200 may then be extended to N(physical sectors)+V(number of virtualized sectors). Optionally, addresses for sectors 202 may be calculated by deducting the addresses of virtual sectors from the total range of addresses, leaving only physical sectors remaining.
When a file system image may contain predefined files and folders, small static allocations may be detected and recorded as a configuration information when the image is first created in physical memory 200. Physical sectors 204 that are utilized in storing data for blocks of files/folders may be allocated normally, but physical sectors 204 that don't contain any data may be virtualized. Virtual sectors 416 may then make up the remainder sectors of the block(s).
In accordance with at least one embodiment of the present invention, an example of a virtualized sector table is shown at 500. Virtualized sector table 500 may comprise address information corresponding to both physical sectors being utilized to store information and virtual sectors taking the place of unused physical sectors. The address information may be utilized when determining what content, dummy content, error, etc. to return when a read block request includes a particular sector address. For example, when partitions made up of virtualized sectors are accessed, small allocation control layer 212 virtualizes the sectors which currently do not contain data. Virtualization may, for example, cause the sector number of the physical sector 204 which is not being used to store data (e.g., in the case of small files) to be adjusted so that it is skipped. As set forth above, the access request cannot never read or write virtualized sectors. Read operations could however return dummy data and write operations may just be skipped.
Now referring to
The process may then proceed to step 608 where accessing the current logical sector in the range of logical sectors within the one or more blocks to be accessed is completed. A determination may then be made in step 610 as to whether logical sectors remain in the range of sectors in the one or more blocks to be accessed. If logical sectors remain, the process may return to step 602 to determine if the current logical sector address is greater than the last virtual sector address. Otherwise, the process may return to step 600 to await the next access command.
If in step 602 the current logical sector address is determined to be less than the last virtual sector address, then in step 612 the current logical sector address may be analyzed in view of a sector table. This analysis may comprise, for example, comparing the current logical sector address to addresses listed in the sector table in order to determine whether the current logical address refers to a physical sector or a virtual sector. If the current logical sector address refers to a physical sector (e.g., the sector is not virtual as determined in step 614), the process then returns to step 604 to determine a location for the physical sector. Otherwise, the process proceeds to step 616 wherein an alternative activity is performed. Alternate activities may comprise, for example, returning default or dummy information, returning no information and/or returning a message (e.g., an error). The process then returns to step 608 wherein sector access is determined to be complete. The process may then reinitiate for the next sector if more sectors are determined to exist in step 610, or may return to step 600 to await the next access command.
The various embodiments of the present invention are not limited only to the examples disclosed above, and may encompass other configurations or implementations.
For example, example embodiments of the present invention may encompass apparatuses comprising means for identifying a requirement for accessing at least one read/write block in a memory, wherein the read/write block is identified by a range of logical sector addresses, means for determining whether each logical sector address in the range of logical sector addresses corresponds to a physical sector or a virtual sector, means for, if the address corresponds to a physical sector, determining the location of the physical sector and accessing the physical sector, and means for, if the address corresponds to a virtual sector, performing an alternative activity as defined by an intermediate control layer.
At least one other example embodiment of the present invention may include electronic signals that cause apparatuses to identify a requirement for accessing at least one read/write block in a memory, wherein the read/write block is identified by a range of logical sector addresses, determine whether each logical sector address in the range of logical sector addresses corresponds to a physical sector or a virtual sector, if the address corresponds to a physical sector, determining the location of the physical sector and access the physical sector, and if the address corresponds to a virtual sector, performing an alternative activity as defined by an intermediate control layer.
Accordingly, it will be apparent to persons skilled in the relevant art that various changes in form a and detail can be made therein without departing from the spirit and scope of the invention. The breadth and scope of the present invention should not be limited by any of the above-described example embodiments, but should be defined only in accordance with the following claims and their equivalents.