OPTIMIZING MEMORY USAGE TO ENABLE LARGER-SIZED DEPLOYMENTS AND CLIENT SERVICING
Memory usage can be optimized during an imaging process to enable larger-sized deployments and client servicing. A variety of components can be employed on a computing device to present a hybrid virtual volume to the operating system during an imaging process. The hybrid virtual volume will appear to the operating system as having a large size while consuming minimal amounts of memory and disk. As a result, the risk of the imaging process failing for lack of resources will be minimized even when the image is large.
N/A
BACKGROUNDImaging (or re-imaging) is oftentimes used to configure computing devices with an operating system, various applications and settings. For example, an enterprise may deploy to its computing devices a golden image containing a customized version of the Windows operating system and a set of applications that its employees may use. Imaging (or servicing) is also oftentimes used to update computing devices.
When an image is deployed to a computing device, an imaging tool will typically use a reserved portion of the hard drive as temporary storage for the image. For example, the image may be in the form of a file, which is a highly compressed format, that can be downloaded and temporarily stored on the reserved portion of the hard drive. To avoid consuming excessive amounts of the hard drive, which is where the image will ultimately be written, the imaging tool will typically use a RAMDisk as a temporary directory for extracting files from the compressed image and possibly for applying any customizations to the files. However, the use of a RAMDisk for this temporary directory reduces the amount of RAM that will be available to perform the imaging process. For these reasons, imaging tools, such as Window RE, Windows PE and Microsoft Endpoint Manager, are typically configured to create a relatively small RAMDisk (e.g., 32 MB) for use during an imaging process.
In recent years, the average size of images has increased substantially. This is true of both new and recovery images and security patches, updates, hotfixes or other quick fix engineering (QFE) images. With this increase in image size, the imaging (or servicing) process more frequently fails due to a lack of resources. For example, it is not uncommon for the Apply-Image operation of the Deployment Image Servicing and Management command line tool to fail due to insufficient RAMDisk space. It is also not uncommon for a Windows update to fail due to insufficient space on the hard drive, particularly in thin client scenarios.
BRIEF SUMMARYThe present invention extends to methods, systems and computer program products for optimizing memory usage to enable larger-sized deployments and client servicing. A variety of components can be employed on a computing device to present a hybrid virtual volume to the operating system during an imaging process. The hybrid virtual volume will appear to the operating system as having a large size while consuming minimal amounts of memory and disk. As a result, the risk of the imaging process failing for lack of resources will be minimized even when the image is large.
In some embodiments, the present invention may be implemented as a method for optimizing resource usage during an imaging process. An I/O helper service can maintain an allocation bitmap and a location bitmap for a virtual volume. The virtual volume encompasses memory and a disk of a computing device. In response to a first I/O request that attempts to write a file to the virtual volume, the file can be stored on the virtual volume by writing the file to the memory. The allocation bitmap and the location bitmap can be updated to indicate that the file is stored in the memory.
In some embodiments, the present invention may be implemented as computer storage media storing computer executable instructions which when executed on a computing device implement a method for optimizing resource usage during an imaging process. A first I/O request may be received. The first I/O request may attempt to write a first file to a virtual volume. It can be determined that the first file should be written to the virtual volume by storing the first file on a disk of the computing device, rather than in memory of the computing device. In conjunction with storing the first file on the disk, a location bitmap can be updated to identify that the first file is stored on the disk rather than in memory.
In some embodiments, the present invention may be implemented as a method for optimizing resource usage during an imaging process. An allocation bitmap can be maintained. The allocation bitmap can define whether each of a plurality of logical cluster numbers of a virtual volume is allocated. A location bitmap can be maintained. The location bitmap can define whether allocated logical cluster numbers of the plurality of logical cluster numbers are allocated in memory or on disk. I/O requests can be handled using the allocation bitmap and the location bitmap.
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter.
Understanding that these drawings depict only typical embodiments of the invention and are not therefore to be considered limiting of its scope, the invention will be described and explained with additional specificity and detail through the use of the accompanying drawings in which:
In accordance with one or more embodiments of the present invention, a file system filter 140, I/O helper service 160 and virtual volume driver 170 may also be installed on the computing device. File system filter 140 may be positioned above file system stack 130a so that it can process file system operations that target the file system on the C:\ volume before file system stack 130a receives such operations. Virtual volume driver 170 can function to create a virtual volume 180 which could span both disk 105 and memory 106 (i.e., a hybrid volume). File system stack 130b can provide access to a file system on virtual volume 180. As described in detail below, file system filter 140 may selectively route (e.g., reparse) file system operations that target the C:\ volume to virtual volume 180. As also described in detail below, I/O helper service 160 may interface with virtual volume driver 170 to manage virtual volume 180 including handling I/O requests that target virtual volume 180.
As introduced in the background, as part of an imaging process, imaging tool 150 will install a number of files to one or more directories on the C:\ volume. Typically, these files may be downloaded and temporarily stored (e.g., as part of a file) on a reserved volume on disk 105 and may be extracted and temporarily stored on a RAMDisk implemented in memory 106. File system filter 140, I/O helper service 160 and virtual volume driver 170 can interoperate in this context to ensure that a sufficient amount of disk 105 and memory 106 remains available throughout the imaging process to allow imaging tool 150 to complete the installation of the files to the C:\ volume, particularly in scenarios where the image may be large and/or when the size of disk 105 and/or memory 106 may be small.
Turning to
Turning to
Turning to
Turning to
Turning to
Turning to
In step 2b, for each I/O request, I/O helper service 160 can use the allocation and location bitmaps and the appropriate hash table to prepare a response that describes how virtual volume driver 170 should complete the I/O request using virtual volume 180. Then, in step 2c, virtual volume driver 170 can complete the I/O requests. Although not shown, virtual volume driver 170 may notify I/O helper service 160 of the completion of any I/O request to enable I/O helper service 160 to update the bitmaps, hash table or any other data structure appropriately.
Turning to
Turning to
A similar process can be performed for a read request. For example, when I/O helper service 160 is notified of a read request, it can determine whether an LCN that the read request targets is allocated and, if so, whether it is in memory 106 or on disk 105. I/O helper service 160 can then use the appropriate hash table to obtain the address where the file to read is stored and instruct virtual volume driver 170 to read it. The read content can then be stored in a buffer identified in the original read request and the read request can be completed. Again, the fact that the file is stored on virtual volume 180, which may span memory 106 and disk 105, is abstracted from imaging tool 150.
The examples above have generally assumed that a file maps to a single LCN. However, in practice, this oftentimes will not be the case. An LCN may typically be 4 KB in size, and therefore some files may span many LCNs. In such cases, each LCN that a file may encompass could be allocated in either memory 106 or disk 105 using the techniques described above. For example, a file may encompass 10 LCNs where five of the LCNs exist in memory 106 and five of the LCNs exist on disk 105. Using the allocation and location bitmaps and the hash tables, I/O helper service 160 can dynamically allocate/locate such LCNs to thereby minimize the consumption of resources on the computing device.
I/O helper service 160 may also be configured to handle trim (or delete) I/O operations in a manner that minimizes the amount of resources that virtual volume 180 consumes. When virtual volume driver 170 notifies I/O helper service 160 of a trim operation (e.g., by specifying one or more LCNs that are to be trimmed), I/O helper service 160 can use the allocation bitmap, location bitmap and the appropriate hash table(s) to identify the addresses where the LCNs are stored in memory 106 or disk 105. For any LCN that is stored in memory 106, I/O helper service 160 can cause the LCN (or the page to which the LCN is mapped) to be freed. For any LCN that is stored on disk 105, I/O helper service 160 can cause the LCN (or the page to which the LCN is mapped) to be freed. For example, if the LCN is mapped to a portion of the sparse file, I/O helper service 160 can cause virtual volume driver 170 to send a FSCTL_SET_ZERO_DATA command to zero out the range that the LCN encompasses. By using the FSCTL_SET_ZERO_DATA command, the operating system may unallocate the range of the sparse file thereby reducing the amount of disk 105 that virtual volume 180 consumes.
In summary, embodiments of the present invention can be implemented to minimize the amount of resources that are consumed during an imaging process. When embodiments of the present invention are implemented, larger images can be installed on a computing device without the risk that the computing device will run out of resources during the imaging process.
Embodiments of the present invention may comprise or utilize special purpose or general-purpose computers including computer hardware, such as, for example, one or more processors and system memory. Embodiments within the scope of the present invention also include physical and other computer-readable media for carrying or storing computer-executable instructions and/or data structures. Such computer-readable media can be any available media that can be accessed by a general purpose or special purpose computer system.
Computer-readable media is categorized into two disjoint categories: computer storage media and transmission media. Computer storage media (devices) include RAM, ROM, EEPROM, CD-ROM, solid state drives (“SSDs”) (e.g., based on RAM), Flash memory, phase-change memory (“PCM”), other types of memory, other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other similar storage medium which can be used to store desired program code means in the form of computer-executable instructions or data structures and which can be accessed by a general purpose or special purpose computer. Transmission media include signals and carrier waves.
Computer-executable instructions comprise, for example, instructions and data which, when executed by a processor, cause a general purpose computer, special purpose computer, or special purpose processing device to perform a certain function or group of functions. The computer executable instructions may be, for example, binaries, intermediate format instructions such as assembly language or P-Code, or even source code.
Those skilled in the art will appreciate that the invention may be practiced in network computing environments with many types of computer system configurations, including, personal computers, desktop computers, laptop computers, message processors, hand-held devices, multi-processor systems, microprocessor-based or programmable consumer electronics, network PCs, minicomputers, mainframe computers, mobile telephones, PDAs, tablets, pagers, routers, switches, and the like.
The invention may also be practiced in distributed system environments where local and remote computer systems, which are linked (either by hardwired data links, wireless data links, or by a combination of hardwired and wireless data links) through a network, both perform tasks. In a distributed system environment, program modules may be located in both local and remote memory storage devices. An example of a distributed system environment is a cloud of networked servers or server resources. Accordingly, the present invention can be hosted in a cloud environment.
The present invention may be embodied in other specific forms without departing from its spirit or essential characteristics. The described embodiments are to be considered in all respects only as illustrative and not restrictive. The scope of the invention is, therefore, indicated by the appended claims rather than by the foregoing description.
Claims
1. A method for optimizing resource usage during an imaging process, the method comprising:
- maintaining, by an I/O helper service, an allocation bitmap and a location bitmap for a virtual volume, the virtual volume encompassing memory and a disk of a computing device;
- in response to a first I/O request that attempts to write a file to the virtual volume, causing the file to be stored on the virtual volume by writing the file to the memory; and
- updating the allocation bitmap and the location bitmap to indicate that the file is stored in the memory.
2. The method of claim 1, wherein updating the allocation bitmap and the location bitmap to indicate that the file is stored in the memory comprises setting a first value in the allocation bitmap, the first value in the allocation bitmap being associated with a particular logical cluster number.
3. The method of claim 2, wherein updating the allocation bitmap and the location bitmap to indicate that the file is stored in the memory further comprises setting a first value in the location bitmap, the first value in the location bitmap being associated with the particular logical cluster number.
4. The method of claim 3, further comprising:
- creating a mapping between the particular logical cluster number and a particular address in the memory where the file is stored.
5. The method of claim 4, wherein the mapping is created in a hash table.
6. The method of claim 3, further comprising:
- in response to a second I/O request that attempts to read the file, accessing the allocation bitmap and the location bitmap to determine that the file is stored in the memory.
7. The method of claim 4, further comprising:
- in response to a second I/O request that attempts to read the file, accessing the allocation bitmap and the location bitmap to determine that the file is stored in the memory; and
- accessing the mapping to determine that the file is stored in the memory at the particular address.
8. The method of claim 7, further comprising:
- reading content of the file stored in the memory at the particular address to complete the second I/O request.
9. The method of claim 1, further comprising:
- in response to a second I/O request that attempts to write a second file to the virtual volume, causing the second file to be stored on the virtual volume by writing the second file to the disk; and
- updating the allocation bitmap and the location bitmap to indicate that the second file is stored on the disk.
10. The method of claim 9, wherein the second file is stored in a sparse file on the disk.
11. The method of claim 9, wherein the second file is caused to be stored on the virtual volume by writing the second file to the disk in response to determining that consumption of the memory exceeds a threshold.
12. The method of claim 9, further comprising:
- in response to a third I/O request that attempts to delete the second file from the virtual volume, accessing the allocation bitmap and the location bitmap to determine that the second file is stored on the disk;
- determining that the second file is stored on the disk at a particular address; and
- freeing the particular address on the disk.
13. The method of claim 12, wherein freeing the particular address on the disk comprises issuing an FSCTL_SET_ZERO_DATA command.
14. The method of claim 1, further comprising:
- reparsing the first I/O request.
15. One or more computer storage media storing computer executable instructions which when executed on a computing device implement a method for optimizing resource usage during an imaging process, the method comprising:
- receiving a first I/O request that attempts to write a first file to a virtual volume;
- determining that the first file should be written to the virtual volume by storing the first file on a disk of the computing device, rather than in memory of the computing device; and
- in conjunction with storing the first file on the disk, updating a location bitmap to identify that the first file is stored on the disk rather than in memory.
16. The computer storage media of claim 15, wherein the method further comprises:
- in conjunction with updating the location bitmap, mapping an address representing where the first file is stored on the disk to a logical cluster number of the first file.
17. The computer storage media of claim 16, wherein the method further comprises:
- receiving a second I/O request that attempts to read the first file on the virtual volume;
- accessing the location bitmap to determine that the first file is stored on the disk;
- accessing the mapping to obtain the address; and
- reading the first file using the address.
18. The computer storage media of claim 17, wherein the first file is stored as part of a sparse file on the disk.
19. The computer storage media of claim 18, wherein the method further comprises:
- receiving a third I/O request that attempts to delete the first file from the virtual volume;
- accessing the location bitmap to determine that the first file is stored on the disk;
- accessing the mapping to obtain the address; and
- deleting the first file by causing a range of the sparse file to be filled with zeros, the range being defined by the address.
20. A method for optimizing resource usage during an imaging process, the method comprising:
- maintaining an allocation bitmap that defines whether each of a plurality of logical cluster numbers of a virtual volume is allocated;
- maintaining a location bitmap that defines whether allocated logical cluster numbers of the plurality of logical cluster numbers are allocated in memory or on disk; and
- handling I/O requests using the allocation bitmap and the location bitmap.
Type: Application
Filed: Jun 7, 2021
Publication Date: Dec 8, 2022
Inventors: Gokul Thiruchengode Vajravel (Bangalore), Vishal Kumar Singh (East Singhbum)
Application Number: 17/341,055