4 ms·
Page faults are a "trap" rather than an "interrupt", aren't they? In that they're internal to the CPU-MMU system and delivered synchronously. The answer is a g
by pjc50 11y ago
Page faults are a "trap" rather than an "interrupt", aren't they? In that they're internal to the CPU-MMU system and delivered synchronously.
The answer is a good stackexchange answer in that it's about a page long and covers all the key points. It gives a link to "page" for those who want to understand that subsystem. It's not necessary to include a whole computer architecture course.
- DSMan195276 11y agoIt's debatable - 'trap' isn't extremely well defined, it depends on the architecture. For x86 you'd really call it an exception rather then trap (Trap is used for a bit of a different meaning as far as interrupts go). At the end of the day though, with x86 exceptions/traps/interrupts are all handled like an interrupt (With a few differing details in how they are setup), so saying it's "basically an interrupt" is probably fine, at the very least it's close enough for a high-level explanation.
- steveklabnik 11y agoMy understanding is that "interrupt" is the most general term, and "fault," "trap," and "exception" are all various kinds of interrupts with a very unclear set of rules distinguishing them. And of course this is all architecture dependent.
- hacknat 11y agoFault simply means that the TLB has a cache miss and then traps to the OS to handle the miss. "Fault" is a concept of what is happening a "trap" is what happens. Edit: x86 does have a register for defining the location of page tables that it will walk, the it would trap on a miss if the PTE is missing. Idk, if Linux uses this register or not or uses a software defined TLB, or some kind of hybrid approach.
- moyix 11y ago> x86 does have a register for defining the location of page tables that it will walk, the it would trap on a miss if the PTE is missing. Idk, if Linux uses this register or not or uses a software defined TLB, or some kind of hybrid approach. TLB management is done in hardware on x86. TLB misses don't generate exceptions, they just trigger page table walks in hardware, and then if the page table walk fails (e.g. because of a non-present page table entry) it triggers a CPU exception (page fault) that the OS can then handle. Things like MIPS use a software-managed TLB that works roughly as you describe, though.
- deleted 11y ago[deleted]
- hacknat 11y agoIf you read what I wrote you'll see that I said this.