mitchalsup@aol.com (MitchAlsup) writes:
Anyway, the question is if hint instructions are still relevant. For
the most part, they seem to have been replaced by history-based
mechanisms.
* Branch direction hints? We have branch predictors.
* Branch target hints? We have BTBs and indirect branch predictors.
* Prefetch instructions? Hardware prefetchers tend to work better, so
they fell into disuse.
ARMv8 has a large space reserved for hint instructions, which
include a wide-ranging set of functionality, such as:
Some pointer authentication instructions.
Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
mitchalsup@aol.com (MitchAlsup) writes:
Anyway, the question is if hint instructions are still relevant. For
the most part, they seem to have been replaced by history-based
mechanisms.
* Branch direction hints? We have branch predictors.
* Branch target hints? We have BTBs and indirect branch predictors.
* Prefetch instructions? Hardware prefetchers tend to work better, so
they fell into disuse.
All can be interesting for real-time systems, which react to
rare occurrences, and where performance for these matters (and
does not for the normal case).
Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
mitchalsup@aol.com (MitchAlsup) writes:
Anyway, the question is if hint instructions are still relevant. For
the most part, they seem to have been replaced by history-based
mechanisms.
* Branch direction hints? We have branch predictors.
* Branch target hints? We have BTBs and indirect branch predictors.
* Prefetch instructions? Hardware prefetchers tend to work better, so
they fell into disuse.
All can be interesting for real-time systems, which react to
rare occurrences, and where performance for these matters (and
does not for the normal case).
Suddenly, all the things done for optimizing in hardware in the
general case (branch prediction, cache eviction, ...) can make
performance for the unusual, but relevant, case worse.
I believe there is active research going on on how to overcome this
"bias for the common case" with today's processors.
Thomas Koenig <tkoenig@netcologne.de> writes:
Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
mitchalsup@aol.com (MitchAlsup) writes:
Anyway, the question is if hint instructions are still relevant. For
the most part, they seem to have been replaced by history-based
mechanisms.
* Branch direction hints? We have branch predictors.
* Branch target hints? We have BTBs and indirect branch predictors.
* Prefetch instructions? Hardware prefetchers tend to work better, so
they fell into disuse.
All can be interesting for real-time systems, which react to
rare occurrences, and where performance for these matters (and
does not for the normal case).
The things I have heard about hard real-time systems (RTS) and
worst-case execution time (WCET) analysis for hard RTS is that all
cases have to be within the deadline, including uncommon cases.
Thomas Koenig <tkoenig@netcologne.de> writes:
Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
mitchalsup@aol.com (MitchAlsup) writes:
One other thing I remember is that on some PowerPC CPU one could lock
certain cache lines in the cache, so they will not be replaced.
Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
Thomas Koenig <tkoenig@netcologne.de> writes:
Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
mitchalsup@aol.com (MitchAlsup) writes:
Anyway, the question is if hint instructions are still relevant. For
the most part, they seem to have been replaced by history-based
mechanisms.
* Branch direction hints? We have branch predictors.
* Branch target hints? We have BTBs and indirect branch predictors.
* Prefetch instructions? Hardware prefetchers tend to work better, so >>>> they fell into disuse.
All can be interesting for real-time systems, which react to
rare occurrences, and where performance for these matters (and
does not for the normal case).
The things I have heard about hard real-time systems (RTS) and
worst-case execution time (WCET) analysis for hard RTS is that all
cases have to be within the deadline, including uncommon cases.
There is one exception, whose value to society is debatable, but it
exists nonetheless: High-speed financial trading. These guys (or
rather, their computers) spend a lot time analyzing. They make very
few trades per CPU cycle, but if they do, they want to be fast. So,
latency for the less-commonly travelled path becomes the main objective.
Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
The things I have heard about hard real-time systems (RTS) and
worst-case execution time (WCET) analysis for hard RTS is that all
cases have to be within the deadline, including uncommon cases.
There is one exception, whose value to society is debatable, but it
exists nonetheless: High-speed financial trading. These guys (or
rather, their computers) spend a lot time analyzing. They make very
few trades per CPU cycle, but if they do, they want to be fast. So,
latency for the less-commonly travelled path becomes the main objective.
Thomas Koenig <tkoenig@netcologne.de> writes:
Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
Thomas Koenig <tkoenig@netcologne.de> writes:
Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
mitchalsup@aol.com (MitchAlsup) writes:
Anyway, the question is if hint instructions are still relevant. For >>>>> the most part, they seem to have been replaced by history-based
mechanisms.
* Branch direction hints? We have branch predictors.
* Branch target hints? We have BTBs and indirect branch predictors. >>>>>
* Prefetch instructions? Hardware prefetchers tend to work better, so >>>>> they fell into disuse.
All can be interesting for real-time systems, which react to
rare occurrences, and where performance for these matters (and
does not for the normal case).
The things I have heard about hard real-time systems (RTS) and
worst-case execution time (WCET) analysis for hard RTS is that all
cases have to be within the deadline, including uncommon cases.
There is one exception, whose value to society is debatable, but it
exists nonetheless: High-speed financial trading. These guys (or
rather, their computers) spend a lot time analyzing. They make very
few trades per CPU cycle, but if they do, they want to be fast. So, >>latency for the less-commonly travelled path becomes the main objective.
Although they're more generally interested in network latency than
cache latency, to the extent that they colocate their trading systems
at the exchange data centers.
Thomas Koenig <tkoenig@netcologne.de> writes:
Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
mitchalsup@aol.com (MitchAlsup) writes:
Anyway, the question is if hint instructions are still relevant. For
the most part, they seem to have been replaced by history-based
mechanisms.
* Branch direction hints? We have branch predictors.
* Branch target hints? We have BTBs and indirect branch predictors.
* Prefetch instructions? Hardware prefetchers tend to work better, so
they fell into disuse.
All can be interesting for real-time systems, which react to
rare occurrences, and where performance for these matters (and
does not for the normal case).
The things I have heard about hard real-time systems (RTS) and
worst-case execution time (WCET) analysis for hard RTS is that all
cases have to be within the deadline, including uncommon cases. So
you have to consider the worst case for, e.g., branch prediction,
unless you can prove that youget a better case. And I have not heard
about such proofs for dynamic branch predictors, so static branch
prediction (hints) may indeed be the way to go.
Suddenly, all the things done for optimizing in hardware in the
general case (branch prediction, cache eviction, ...) can make
performance for the unusual, but relevant, case worse.
Actually, for caches with LRU replacement I have heard that they can
be analysed; that was research coming out of Saarbruecken ~20 years
ago, and I think they did a spin-off for commercializing it. One
problem that they had was that the usual n-way set-associative caches
with n>2 don't have proper LRU replacement, but pseudo-LRU; with these
caches the guarantees degrade to those of a 2-way cache (with the same
way sizes). I don't remember if they used that for data or for
instructions.
I have not heard any advances in WCET since that time, but maybe I
just went to the wrong meetings.
I believe there is active research going on on how to overcome this
"bias for the common case" with today's processors.
When I heard about the cache work, they also talked about the
processors and what you know about their execution time. IIRC they
found that most high-performance architectures of the day were
problematic.
One other thing I remember is that on some PowerPC CPU one could lock
certain cache lines in the cache, so they will not be replaced. So if
you use 6 of your 8 ways (of a 32KB cache with 4KB ways) for locking
stuff into the cache, and the other two ways for performing analysable accesses, it's a lot better than a CPU without a cache.
Now ARM offers cores with the R profile (e.g., ARMv8-R), where R
stands for real-time. I have not looked what the properties of these
cores are. I found it surprising that the big market for them seems
to be disk drives and such things.
- anton
Anton Ertl wrote:
Thomas Koenig <tkoenig@netcologne.de> writes:
Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
mitchalsup@aol.com (MitchAlsup) writes:
Anyway, the question is if hint instructions are still relevant. For >>>> the most part, they seem to have been replaced by history-based
mechanisms.
* Branch direction hints? We have branch predictors.
* Branch target hints? We have BTBs and indirect branch predictors.
* Prefetch instructions? Hardware prefetchers tend to work better, so >>>> they fell into disuse.
All can be interesting for real-time systems, which react to
rare occurrences, and where performance for these matters (and
does not for the normal case).
The things I have heard about hard real-time systems (RTS) and
worst-case execution time (WCET) analysis for hard RTS is that all
cases have to be within the deadline, including uncommon cases. So
you have to consider the worst case for, e.g., branch prediction,
unless you can prove that youget a better case. And I have not heard
about such proofs for dynamic branch predictors, so static branch
prediction (hints) may indeed be the way to go.
Suddenly, all the things done for optimizing in hardware in the
general case (branch prediction, cache eviction, ...) can make
performance for the unusual, but relevant, case worse.
Actually, for caches with LRU replacement I have heard that they can
be analysed; that was research coming out of Saarbruecken ~20 years
ago, and I think they did a spin-off for commercializing it. One
problem that they had was that the usual n-way set-associative caches
with n>2 don't have proper LRU replacement, but pseudo-LRU; with these
caches the guarantees degrade to those of a 2-way cache (with the same
way sizes). I don't remember if they used that for data or for
instructions.
I have not seen real LRU for 2 decades. We mostly use what is called::
"not recently used" which is a set of n-bits (n==sets):: When then n-th
bit gets set, all n-bits are cleared.
I have not heard any advances in WCET since that time, but maybe I
just went to the wrong meetings.
I believe there is active research going on on how to overcome this
"bias for the common case" with today's processors.
When I heard about the cache work, they also talked about the
processors and what you know about their execution time. IIRC they
found that most high-performance architectures of the day were
problematic.
Hard Real Time does not like caches if you are within 50% of consuming
all CPU cycles; and does not like branch predictors, or prefetchers.
One other thing I remember is that on some PowerPC CPU one could lock
certain cache lines in the cache, so they will not be replaced. So if
you use 6 of your 8 ways (of a 32KB cache with 4KB ways) for locking
stuff into the cache, and the other two ways for performing analysable
accesses, it's a lot better than a CPU without a cache.
We used to use Cache line locking to take a set of cache lines (say 4)
and lock one whose data or tag store was "bad" and that line would go
from n-way set associative to (n-1)-way set associative.
Now ARM offers cores with the R profile (e.g., ARMv8-R), where R
stands for real-time. I have not looked what the properties of these
cores are. I found it surprising that the big market for them seems
to be disk drives and such things.
Why would disk drives NEED Real Time controller ??
Thomas Koenig <tkoenig@netcologne.de> writes:
Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
mitchalsup@aol.com (MitchAlsup) writes:
Anyway, the question is if hint instructions are still relevant. For
the most part, they seem to have been replaced by history-based
mechanisms.
* Branch direction hints? We have branch predictors.
* Branch target hints? We have BTBs and indirect branch predictors.
* Prefetch instructions? Hardware prefetchers tend to work better, so
they fell into disuse.
All can be interesting for real-time systems, which react to
rare occurrences, and where performance for these matters (and
does not for the normal case).
The things I have heard about hard real-time systems (RTS) and
worst-case execution time (WCET) analysis for hard RTS is that all
cases have to be within the deadline, including uncommon cases. So
you have to consider the worst case for, e.g., branch prediction,
unless you can prove that youget a better case.
And I have not heard
about such proofs for dynamic branch predictors, so static branch
prediction (hints) may indeed be the way to go.
Suddenly, all the things done for optimizing in hardware in the
general case (branch prediction, cache eviction, ...) can make
performance for the unusual, but relevant, case worse.
Actually, for caches with LRU replacement I have heard that they can
be analysed; that was research coming out of Saarbruecken ~20 years
ago, and I think they did a spin-off for commercializing it.
One problem that they had was that the usual n-way set-associative
caches with n>2 don't have proper LRU replacement, but pseudo-LRU;
with these caches the guarantees degrade to those of a 2-way cache
(with the same way sizes). I don't remember if they used that for
data or for instructions.
I have not heard any advances in WCET since that time, but maybe I
just went to the wrong meetings.
I believe there is active research going on on how to overcome this
"bias for the common case" with today's processors.
When I heard about the cache work, they also talked about the
processors and what you know about their execution time. IIRC they
found that most high-performance architectures of the day were
problematic.
Hard Real Time does not like caches if you are within 50% of consuming
all CPU cycles; and does not like branch predictors, or prefetchers.
Although they often do go hand in hand, "real time" is only about
meeting deadlines: speed, load, cache behavior, etc., are relevant
only to the extent that they cause you to miss deadlines.
On 2023-11-19 17:43, Anton Ertl wrote:
The things I have heard about hard real-time systems (RTS) and
worst-case execution time (WCET) analysis for hard RTS is that all
cases have to be within the deadline, including uncommon cases. So
you have to consider the worst case for, e.g., branch prediction,
unless you can prove that youget a better case.
Yes, for the classical "static" WCET analysis approach. There are other >"hybrid" or "probabilistic" methods to compute "WCET estimates" that
should have a very small probability of being exceeded. The idea is that
once that probability is smaller than the probability of system failure
from other causes (say, uncorrectable HW failure) the "WCET" estimate is
good enough.
Actually, for caches with LRU replacement I have heard that they can
be analysed; that was research coming out of Saarbruecken ~20 years
ago, and I think they did a spin-off for commercializing it.
Yes, AbsInt GmbH. See www.absint.com for their commercial WCET analysis >tools. There are also several open-source, non-commercial tools.
For many years there has been an annual WCET Analysis Workshop in
connection with the ECRTS conferences (Euromicro Conference on Real-Time >Systems. https://www.ecrts.org/about-ecrts/).
Niklas Holsti <niklas.holsti@tidorum.invalid> writes:
On 2023-11-19 17:43, Anton Ertl wrote:
The things I have heard about hard real-time systems (RTS) and
worst-case execution time (WCET) analysis for hard RTS is that all
cases have to be within the deadline, including uncommon cases. So
you have to consider the worst case for, e.g., branch prediction,
unless you can prove that youget a better case.
Yes, for the classical "static" WCET analysis approach. There are other
"hybrid" or "probabilistic" methods to compute "WCET estimates" that
should have a very small probability of being exceeded. The idea is that
once that probability is smaller than the probability of system failure >>from other causes (say, uncorrectable HW failure) the "WCET" estimate is
good enough.
The question is how much we can trust such estimates.
If you asked experts in nuclear security in 2010 to estimate the
probablility of having n meltdowns in light-water reactors in one
year, they would have provided a vanishingly small number for n=3,
probably lower than the "probability of system failure" you mention.
Yet n=3 happened in 2011, and, I think, if you asked such experts
after 2011, they would not give such low estimates.
For many years there has been an annual WCET Analysis Workshop in
connection with the ECRTS conferences (Euromicro Conference on Real-Time
Systems. https://www.ecrts.org/about-ecrts/).
This is not my research area, so I only ever heard about this stuff in
other compiler researcher meetings. Anyway, if they still have
meetings, I assume there is still progress in that area, although I
would have to look at it in more detail to see if there is still work
on static WCET, or if that work has stopped and they are making do
with probablistic methods, because the users want more performance
than can be guaranteed with static WCET methods.
George Neuner <gneuner2@comcast.net> schrieb:
Although they often do go hand in hand, "real time" is only about
meeting deadlines: speed, load, cache behavior, etc., are relevant
only to the extent that they cause you to miss deadlines.
The most succinct definition I have heard of a real-time system
is that "a late answer is a wrong answer".
Yes, for the classical "static" WCET analysis approach. There are other "hybrid" or "probabilistic" methods to compute "WCET estimates" that should have a very small probability of being exceeded. The idea is that once that probability is smaller than the probability of system failure from other causes (say, uncorrectable HW failure) the "WCET" estimate is good enough.
Anton Ertl wrote:
Thomas Koenig <tkoenig@netcologne.de> writes:
Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
mitchalsup@aol.com (MitchAlsup) writes:
Anyway, the question is if hint instructions are still relevant. For
the most part, they seem to have been replaced by history-based
mechanisms.
* Branch direction hints? We have branch predictors.
* Branch target hints? We have BTBs and indirect branch predictors.
* Prefetch instructions? Hardware prefetchers tend to work better, so >>>> they fell into disuse.
All can be interesting for real-time systems, which react to
rare occurrences, and where performance for these matters (and
does not for the normal case).
The things I have heard about hard real-time systems (RTS) and
worst-case execution time (WCET) analysis for hard RTS is that all
cases have to be within the deadline, including uncommon cases. So
you have to consider the worst case for, e.g., branch prediction,
unless you can prove that youget a better case. And I have not heard
about such proofs for dynamic branch predictors, so static branch
prediction (hints) may indeed be the way to go.
Suddenly, all the things done for optimizing in hardware in the
general case (branch prediction, cache eviction, ...) can make >>>performance for the unusual, but relevant, case worse.
Actually, for caches with LRU replacement I have heard that they can
be analysed; that was research coming out of Saarbruecken ~20 years
ago, and I think they did a spin-off for commercializing it. One
problem that they had was that the usual n-way set-associative caches
with n>2 don't have proper LRU replacement, but pseudo-LRU; with these
caches the guarantees degrade to those of a 2-way cache (with the same
way sizes). I don't remember if they used that for data or for
instructions.
I have not seen real LRU for 2 decades. We mostly use what is called::
"not recently used" which is a set of n-bits (n==sets):: When then n-th
bit gets set, all n-bits are cleared.
I have not heard any advances in WCET since that time, but maybe I
just went to the wrong meetings.
I believe there is active research going on on how to overcome this
"bias for the common case" with today's processors.
When I heard about the cache work, they also talked about the
processors and what you know about their execution time. IIRC they
found that most high-performance architectures of the day were
problematic.
Hard Real Time does not like caches if you are within 50% of consuming
all CPU cycles; and does not like branch predictors, or prefetchers.
One other thing I remember is that on some PowerPC CPU one could lock
certain cache lines in the cache, so they will not be replaced. So if
you use 6 of your 8 ways (of a 32KB cache with 4KB ways) for locking
stuff into the cache, and the other two ways for performing analysable
accesses, it's a lot better than a CPU without a cache.
We used to use Cache line locking to take a set of cache lines (say 4)
and lock one whose data or tag store was "bad" and that line would go
from n-way set associative to (n-1)-way set associative.
Now ARM offers cores with the R profile (e.g., ARMv8-R), where R
stands for real-time. I have not looked what the properties of these
cores are. I found it surprising that the big market for them seems
to be disk drives and such things.
Why would disk drives NEED Real Time controller ??
On Sun, 19 Nov 2023 19:25:50 +0000, mitchalsup@aol.com (MitchAlsup)
wrote:
Hard Real Time does not like caches if you are within 50% of consuming
all CPU cycles; and does not like branch predictors, or prefetchers.
Please forgive me if I am badly mistaken, but it sounds to me like you
may be conflating "real time" with "real fast".
Although they often do go hand in hand, "real time" is only about
meeting deadlines: speed, load, cache behavior, etc., are relevant
only to the extent that they cause you to miss deadlines.
I used to do HRT machine vision industrial QA/QC systems. Unless the machinery is on fire[*], the conveyor keeps going - so these systems
were "hard" in the sense that there were absolute deadlines to provide results.
Some systems simultaneously checked multiple parts at different stages
of production and with differing deadlines [...]
At the same time, the systems had to drive graphic displays showing
the operator what was going on in near real time. [...]
Most systems had to be made to work with already existing machinery,
so I usually had no control over deadlines and compute intervals - I
simply had to deal with them. Deadlines ranged from ~20ms at the very
low end to ~900ms at the very high end. Depending on cameras just
capturing images could take 16..66ms before computation could even
start. Often there were multiple threads[*] simultaneously performing different inspections on different cameras with different deadlines.
The hard real-time (HRT) domain can be further divided into critical and non-critical.
The hard real-time (HRT) domain can be further divided into critical and
non-critical.
I like to use music players as example of real-time, since if you're
late (even by just a few ms), the result is a failure.
But the expected harm is just that you may lose users/customers if it
happens too often.
Stefan
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 12:42:41 |
Calls: | 10,389 |
Calls today: | 4 |
Files: | 14,061 |
Messages: | 6,416,878 |
Posted today: | 1 |