The field of the invention relates generally to input/output (I/O) scheduling on smartphones, tablets and other electronic communication devices, and more particularly to an I/O scheduling method that prioritizes read operations ahead of write operations in order to reduce delays associated with application launches and delays occurring during application run-time.
The number of smartphones and computer tablets used worldwide increases each year. Moreover, smartphone and tablet users are increasingly using their devices for work-related activities including processing emails, reading and revising documents, etc. As reliance on these types of electronic devices increases, so does an expectation of improved performance. In particular, reducing application time delays (that typically occur during the launch of an application) can greatly improve user productivity. Many user interactions with smartphones are short in duration, and many smartphone/tablet applications are used for less than a couple of minutes. With such brief interactions, application launches need to be rapid and responsive. However, many applications (or “apps” as they are also well-known) incur significant time delays (e.g., up to 10 seconds) during launch and run-time. See, for example, T. Yan et al., “Fast app launching for mobile devices using predictive user context,” ACM MobiSys 2012. Time delays associated with application launch can be frustrating when a user has to wait many seconds for an application to start and they only want to use the application very briefly. Addressing this issue can improve the performance of a variety of electronic devices such as laptop computers, smartphones, tablets, and wearable computing devices.
Accordingly, it is an object of the present invention to provide a method that reduces application delays on electronic devices.
In accordance with the present invention, a method is provided for scheduling input/output (I/O) requests for an electronic device. The electronic device has storage media and runs at least one application. Each application interfaces with the storage media through an I/O path. Each application issues I/O requests requiring access to the storage media. The I/O requests include reads from the storage media and writes to the storage media. The I/O requests are ordered in the I/O path such that the reads are assigned a higher priority than the writes. The I/O requests are dispatched from the I/O path to the storage media in accordance with ordering step such that the reads are dispatched before the writes. The scheduling method can also apply concurrency parameters for the electronic device. The concurrency parameters define the optimal number of reads that can be concurrently dispatched to the storage media and the optimal number of writes that can be concurrently dispatched to the storage media. In this scenario, the dispatching step is carried out by concurrently dispatching to the storage media a plurality of reads or a plurality of writes as defined by the concurrency parameters.
The summary above, and the following detailed description, will be better understood in view of the drawings that depict details of preferred embodiments.
The present invention is an input/output (I/O) scheduling method that can be installed on a variety of electronic devices to include smartphones, laptop computers, tablets, and wearable computing devices. The I/O scheduling method comprises a set of computer-readable and executable instructions installed on a device's computer-readable storage media such that the method's specific operations are performed on the device. The set of computer-readable instructions defining the I/O scheduling method can be provided as an additional scheduling routine on a device, an exclusive scheduling routine on a device, or as a scheduling routine modification that works within the framework of an existing scheduling routine, without departing from the scope of the present invention. In general, the I/O scheduler of the present invention introduces a prioritization scheme that prioritizes read operations (i.e., sequential reads and random reads) ahead of write operations (i.e., sequential writes and random writes). In addition, the I/O scheduler of the present invention can cluster higher-priority read operations or lower-priority write operations for concurrent dispatch in an optimal fashion for the particular device.
Prototype testing of the present invention was implemented on Android-based smartphones across 40 popular applications from four groups (i.e., games, streaming, sensing, and miscellaneous). The I/O scheduler of the present invention reduced launch delays by up to 37.8%, and run-time delays by up to 29.6%, while also reducing power consumption by 6%. Details of the prototype testing and results can be found in “Reducing Smartphone Application Delay Through Read/Write Isolation,” D. T. Nguyen et al., ACM MobiSys '15, May 2015, the entire contents of which are hereby incorporated by reference.
The prototype testing described in the above-cited reference included measurement experiments yielding important smartphone application performance characteristics, several of which are summarized herein. A first performance characteristic is that Android devices spend a significant portion of their CPU active time waiting for storage I/Os to complete. Specifically, the measurement experiments indicated that 40% of the tested devices had I/O wait values (e.g., iowait in an Android device is the percentage of time that the CPUs were idle during which the system had an outstanding disk I/O request, which simply means the time spent waiting for disk I/Os to complete) between 13% and 58% that negatively affect a smartphone's overall application performance resulting in slow response time. The experiments studied slowdown of one type of I/O due to the presence of another type of I/O, and revealed a significant slowdown of reads in the presence of writes. A significant read slowdown can negatively impact an application's performance during cycles when the number of reads dominates the number of I/O requests as is generally the case during the launch of an application. A second performance characteristic of Android devices is that the impact of read/write slowdown on an application's delay can vary depending on the slowdown ratio of a read and a write. In general, the experiments revealed that the slowdown ratio for sequential reads was approximately six times greater than the slowdown ratio for sequential writes, and that the slowdown ratio for random reads was several times greater than the slowdown ratio for random writes. Slowdown ratios are calculated as follows:
Read Slowdown Ratio=(Response time of a read in the presence of a concurrent write)/(Response time of a read when running alone)
Write Slowdown Ratio=(Response time of a write in the presence of a concurrent read)/(Response time of a write when running alone)
Prior to explaining the present invention, reference will be made to
By way of an illustrative example, the present invention will be explained for its use with a smartphone running on the Android platform. However, it is to be understood that the present invention can be applied to other operating platforms without departing from the scope of the present invention. Referring now to
A cache (memory) 20 provides a limited amount of temporary storage for quick/efficient I/O request handling as is well known in the art. The policy governing cache 20 can affect the power used to carry out the I/O activities along the I/O path. Two well-known caching policies are “write back” and “write through”. Write-back is the default approach used in smartphones which in practice means that the device signals I/O completion to the operating system before data has hit the storage media. In contrast, a write-through cache performs all write operations in parallel with data written to the cache and the storage media simultaneously.
A file system 22 defines the various file types used. There are several system types used by smartphone vendors. Each flash partition can be formatted in a different file system type before being properly mounted to given namespaces such as /data, /system, or /cache. Most frequently used file systems are YAFFS2, ext2, ext3, and ext4. YAFFS2 is used, for instance, in HTC Hero of Google Nexus One. Ext4 is employed in the most recent Android smartphones such as Samsung Galaxy or Samsung Nexus S.
A block layer 24 has the primary function of scheduling I/O requests from application(s) 12 and sending them down to a device driver 26. Device driver 26 gets I/O requests (i.e., read requests and write requests) from block layer 24 and does whatever is needed to process them before sending back a notification to block layer 24. The Linux kernels on current Android smartphones offer three scheduling algorithms known as CFQ, Deadline, and Noop. CFQ (Complete Fair Queuing) attempts to distribute available I/O bandwidth equally among all I/O requests. The requests are placed into per-process queues where each of the queues gets a time slice allocated thereto. The Deadline algorithm attempts to guarantee a start time for a process. The queues are sorted by expiration time of processes. Noop inserts incoming I/Os into a FIFO fashion queue and implements request merging. However, each of these I/O scheduling routines introduces application delays that hamper user productivity.
Storage media 16 on smartphones, laptops, tablets, etc., is typically some type of flash storage. Flash storage differs significantly from conventional rotating-disk storage. While rotating disks suffer from the seek time bottleneck, flash storage devices do not. Although providing superior performance compared to conventional storage, flash storage does have its own limitations. For instance, the erase-before-write limitation requires an erase operation before overwriting a location leading to a substantial read/write speed discrepancy, i.e., writes take longer to complete than reads.
As with existing I/O scheduling routines, the I/O scheduler of the present invention is implemented/run in the kernel space at block layer 24. Several embodiments of the present invention's I/O scheduler will be explained with the aid of
Another property that can affect application delay is concurrency where a plurality of read requests or a plurality of write requests are dispatched simultaneously to a device's storage media. That is, concurrency is an approach to speeding up an application's response time by issuing I/O requests concurrently. Since optimal concurrency (i.e., an optimal number of concurrent read requests or an optimal number of concurrent write requests) can be dependent on hardware characteristics, optimal concurrency parameters will vary from device to device. A device's optimal concurrency parameters can be included in an I/O scheduler of the present invention to further reduce application delay. To determine a device's optimal concurrency parameters, the device needs to be benchmarked in terms of the device's concurrency characteristics. Such characteristics include the following four concurrency parameters: the optimal number of concurrent sequential reads, the optimal number of concurrent sequential writes, the optimal number of concurrent random reads, and the optimal number of concurrent random writes.
To benchmark a device in terms of its optimal concurrency parameters, a Linux tester known as the fio tool can be invoked during installation of the present invention's I/O scheduler. For details on the fio tool, see J. Axboe, “fio: Flexible I/O tester,” http://linux.die.net/man/1/fio, 2014. Briefly, the fio tool issues reads and writes, and calculates the speedup of concurrent I/Os over serial ones to determine the concurrency parameters associated with optimal speedup. These concurrency parameters can then be incorporated in an I/O scheduler of the present invention and used to complete the I/O requests. This assures robustness of the present invention as it can be adapted to different characteristics of the flash storage in any particular device.
Referring now to
As mentioned above, the I/O scheduler of the present invention can be configured to work with the framework of known scheduling routines. For example, the CFQ scheduler (e.g., see J. Axboe in “Linux Block IO—Present and Future,” Ottawa Linux Symposium, 2004) is widely used as the default I/O scheduler in Android smartphones. This scheduler attempts to distribute available I/O bandwidth equally among all I/O requests, but is “blind” to the request's read or write status. There are two priority levels defined in the CFQ framework: one is the class, and the other is the priority within the class. There are three classes defined in the CFQ framework: real-time, best effort, and idle. Real-time class requests have the highest priority, followed by the best effort class for which storage access requests are granted only when there is no real-time request left. The idle class is given a storage access only when the storage is idle. Within the real-time and best effort classes, there are eight additional priorities (i.e., ranked 0 for highest to 7 for lowest). Requests are placed into queues where each of the queues gets a time slice allocated to it. There are 8 queues in the real-time class, 8 queues in the best effort class, and 1 queue in the idle class.
In general, the CFQ scheduler is representative of a scheduler that has one or more priority levels defined thereby in order to provide a prioritized hierarchy for I/O requests. The I/O scheduler of the present invention can be adapted to work within this type of scheduling framework by adding another subordinate priority level defined by the above-described read-over-write priority of the present invention. Accordingly,
Referring now to
The advantages of the present invention are numerous. Application delays in electronic devices such as smartphones, etc., are reduced by prioritizing reads over writes, and grouping them based on assigned priorities. Due to the read/write discrepancy nature of typically-used flash storage where reads take much less time to complete than writes, the read-preference reordering used by the present invention does not introduce a major delay to write requests. The approach can be further enhanced by incorporating optimized concurrency parameters into the dispatch operation.
The present invention's reordering scheme does not affect correctness and semantics of write barriers. As disclosed by P. Reisner et al. in “Replicated storage with shared disk semantics,” Linux System Technology, 2005, write barriers are essential for consistency of many file systems and are maintained at the file system layer which is above the I/O scheduler. Therefore, requests issued to the present invention's I/O scheduler can be reordered without affecting write barrier correctness.
The present invention need not change a device's dispatch process as it simply applies a subordinate priority level to organize the dispatch queue in favor of read requests. The dispatch queue can be divided into sections identifying priority levels where each section is organized with the present invention's subordinate priority such that reads precede writes within “parent” priority levels.
All publications, patents, and patent applications cited herein are hereby expressly incorporated by reference in their entirety and for all purposes to the same extent as if each was so individually denoted.
While specific embodiments of the subject invention have been discussed, the above specification is illustrative and not restrictive. Many variations of the invention will become apparent to those skilled in the art upon review of this specification. The full scope of the invention should be determined by reference to the claims, along with their full scope of equivalents, and the specification, along with such variations.
Pursuant to 35 U.S.C. §119, the benefit of priority from provisional application Ser. No. 62/103,120, with a filing date of Jan. 14, 2015, is claimed for this non-provisional application.
This invention was made with government support under Grant No. CNS-1250180 awarded by the National Science Foundation. The government has certain rights in the invention.
Number | Date | Country | |
---|---|---|---|
62103120 | Jan 2015 | US |