1. Field of the Invention
The present application relates generally to an improved data processing system. More specifically, the present invention is directed to a computer implemented method, system, and computer usable program code for prioritizing resource requests according to priority attributes provided by the resource requester.
2. Description of the Related Art
Today, most computers are connected to some type of network. A network allows a computer to share information with other computer systems. The Internet is one example of a computer network. The Internet is a global network of computers and networks joined together by means of gateways that handle data transfer and the conversion of messages from a protocol of the sending network to a protocol used by the receiving network. On the Internet, any computer may communicate with any other computer with information traveling over the Internet through a variety of languages, also referred to as protocols. The Internet uses a set of protocols called transmission control protocol/Internet Protocol (TCP/IP).
Client/server describes the relationship between two computer programs in which one program, the client, makes a service or resource request from another program, the server, which fulfills the request. Although programs within a single computer may use the client/server idea, the client/server idea is more important in a network environment. In a network environment, such as the Internet, the client/server model provides a convenient way to interconnect programs that are distributed efficiently across different locations. Computer transactions using the client/server model are very common.
For example, to check your bank account from your computer, a client program in your computer forwards your request to a server program at the bank. That program may in turn forward the request to its own client program that sends a request to a database server at another bank computer to retrieve your account balance. The balance is returned back to the bank data client, which in turn serves it back to the client in your personal computer, which displays the information for you.
When a multi-threaded application running on an application server issues a request to acquire a resource from a resource server via a network, the multi-threaded application is required to make a choice. The multi-threaded application may either let the thread issuing the request spin-wait, which holds the processor until the issuing thread receives a reply from the resource server, or cede the processor by means of a context-switch, which allows the multi-threaded application to schedule another thread to execute on the processor while the issuing thread waits for the reply from the resource server. While spin-waiting may result in better resource server response time, the multi-threaded application's throughput may suffer from wasting processor cycles in spin-wait. Even though context-switching utilizes processor cycles more efficiently, context-switching creates more processor overhead. In addition, context-switching back to the requesting thread when the reply finally comes back from the resource server later, also increases processor overhead.
Static timing analysis may determine, even without resource request contention at the resource server, that spin-wait minimum latency is too long and that immediate context-switching upon sending a resource request is the best strategy. But, even if static timing analysis determines that the spin-wait minimum latency is less than the context-switching time, it may not always be favorable to use the spin-wait strategy. The reason for this is because the dynamic latency of the resource request may vary significantly due to queuing delay at the resource server. This queuing delay is created because the resource server is processing resource requests from multiple application servers.
Therefore, it would be beneficial to have an improved computer implemented method, system, and computer usable program code for prioritizing resource requests according to priority attributes provided by the resource requester.
Illustrative embodiments provide a computer implemented method, system, and computer usable program code for prioritizing resource requests. One or more resource requests are received. The one or more resource requests are prioritized in a queue according to a priority attribute that is associated with each of the one or more resource requests. A resource request with a highest priority in the queue is selected and processed. Then, a response to the resource request with the highest priority is sent.
The novel features believed characteristic of the illustrative embodiments are set forth in the appended claims. The illustrative embodiments themselves, however, as well as a preferred mode of use, further objectives and advantages thereof, will best be understood by reference to the following detailed description of the illustrative embodiments when read in conjunction with the accompanying drawings, wherein:
With reference now to the figures and in particular with reference to
With reference now to the figures,
In the depicted example, application server 104 and resource server 106 connect to network 102, along with storage unit 108. Application server 104 is a server computer dedicated to running one or more software applications. In addition, application server 104 may, for example, deliver these one or more software applications to client computers, such as clients 110, 112, and 114.
These one or more software applications may, for example, be multi-threaded applications. The term “thread” is short for thread of execution. Threads are a way for an application to split itself into two or more simultaneously executing tasks. Multi-threading generally occurs by time slicing, wherein a single processor switches between different threads. This process of the processor switching between different threads is known as context-switching. Software and/or hardware may perform this context-switching process.
Resource server 106 is a server computer dedicated to providing resources for resource requests from an application or thread executing on application server 104. However, it should be noted that resource server 106 is not limited to only providing resources for resource requests from applications or threads executing on application server 104. Resource server 106 may, for example, provide resources for resource requests from other data processing systems, such as clients 110, 112, and 114, in addition to, or instead of, application server 104.
Clients 110, 112, and 114 connect to network 102. In addition, clients 110, 112, and 114 may, for example, be personal computers or network computers. In this illustrative example, application server 104 provides data, such as boot files, operating system images, and applications to clients 110, 112, and 114. Further, clients 110, 112, and 114 are clients to application server 104 in this example. Network data processing system 100 may include additional servers, clients, and other devices not shown.
In the depicted example, network data processing system 100 is the Internet with network 102 representing a worldwide collection of networks and gateways that use the TCP/IP suite of protocols to communicate with one another. At the heart of the Internet is a backbone of high-speed data communication lines between major nodes or host computers, consisting of thousands of commercial, governmental, educational, and other computer systems that route data and messages. Of course, network data processing system 100 also may be implemented as a number of different types of networks, such as for example, an intranet, a local area network (LAN), or a wide area network (WAN).
With reference now to
In the depicted example, data processing system 200 employs a hub architecture including a north bridge and memory controller hub (MCH) 202 and a south bridge and input/output (I/O) controller hub (ICH) 204. Processing unit 206, main memory 208, and graphics processor 210 are coupled to north bridge and memory controller hub 202. Processing unit 206 may contain one or more processors and even may be implemented using one or more heterogeneous processor systems. Graphics processor 210 may be coupled to the MCH through an accelerated graphics port (AGP), for example.
In the depicted example, LAN adapter 212 is coupled to south bridge and I/O controller hub 204 and audio adapter 216, keyboard and mouse adapter 220, modem 222, read only memory (ROM) 224, universal serial bus (USB) ports and other communications ports 232, and PCI/PCIe devices 234 are coupled to south bridge and I/O controller hub 204 through bus 238, and hard disk drive (HDD) 226 and CD-ROM drive 230 are coupled to south bridge and I/O controller hub 204 through bus 240. PCI/PCIe devices may include, for example, Ethernet adapters, add-in cards, and PC cards for notebook computers. PCI uses a card bus controller, while PCIe does not. ROM 224 may be, for example, a flash binary input/output system (BIOS). Hard disk drive 226 and CD-ROM drive 230 may use, for example, an integrated drive electronics (IDE) or serial advanced technology attachment (SATA) interface. A super I/O (SIO) device 236 may be coupled to south bridge and I/O controller hub 204.
An operating system runs on processing unit 206 and coordinates and provides control of various components within data processing system 200 in
Instructions for the operating system, the object-oriented programming system, and applications or programs are located on storage devices, such as HDD 226, and may be loaded into main memory 208 for execution by processing unit 206. The processes of the illustrative embodiments may be performed by processing unit 206 using computer implemented instructions, which may be located in a memory such as, for example, main memory 208, ROM 224, or in one or more peripheral devices.
The hardware in
In some illustrative examples, data processing system 200 may be a personal digital assistant (PDA), which is generally configured with flash memory to provide non-volatile memory for storing operating system files and/or user-generated data. A bus system may be comprised of one or more buses, such as a system bus, an I/O bus, and a PCI bus. Of course, the bus system may be implemented using any type of communications fabric or architecture that provides for a transfer of data between different components or devices attached to the fabric or architecture. A communications unit may include one or more devices used to transmit and receive data, such as a modem or a network adapter. A memory may be, for example, main memory 208 or a cache such as found in north bridge and memory controller hub 202. A processing unit may include one or more processors or CPUs. The depicted examples in
Illustrative embodiments provide a computer implemented method, system, and computer usable program code for prioritizing resource requests. A resource server utilizes a request priority unit to receive one or more resource requests from applications or threads of a multi-threaded application(s) executing on an application server and/or a client device. It should be noted that the operating system of the application server and/or client devices is a special-type of multi-threaded application, which manages threads from single-thread applications and multi-threaded applications. A major difference between the operating system and the user applications, which the operating system manages, is that the operating system is more privileged than the user applications and may overwrite user application spin-wait and context-switch decisions based on a more global overview of system performance optimization. Therefore, the operating system, as well as the user applications, may benefit from utilizing illustrative embodiments.
The request priority unit prioritizes the one or more resource requests in a queue according to a priority attribute associated with each of the one or more resource requests. However, it should be noted that illustrative embodiments are not restricted to utilizing only one queue. Illustrative embodiments may utilize a plurality of queues to queue incoming resource requests.
A requester, which is the application or thread requesting the resource from the resource server, associates the priority attribute with the resource request. The priority attribute, which may, for example, be a bit, identifies the resource request as a synchronous or asynchronous resource request. A synchronous resource request spin-waits for a response from the resource server. In other words, the application or thread executing on the application server, which issues the synchronous resource request, “holds” the processor or “blocks” other applications or threads from executing on the processor, until the response is received from the resource server. In contrast, the asynchronous resource request context-switches immediately after issuing the resource request. In other words, the application or thread executing on the application server, which issues the asynchronous resource request, “cedes” or surrenders the processor immediately after issuing the resource request in order that other applications or threads may execute on the processor while the issuing thread waits for the response.
In response to selecting a resource request with the highest priority in the queue, the request priority unit processes the resource request with the highest priority. After processing the resource request with the highest priority, the request priority unit sends the response to the issuing application or thread requesting the resource. Subsequent to, or concurrent with, sending the response, the request priority unit re-prioritizes any remaining resource requests in the queue according to a priority policy.
The priority policy is a procedure for re-prioritizing resource requests in the queue. For example, the priority policy may include procedures, such as increase the priority of spin-wait resource requests, decrease the priority of context-switch resource requests, and progressively increase the priority of long-waiting resource requests. A long-waiting resource request is a resource request that remains in the queue for longer than a pre-determined amount of time, such as, for example, 10 milliseconds (ms), 100 ms, 10 seconds (sec), or 100 sec, without being selected for processing. However, it should be noted that a user or system administrator may set the pre-determined amount of time at any desired time value.
Also, it should be noted that the resource server prioritizes resource requests based on as many attribute values as possible if the attribute values can raise the overall performance of the data processing system. Further, there may be times when multiple resource requests within the queue have the same priority level. In the case of multiple resource requests having the same priority level within the queue, the resource server uses a first in first out (FIFO) policy. In other words, the first resource request in the queue with that same priority level is the first resource request that the resource server processes. However, the policy of progressively increasing the priority of long-waiting resource requests may modify the FIFO policy.
Thus, illustrative embodiments allow a requester, such as an application or thread, to influence the resource server's scheduling priority of resource requests. This influence on the scheduling priority by the requester may increase the data processing system's throughput and productivity. Also, this requester influence increases the data processing system's flexibility by allowing for scheduling priority changes in the resource server by the requester.
For example, when the default resource request scheduling priority scheme of the resource server is not appropriate for an application server, illustrative embodiments may provide increased flexibility for the application server. There are circumstances when the application server may want to influence the scheduling priority scheme of the resource server in order for the application server to have a somewhat different scheduling priority scheme from other application servers, either permanently or temporarily.
For example, if an application server is much faster than other application servers making resource requests of the resource server, the faster application server may achieve the best throughput by context-switching on every resource request. By associating a priority attribute, which indicates whether the resource request is synchronous (spin-wait) or asynchronous (context-switch), with each resource request sent to the resource server, the application server informs the resource server of the type of resource request the application server sent. This priority attribute information allows the resource server to, for example, reduce the scheduling priority of these asynchronous requests or equivalently increase the scheduling priority of other synchronous requests.
Alternatively, a small application server may have only one thread or very few threads to run. In this situation, the small application server may achieve the best throughput by spin-waiting on every resource request regardless of long or short response times. Consequently, the resource server, knowing that the small application server is spin-waiting on every resource request, may increase the scheduling priority of these synchronous requests because increasing the scheduling priority of these requests significantly increases the small application server's performance.
With reference now to
Resource server 300 includes processor unit 304, memory unit 306, storage unit 308, communication unit 310, and request priority unit 312, which connects to bus 302. However, it should be noted that resource server 300 is only shown for exemplary purposes and is not meant as an architectural limitation to illustrative embodiments. In other words, resource server 300 may include more or fewer components as necessary to accomplish processes of illustrative embodiments for prioritizing resource requests from an application server, such as application server 104 in
Processor unit 304 provides the data processing capabilities of resource server 300. Processor unit 304 may, for example, be processing unit 206 in
Storage unit 308 is a non-volatile data storage device that may, for example, be configured as ROM, such as ROM 224 in
Resource server 300 uses communication unit 310 to communicate with other data processing systems, such as the application server, via a network, such as network 102 in
Resource server 300 uses request priority unit 312 to receive resource requests from application servers and/or clients, such as clients 110, 112, and 114 in
It should be noted that the user or the system administrator of resource server 300 may enable and disable request priority unit 312 independently of other components of resource server 300. Further, it should be noted that request priority unit 312 may be implemented entirely as software, hardware, or a combination of software and hardware components. Furthermore, even though the exemplary illustration of
With reference now to
The process begins when the resource server uses a request priority unit, such as, for example, request priority unit 312 in
Subsequent to, or concurrent with, listing all available resources in step 404, the request priority unit prioritizes the one of more resource requests in a queue according to the priority attribute associated with each of the one or more resource requests (step 406). The requester that issues the resource request associates the priority attribute with the resource request. The priority attribute indicates whether the resource request is synchronous or asynchronous.
After prioritizing the one or more resource requests in the queue, the request priority unit selects a resource request with the highest priority in the queue (step 408). Subsequent to selecting the resource request with the highest priority in step 408, the request priority unit makes a determination as to whether the resource is currently available (step 410). The request priority unit determines that the resource is currently available by, for example, checking the resource usage table. If the requested resource is not currently available, no output of step 410, then the request priority unit updates the resource usage table by indicating in the table that the resource was not currently available (step 412). Subsequent to, or concurrent with, updating the resource usage table in step 412, the process returns to step 406 where the request priority unit returns and prioritizes the resource request in the queue.
Returning now to step 410, if the requested resource is currently available, yes output of step 410, then the request priority unit processes the resource request (step 414). Subsequent to, or concurrent with, processing the resource request in step 414, the request priority unit updates the resource usage table by indicating in the table that the resource was granted to the requester and is currently unavailable (step 416). Subsequent to, or concurrent with, updating the resource usage table in step 416, the request priority unit sends a response to the resource request from the resource server to the requester within the application server (step 418).
After sending the response in step 418, the request priority unit makes a determination as to whether any other resource requests remain in the queue (step 420). If more resource requests remain in the queue, yes output of step 420, then the request priority unit re-prioritizes the remaining resource requests in the queue according to priority policy (step 422). The priority policy may, for example, increase priority of spin-wait resource requests, decrease priority of context-switch resource requests, and increase priority of long-waiting resource requests. Subsequent to re-prioritizing the remaining resource requests in the queue in step 422, the process returns to step 408 where the request priority unit selects the resource request with the highest priority in the queue.
Returning now to step 420, if no more resource requests remain in the queue, no output of step 420, then the request priority unit stops servicing resource requests (step 424). Although the flowchart indicates that the process ends thereafter, the resource server never actually ceases to function but rather goes into a dormant state waiting to receive one or more resource requests at step 402 where the process begins again. In addition, it should be noted that for the sake of simplicity the process of
With reference now to
The process begins when an application or thread executing within the application server sends a resource request to a resource server, such as, for example, resource server 106 in
If the sent resource request is synchronous, yes output of step 504, then the application or thread, which issued the resource request, spin-waits until the application or thread receives a response from the resource server (step 506). After spin-waiting in step 506, the application or thread receives the response from the resource server (step 508). The process terminates thereafter.
Returning now to step 504, if the sent resource request is not synchronous, or asynchronous, no output of step 504, then the application or thread, which issued the resource request, context-switches until the application or thread receives a response from the resource server (step 510). After context-switching in step 510, the process returns to step 508 where the application or thread receives the response.
Thus, illustrative embodiments provide a computer implemented method, system, and computer usable program code for prioritizing resource requests. The illustrative embodiments can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment containing both hardware and software elements. The illustrative embodiments are implemented in software, which includes but is not limited to firmware, resident software, microcode, etc.
Furthermore, the illustrative embodiments can take the form of a computer program product accessible from a computer-usable or computer-readable medium providing program code for use by or in connection with a computer or any instruction execution system. For the purposes of this description, a computer-usable or computer readable medium can be any tangible apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
The medium can be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system (or apparatus or device) or a propagation medium. Examples of a computer-readable medium include a semiconductor or solid state memory, magnetic tape, a removable computer diskette, RAM, a read-only memory (ROM), a rigid magnetic disk and an optical disk. Current examples of optical disks include compact disk-read only memory (CD-ROM), compact disk-read/write (CD-R/W), and DVD.
A data processing system suitable for storing and/or executing program code will include at least one processor coupled directly or indirectly to memory elements through a system bus. The memory elements can include local memory employed during actual execution of the program code, bulk storage, and cache memories which provide temporary storage of at least some program code in order to reduce the number of times code must be retrieved from bulk storage during execution.
Input/output or I/O devices (including but not limited to keyboards, displays, pointing devices, etc.) can be coupled to the system either directly or through intervening I/O controllers.
Network adapters may also be coupled to the system to enable the data processing system to become coupled to other data processing systems or remote printers or storage devices through intervening private or public networks. Modems, cable modem and Ethernet cards are just a few of the currently available types of network adapters.
The description of the illustrative embodiments have been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the illustrative embodiments in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiment was chosen and described in order to best explain the principles of the illustrative embodiments, the practical application, and to enable others of ordinary skill in the art to understand the illustrative embodiments for various embodiments with various modifications as are suited to the particular use contemplated.