Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i#4881: Fix LRU counter bug in drcachesim #4883

Conversation

EagleEyeKestrel
Copy link
Contributor

No description provided.

@EagleEyeKestrel
Copy link
Contributor Author

@derekbruening Simple fix, expect your review, thanks

Copy link
Contributor

@derekbruening derekbruening left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the patch! We'll leave a unit test as separate work once infrastructure is in place under #4842.

@derekbruening
Copy link
Contributor

The behavior change slightly changes the miss counts and breaks the two tests tool.drcacheoff.legacy and tool.drcacheoff.snappy. The expected output needs to be updated.

@derekbruening
Copy link
Contributor

run arm tests

@derekbruening
Copy link
Contributor

The behavior change slightly changes the miss counts and breaks the two tests tool.drcacheoff.legacy and tool.drcacheoff.snappy. The expected output needs to be updated.

@EagleEyeKestrel if you could update clients/drcachesim/tests/offline-legacy.templatex and clients/drcachesim/tests/offline-snappy-serial.templatex so that they pass -- easiest by running locally, or look at the log from the failure link above.

@EagleEyeKestrel
Copy link
Contributor Author

The behavior change slightly changes the miss counts and breaks the two tests tool.drcacheoff.legacy and tool.drcacheoff.snappy. The expected output needs to be updated.

@EagleEyeKestrel if you could update clients/drcachesim/tests/offline-legacy.templatex and clients/drcachesim/tests/offline-snappy-serial.templatex so that they pass -- easiest by running locally, or look at the log from the failure link above.

let me try

@@ -1,5 +1,5 @@
Cache simulation results:
.*
LL stats:
Hits: 58,699
Hits: 78,312
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Wow this is a non-trivial change. The other "legacy" test had very minor changes. Wondering if this LRU issue caused other noticeable result differences on other workloads.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. When I looked at this, I was thinking I made something wrong... But it really changes a lot. (BTW, I think this bug in LRU really could result in great difference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh it failed again

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think that is an unrelated flaky test...checking

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is #3213 which unfortunately has happened before but nobody has reproduced locally.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read log and see some timeout.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read log and see some timeout.

If you could paste a link to what you are seeing? Only the Windows test was red.

@derekbruening
Copy link
Contributor

run arm tests

@derekbruening
Copy link
Contributor

As noted in the thread the failure is win32.setthreadcontext #3213.

@derekbruening derekbruening merged commit b39b85d into DynamoRIO:master Apr 29, 2021
@derekbruening
Copy link
Contributor

Thanks again for finding and fixing this bug! Adding better unit tests (#4842) should be a higher priority to catch things like this.

derekbruening pushed a commit that referenced this pull request Apr 29, 2021
Fixes a bug where the LRU counters were never incremented beyond 2,
resulting in the incorrect line being replaced in some circumstances.

Updates the two stored-trace tests whose precise miss stats are now different.
The legacy tests has minor changes; but the snappy test has a big difference
in LLC hits, so this bug may have caused non-trivial behavior changes for
some workloads.

Co-authored-by: Derek Bruening <[email protected]>
Fixes #4881
bete0 added a commit that referenced this pull request Mar 8, 2022
This change adds unit tests for clients/drcachesim/simulators/cache_lru.cpp.
These unit tests catch issues reported in i#4881 which was tested by
reverting the fix for that issue (#4883).

Issue: #4842
bete0 added a commit that referenced this pull request Mar 18, 2022
This change adds unit tests for clients/drcachesim/simulators/cache_lru.cpp.
These unit tests catch issues reported in i#4881 which was tested by
reverting the fix for that issue (#4883).

Issue: #4842
bete0 added a commit that referenced this pull request Mar 18, 2022
This change adds unit tests for clients/drcachesim/simulators/cache_lru.cpp.
These unit tests catch issues reported in i#4881 which was tested by
reverting the fix for that issue (#4883).

Issue: #4842
bete0 added a commit that referenced this pull request Mar 21, 2022
This change adds unit tests for clients/drcachesim/simulators/cache_lru.cpp.
These unit tests catch issues reported in i#4881 which was tested by
reverting the fix for that issue (#4883).

Issue: #4842
derekbruening pushed a commit that referenced this pull request Mar 23, 2022
Adds a unit test for clients/drcachesim/simulators/cache_lru.cpp.
This unit test catches a bug reported in i#4881 which was tested by
reverting the fix for that issue (PR #4883).

Issue: #4842, #4881
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants