It isn't that the bus is locked (assert the LOCK# pin on the chip) during
the "inc" instruction but that the instruction can't be interrupted by the
CPU once the memory operand is fetched (except for write fault, which makes
sense). The LOCK prefix asserts a hardware line to tell all the other
processors to stay the hell off the bus while the CPU does its thing.
This dates back to the original 8086.
To the topic at hand. This blocks multiple WRITERS of a memory area. It
also permits sequencing of READERS and WRITERS if sequencing is
important. From my understanding of this thread, there is exactly one
WRITER of the variable "jiffies", and sequencing isn't important because if
two CPUs are racing the LOCK prefix isn't going to fix the problems that
two or more CPUs can run into if the timer changes value in the middle of
certain routines.
(Want to avoid problems? Don't allow the setup of any delay of less than
two clock ticks from "now".)
Stephen Satchell
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/