X86: Use the AddrTrie class to implement the TLB.
Review Request #1143 - Created April 7, 2012 and submitted
| Information | |
|---|---|
| Gabe Black | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 8953:488d45aeb672 --------------------------- X86: Use the AddrTrie class to implement the TLB. This change also adjusts the TlbEntry class so that it stores the number of address bits wide a page is rather than its size in bytes. In other words, instead of storing 4K for a 4K page, it stores 12. 12 is easy to turn into 4K, but it's a little harder going the other way.
Issue Summary
| Description | From | Last Updated | Status |
|---|---|---|---|
| This whole algorithm here is (1) a bit inscrutable and (2) looks potentially inefficient. (1) could be fixed with some ... | Steve Reinhardt | April 8, 2012, 10:20 a.m. | Open |
| same comment here | Steve Reinhardt | April 8, 2012, 10:20 a.m. | Open |
| Under what circumstances would size be 0? Should we even allow construction of a zero-size TLB? | Steve Reinhardt | April 14, 2012, 1:36 a.m. | Open |
| This should probably be if (size == 0) fatal("...") since this could be the result of user error (i.e., a ... | Steve Reinhardt | April 14, 2012, 1:48 p.m. | Open |
| Looks like you got these comment changes in the wrong changeset. Of course, an easy fix is just to merge ... | Steve Reinhardt | April 14, 2012, 1:48 p.m. | Open |
Do you have any results showing that this is actually faster than the current code? Since it's purely a performance optimization, it seems like that should be a prerequisite.
-
src/arch/x86/tlb.cc (Diff revision 1) -
This whole algorithm here is (1) a bit inscrutable and (2) looks potentially inefficient. (1) could be fixed with some comments. Should I be concerned about (2)?
-
src/arch/x86/vtophys.cc (Diff revision 1) -
same comment here
Description: |
|
|||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+112 -74) |
Description: |
|
|||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+111 -74) |
Description: |
|
|||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 4 (+114 -74) |
-
src/arch/x86/tlb.cc (Diff revision 4) -
You've increased the number of comments here by infinity percent, so that's good, but this method still seems a little sparse...
-
src/arch/x86/tlb.cc (Diff revision 4) -
Under what circumstances would size be 0? Should we even allow construction of a zero-size TLB?
-
src/arch/x86/tlb.cc (Diff revision 4) -
So is this whole initial loop just to find an initial value for lru, so it's not undefined in the second loop where we look for the minimum value? If so, wouldn't it be easier to just initialize a minLruSeq variable with UINT64_MAX and use that? Also, wouldn't trieHandle be NULL only if the entry is invalid, in which case that's probably the entry we want to free up even if it's not LRU?
-
src/arch/x86/tlb.cc (Diff revision 4) -
What happens if we take this early return? Seems like in this case we didn't add anything to the free list, and the caller could be rather disappointed about that.
Description: |
|
|||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 5 (+108 -79) |
-
src/arch/x86/tlb.cc (Diff revisions 4 - 5) -
This should probably be if (size == 0) fatal("...") since this could be the result of user error (i.e., a poorly written config script) and not a program bug. -
src/base/trie.hh (Diff revision 5) -
Looks like you got these comment changes in the wrong changeset. Of course, an easy fix is just to merge the changesets ;-). (Sorry, I just can't help it.)
Description: |
|
|||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 6 (+104 -74) |
Ship It!
