Re: xchg & lock question




Eman wrote:
For those, who may also being interesting in this topic,
the answer is as follows.

These are e.g. Pentium 4, Intel Xeon, and P6 family processors.
For them, if the memory area being accessed is cached internally
in the processor, the LOCK# signal is generally not asserted;
instead, locking is only applied to the processor's caches.
("IA-32 IntelR Architecture Software Developer's Manual,
Volume 3: System Programming Guide").

--

"Eman" <spamtrap@xxxxxxxxxx> wrote in message
news:e06vfn$2dlm$2@xxxxxxxxxxxxxxxxx
According to Intel' manual "when a memory operand is used with the XCHG
instruction, the processor's LOCK signal is automatically
asserted". AMD documentation also states that.

Can someone tell me, which of IA32 compatible processors do not
assert LOCK automatically in the case of XCHG reg,[mem] ?


All IA32 processors automatically lock memory referencing XCHG
instructions, as do 286s. 8086/8 and 8018Xs did not.

You comment about the lock signal not being asserted outside of a
particular CPU when that CPU has the data item cached (specifically if
the processor has the cache line cached in an *exclusive* state), is
correct, but somewhat irrelevant. From a software perspective the
locked region does not have to exceed the actual memory operand
(although it often does), so "locked" access to an exclusive cache line
without asserting the actual inter-processor lock signal does not cause
a software visible change, except for being much, much, faster.

.



Relevant Pages

  • Re: Cached memory never gets released
    ... Stock linux 2.4.26 kernel. ... Due to flash bug 3M of memory gets lost due to font memory getting lost ... The output of "free" cache number steadily grows. ... longer to exhaust all of system memory with the cache. ...
    (Linux-Kernel)
  • Re: Problem: Creating a raw binary string
    ... > While its true that a 64-bit cpu will move twice the data per instruction it ... > Memory bus width plays an important role here and unless it too is widened / ... You are forgetting the two levels of cache in the processor. ... The memory chips are addressed in Row col fashion. ...
    (alt.comp.lang.borland-delphi)
  • Re: Is Greenspun enough?
    ... Most OSes memory map executables directly from the file system so code doesn't pollute the file cache or swap space. ...
    (comp.lang.lisp)
  • Re: Superstitious learning in Computer Architecture
    ... Without a LOT of logic or some other better approach, re-executing the instructions requires re-decoding and it ties up the cache memory bus transferring more data as instructions than the instructions are working on. ... The concept of cache is fundamentally flawed in that it STILL restricts access to one word per clock cycle, when a single modern ALU can easily use 5 plus whatever is eaten up with instruction accesses. ... The size of an optimizing compiler is proportional to the SQUARE of the size of the language times the SQUARE of the complexity of the machine - because all interactions must be considered. ...
    (comp.arch.arithmetic)
  • Re: FPGA-based hardware accelerator for PC
    ... I know that in most cases the CPU ... that it contsins no cache, as BRAMs are too precious resources to be wasted ... The BRAMs are what define the opportunity, ... many threads with full associativity of memory lines using hashed MMU ...
    (comp.arch.fpga)