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

Change for split requests #257

Open
wants to merge 5 commits into
base: jason/dynamorio-traces
Choose a base branch
from

Conversation

aakahlow
Copy link
Contributor

Has not been extensively tested yet.

Copy link
Member

@powerjg powerjg left a comment

Choose a reason for hiding this comment

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

One thing that's missing is updates to numOutstandingMemReqs. Right now, this is going to go below 0 (we should probably add an assert on (new) line 320.

Right now, there is just one memory request added for a split packet, but we are subtracting twice. We should either only subtract when we receive both packets or we should add twice. I think the latter would be better.

@@ -230,9 +261,35 @@ DRTracePlayer::getPacket(DRTraceReader::TraceRef &mem_ref)
}
}

return pkt;
}
PacketPtr split_pkt = NULL;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
PacketPtr split_pkt = NULL;
PacketPtr split_pkt = nullptr;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines 168 to 170
PacketPtr pkt, split_pkt;

std::tie(pkt, split_pkt) = getPacket(mem_ref);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
PacketPtr pkt, split_pkt;
std::tie(pkt, split_pkt) = getPacket(mem_ref);
auto [pkt, split_pkt] = getPacket(mem_ref);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

}
}

return std::make_pair(pkt, split_pkt);
Copy link
Member

Choose a reason for hiding this comment

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

I think the following works in modern C++.

Suggested change
return std::make_pair(pkt, split_pkt);
return {pkt, split_pkt};

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

return false;
}
}

PacketPtr
std::pair<PacketPtr, PacketPtr>
Copy link
Member

Choose a reason for hiding this comment

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

I think this is right, but you should double check me :).

Suggested change
std::pair<PacketPtr, PacketPtr>
std::tuple<PacketPtr, PacketPtr>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

if (stats.memStallStart == 0) {
stats.memStallStart = curTick();
}
numOutstandingMemReqs++;
Copy link
Member

Choose a reason for hiding this comment

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

Why do we increment the outstanding requests when the packet is failed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry, I pushed the wrong version earlier

if (stats.memStallStart == 0) {
stats.memStallStart = curTick();
}
delete pkt;
numOutstandingMemReqs++;
Copy link
Member

Choose a reason for hiding this comment

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

Again, why increcement when it fails?

Comment on lines 171 to 173
// we should not be sending the first pkt again if
// we are retrying only on the second part of the
// previously stalled request
Copy link
Member

Choose a reason for hiding this comment

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

This comment is for the other side of the branch, not this side.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I have understood correctly, the place of the comment should be changed?

Copy link
Member

Choose a reason for hiding this comment

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

Correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added/fixed comments to hopefully make things better and not worse

Comment on lines +175 to +176
// Also, the assumption is that we cannot start a
// new memory request in parallel.
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure how to interpret this statement. Otherwise, it looks good.

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