1. Field of the Invention
This invention relates to the field of data processing systems. More particularly, this invention relates to data processing systems having processing elements (processor cores) executing respective program streams and which support distributed maintenance operations.
2. Description of the Prior Art
It is known to provide data processing systems incorporating a plurality of processing cores which together accomplish the overall desired processing for the system. The processing cores may share data and this data may be cached locally to each core. Accordingly, there is a need for coherency mechanisms to ensure data coherency at a desired level between different copies of data held within different storage locations of the overall system. In order to support such coherence mechanisms it is known to provide broadcast maintenance requests (messages) which are broadcast from one processing device and actioned by receiving processing devices.
It is also known to provide data processing systems that support use of a plurality of different virtual machine execution environments. These different virtual machine execution environments may, for example, support different operating systems each executing their own application programs. The plurality of operating systems may be overseen by a hypervisor program which controls the allocation of the physical processing resources to the individual guest operating systems and seeks to isolate the different guest operating systems from one another.
Viewed from one aspect the present invention provides apparatus for processing data comprising:
a plurality of processing elements each configured to execute a stream of program instructions, said plurality of processing elements providing a plurality of virtual machine execution environments; wherein
at least one of said plurality of processing elements is a broadcast request generating processing element having broadcast generating circuitry configured to generate a first broadcast maintenance request in respect of a given one of said plurality of virtual machine execution environments;
at least one of said plurality of processing elements is a broadcast request receiving processing element having broadcast receiving circuitry configured to receive said first broadcast maintenance request from said broadcast generating processing element and to trigger a maintenance operation in said broadcast receiving processing element in response said first broadcast maintenance request; said apparatus further comprising:
behaviour modifying circuitry configured to modifying behaviour of a further broadcast maintenance request in respect of said given one of said plurality of virtual machine execution environments if a predetermined condition is met.
The present invention recognises that in the context of a data processing system having a plurality of processing elements, each executing a respective stream of program instructions and supporting a plurality of virtual machine execution environments, there exists a potential problem with broadcast maintenance requests. More particularly, broadcast maintenance requests from one processing element supporting a given virtual machine execution environment will normally be sent to all of the other processing elements and, even if those processing elements do not need to perform the specified maintenance operation, the receipt and handling of the broadcast maintenance request can adversely impact the performance of those other processing elements. For example, a broadcast generating processing element supporting a given virtual machine execution environment may generate a broadcast maintenance request indicating that other processing elements should flush their local instruction cache. It may be appropriate in some circumstances for this to take place on all of the other processing elements irrespective of which virtual machine execution environment they are currently hosting, but if the broadcast maintenance request is repeatedly sent and actioned by all of the other processing elements, then the performance of those other processing elements will be significantly reduced. The performance impact may be such that the other processing elements are even prevented from making forward progress in their processing operations. The inappropriate sending of broadcast maintenance requests may be the result of an error in programming, but it is also possible that it could be the result of some malicious action, such as a desire to inflict a denial of service attack on the system by overwhelming the system with inappropriate broadcast maintenance requests.
Having recognised the above problem, the present technique provides the solution of behaviour modifying circuitry that serves to modify the behaviour of a further broadcast maintenance request in respect of a given virtual machine execution environment which generated a first broadcast maintenance request if a predetermined condition is met. The modification to the behaviour of the further broadcast maintenance request could take a variety of different forms depending on the particular implementation. The predetermined condition could also take a variety of different forms depending upon the particular implementation.
The problems of potentially inappropriate generation of broadcast maintenance requests are increased in likelihood within systems in which the broadcast maintenance requests are generated in response to execution of broadcast specifying instructions. Providing such broadcast specifying instructions, particularly if they are accessible in a user mode or a guest operating system mode, as opposed to solely being accessible in hypervisor mode, increases the likelihood of the inappropriate generation of broadcast maintenance requests that can adversely impact the performance of other processing elements within the system and act against the desirable aim of performance isolation between virtual machine execution environments.
The behaviour of the broadcast maintenance request may be modified in a fixed manner. In other embodiments the behaviour of the further broadcast maintenance request may be modified in a manner dependent upon information from said first broadcast maintenance request. Adapting the manner in which the behaviour of the further broadcast maintenance request is modified based on information from the first broadcast maintenance request enables the response of the behaviour modifying circuitry to be matched better to the prevailing system state.
In some embodiments the predetermined behaviour may be modified based upon virtual machine execution environment state held within either or both of the broadcast generating processing element and/or the broadcast receiving processing element. Thus, the modification can be adapted to the particular virtual machine execution environments currently being hosted by different processing elements within the overall system.
It is also possible that the predetermined behaviour may be modified based upon the virtual machine execution environment state of another of the processing elements that is not either the broadcast generating processing element or the broadcast receiving processing element. It is possible that virtual machine state held on some third party processing element within the system can be used to adapt the modification of the further maintenance request in a manner more appropriate to the circumstances existing.
One form of modification of the behaviour of the further broadcast maintenance request is to stall completion of a further broadcast specifying instruction and thereby defer generation of the further broadcast maintenance request. This effectively suppresses generation of the further broadcast maintenance request at source.
Another form of modification may be to upgrade the broadcast maintenance request to an upgraded maintenance request operation that has a larger scope than and includes a further maintenance operation directly corresponding to the further broadcast maintenance request. As an example, the behaviour modifying circuitry may identify that multiple broadcast maintenance requests had been received, each seeking to invalidate a selected subset of cached data within the broadcast receiving processing element. The behaviour modifying circuitry can respond by upgrading one of these broadcast maintenance requests to flush all of the cache data concerned from the broadcast receiving processing element and thereby avoid the need to respond to any subsequent broadcast maintenance requests seeking partial flushing. The behaviour modifying circuitry thus is able to avoid the broadcast receiving processing element repeatedly having to respond to individual partial flushing requests and instead a full flush operation (upgraded maintenance operation) can be performed once and the need for further maintenance operations and their impact on subsequent processing performance can thereby be avoided.
In some embodiments either or both of the broadcast receiving processing element and/or the broadcast generating processing element may contain a data store which tracks on a per virtual machine execution environment basis whether a particular broadcast receiving processing element contains any state associated with the virtual machine execution environments. This data store can thus provide information to the behaviour modifying circuitry and allow this to suppress the further maintenance operation when the data store indicates that the given virtual machine execution environment does not have any state within the broadcast receiving processing element.
As previously mentioned, the predetermined condition under which the behaviour modifying circuitry modifies the behaviour associated with the further broadcast maintenance request can vary. One such condition is that the broadcast receiving processing element has not executed any program instructions using the given virtual machine execution environment since the maintenance operation associated with the first broadcast maintenance request triggered its response within the receiving processing element. As an example, if the broadcast receiving element has already flushed all of its data associated with the given virtual machine execution environment and has not executed any instructions for that given virtual machine execution environment in the intervening period, then a subsequently received further broadcast maintenance request in relation to the given virtual machine execution environment requiring further flushing of state may be ignored since no state associated with that given virtual machine execution environment is present within the broadcast receiving processing element.
A further example of the predetermined condition that may be met to trigger action of the behaviour modifying circuit is that the rate at which the broadcast generating circuitry seeks to generate broadcast maintenance messages exceeds a predetermined rate limit. This feature recognises that broadcast maintenance operations while necessary should be relatively rare events. Accordingly, limiting the rate of issue of broadcast maintenance requests should not unduly impact nominal behaviour of the system, but will prevent an excessive rate of issue of such broadcast maintenance messages causing undesired performance impacts between virtual machine execution environments that all ideally performance isolated from each other.
Such a rate limiting predetermined condition may be conveniently employed at the broadcast maintenance request source and accordingly applied by the broadcast generating processing element.
In other embodiments, the behaviour modifying circuitry may act at the broadcast receiving processing element. In this context the broadcast maintenance request may already have been issued and the action of the behaviour modifying circuitry can be to suppress triggering of a maintenance operation in response to receipt of the further broadcast maintenance message. The broadcast generating processing element completes its instruction and sends the further broadcast maintenance request, but the broadcast receiving processing element ignores that further broadcast maintenance request.
One efficient way of providing such behaviour within the system is when said behaviour modifying circuitry is configured to record with status data if said maintenance operation has been performed in response to said first broadcast maintenance message during execution of program instructions within a current one of said plurality of virtual machine execution environments by said broadcast receiving processing element and to suppress triggering of a maintenance operation in response to said further broadcast maintenance message unless at least one of:
said status data indicates that said maintenance operation has not been performed in response to said first broadcast maintenance message during execution of program instructions within said current one of said plurality of virtual machine execution environments; and
said given one of said plurality of virtual machine execution environments is the same as said current one of said plurality of virtual machine execution environments.
In this context it is appropriate that the status data is cleared when the broadcast receiving processing element changes to provide a different one of the plurality of virtual machine execution environments. When the broadcast receiving processing element switches the virtual machine execution environment it is supporting, then it is possible that a newly received broadcast maintenance request could have an impact upon the newly adopted virtual machine execution environment and accordingly should be actioned.
As previously discussed, the behaviour modifying circuitry may modify the behaviour of the further broadcast maintenance request to perform a modified broadcast maintenance request. This modified broadcast maintenance request can correspond to broadcast maintenance operations that are a superset of the maintenance operations specified by the original further broadcast maintenance request. Thus, the original request is upgraded into a request that is a superset of the original request, such as performing a more thorough maintenance operation in one go rather than performing multiple less thorough maintenance operations in a manner which would adversely impact performance isolation.
Another example of the possible action of the behaviour modifying circuitry is that it is configured to trigger an interrupt in processing by the broadcast receiving processing element and a switch to a hypervisor mode of operation in which the further broadcast maintenance request is selectively blocked. This switch to the hypervisor mode may take place immediately when the first further broadcast maintenance request is received from the same given virtual machine execution environment, or alternatively could take place, for example, after a threshold number of such further broadcast maintenance requests are received, either in absolute terms or within a predetermined period. Software processing within the hypervisor mode can then take appropriate action to either service the broadcast maintenance request, to suppress its action, or to stop further generation of such broadcast maintenance request.
It will be appreciated that in some embodiments a given processing element may comprise both broadcast request generating circuitry and broadcast request receiving circuitry.
In some embodiments all of the processing elements may comprise both broadcast request generating circuitry and broadcast request receiving circuitry.
As previously mentioned, the maintenance operations could take a variety of different forms. Such maintenance operations are typically, although not essentially, associated with the management of coherence within the system. On particular form of maintenance operation to which the present technique may be applied is maintenance operations concerning the flushing of state data locally stored within a broadcast receiving processing element. Such state data may be program instructions stored within a local instruction cache and the broadcast specifying instruction may be one or more of a partial invalidate instruction or a full invalidate instruction for selectively, under program control, invalidating a portion of the cached instructions or all of the cached instructions at a broadcast receiving processing element.
Viewed from another aspect the present invention provides apparatus for processing data comprising:
a plurality of processing means each for executing a stream of program instructions, said plurality of processing means providing a plurality of virtual machine execution environments; wherein
at least one of said plurality of processing means is a broadcast generating processing means having broadcast request generating means for generating a first broadcast maintenance request in respect of a given one of said plurality of virtual machine execution environments;
at least one of said plurality of processing means is a broadcast receiving processing means having broadcast request receiving means for receiving said first broadcast maintenance request from said broadcast generating processing means and for triggering a maintenance operation in said broadcast receiving processing means in response said first broadcast maintenance request; said apparatus further comprising:
behaviour modifying means for modifying behaviour of a further broadcast maintenance request in respect of said given one of said plurality of virtual machine execution environments if a predetermined condition is met.
Viewed from a further aspect the present invention provides a method of processing data comprising the steps of:
executing respective streams of program instructions with a plurality of processing elements, said plurality of processing elements providing a plurality of virtual machine execution environments; wherein
generating a first broadcast maintenance request in respect of a given one of said plurality of virtual machine execution environments using a broadcast generating processing element within said plurality of processing elements;
receiving said first broadcast maintenance request from said broadcast generating processing element at a broadcast receiving processing element of said plurality of processing elements;
triggering a maintenance operation in said broadcast receiving processing element in response said first broadcast maintenance request; and
modifying behaviour of a further broadcast maintenance request in respect of said given one of said plurality of virtual machine execution environments if a predetermined condition is met.
The above, and other objects, features and advantages of this invention will be apparent from the following detailed description of illustrative embodiments which is to be read in connection with the accompanying drawings.
The data processing system 2 illustrated in
The data processing element 16 is also equipped with broadcast request receiving circuitry 20. This receives broadcast maintenance requests from other processing elements and passes these request to broadcast modification circuitry 22. The broadcast modification circuitry 22 can selectively modify the received broadcast maintenance requests in dependence upon whether one or more predetermined conditions are met. In this example embodiment, the broadcast maintenance requests relate to local cache maintenance and accordingly the original broadcast maintenance requests (and any appropriate modified broadcast maintenance requests) are passed on to cache maintenance circuitry 26 which then performs cache maintenance operations upon the local caches for the processing element 16. Example different types of predetermined conditions triggering modification as well as example different types of broadcast message modification that may be applied will be discussed further below.
It will be appreciated that the behaviour modification circuitry 22 may have a data store in which it stores data tracking the state of the data processing system 2 as a whole. As an example, the data stall may store on a per virtual machine execution environment basis whether or not a particular processing element 4, 6, 8, 10, 12 is storing any state data relating to that virtual machine execution environment. If the status store indicates that no such state data for a given virtual machine is stored when a broadcast maintenance message is either being generated or received, then such a broadcast maintenance message may be suppressed and no action taken. It will be appreciated that a data store may more appropriate be provided when broadcast message modification is performed at the receiver, as each broadcast receiving processing element need only be responsible for tracking its own state data and will be able to modify the behaviour of broadcast maintenance messages it receives in dependence upon its own locally stored data.
In the flow diagram of
If the test at step 30 did not result in a match, then processing proceeds to step 36 where a determination is made as to whether or not the “ignore” variable has a current value of “0”. If the ignore variable does have such a value, then the invalidate is performed even though the current virtual machine identifier does not match the given machine virtual identifier. Accordingly, processing is passed to step 32 where the invalidate is performed and step 34 where the “ignore” variable is set to “1” such that subsequent invalidate requests from non-matching virtual machines will be ignored.
If the determination at step 40 is that greater than the threshold number of partially invalidates have already been received from the given virtual machine execution environment, then processing passes to step 44 where the partial invalidate broadcast maintenance request is upgraded to a full invalidate broadcast maintenance request. As an example, the partial invalidate broadcast maintenance request may request the invalidation of selected instructions stored at specified instruction addresses within a local instruction cache. In contrast, a full invalidate broadcast maintenance message may request the flushing of the entire local instruction cache. The full invalidate is a superset of the partial invalidate. The flow diagram in
It will be appreciated that the rate control illustrated in
Step 74 then determines whether or not a full invalidate operation has already been performed on behalf of the given virtual machine. If such a full invalidate operation has not already been performed on behalf of the given virtual machine, then step 76 serves to perform the full invalidate operation and processing is returned to step 72. If a full invalidate operation has already been performed on behalf of the given virtual machine, then step 76 serves to determine whether or not the processing element which received the invalidate request at step 72 has executed any instructions within the given virtual machine since the previous full invalidate operation was performed in respect of that given virtual machine. If there have not been any such instructions performed, then processing is returned to step 72, otherwise processing is passed to step 76 where the full invalidate operation is again performed.
It will be seen from the above that the behaviour modifying operations can take a wide variety of different forms. The behaviour modification may be performed to the messages (requests) either at source, at destination or on route. The predetermined conditions under which broadcast maintenance request modifications are performed can also vary. Modifications may or may not be performed depending upon, for example, the rate of message generation or state data tracked in respect of the different virtual machines which may be supported by the system 2, or state data indicating whether or not overlapping maintenance operations have already been performed rendering the new maintenance operation effectively redundant, etc. All of these techniques stem from the recognition that broadcast maintenance requests within a system employing a plurality of processing elements and supporting a plurality of different virtual machine execution environments can introduce undesired performance interference between the virtual machine execution environments. Having recognised this problem, the present techniques provide solutions employing a variety of different behaviour modification techniques triggered in dependence upon a variety of different predetermined conditions being detected. All of these variants are encompassed by the present techniques.
Although illustrative embodiments of the invention have been described in detail herein with reference to the accompanying drawings, it is to be understood that the invention is not limited to those precise embodiments, and that various changes and modifications can be effected therein by one skilled in the art without departing from the scope and spirit of the invention as defined by the appended claims.