This is an archive of the discontinued LLVM Phabricator instance.

Increase the timeout for pwrite on android
AbandonedPublic

Authored by tberghammer on Feb 20 2015, 7:37 AM.

Details

Reviewers
vharron
ovyalov
Summary

Increase the timeout for pwrite on android

The increase is necessary because with the default timeout pwrite often times out on android. Most likely it happens when a new page is created on the device.

Diff Detail

Event Timeline

tberghammer retitled this revision from to Increase the timeout for pwrite on android.
tberghammer updated this object.
tberghammer edited the test plan for this revision. (Show Details)
tberghammer added reviewers: vharron, ovyalov.
tberghammer added a subscriber: Unknown Object (MLST).
vharron edited edge metadata.Feb 20 2015, 9:36 AM

Whoa. Is that 5ms? IMO, Our default timeout should be much higher than that overall.

It is measured in seconds (I don't know why) and the default timeout is 1 second.

ovyalov edited edge metadata.Feb 20 2015, 10:28 AM

Please see my comments.

source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
233

It will be great to have sort of ScopedTimeout class which sets a new timeout in constructor (along with saving a previous old timeout value) and resets old value in destructor.
As I can see such pattern (set new timeout/ restore old timeout) has a few occurrences

233

For such request the transfer latency depends on a size of buffer (src_len) - is it possible to make timeout a function of buffer size?

It will be great to have sort of ScopedTimeout class

Yes

is it possible to make timeout a function of buffer size?

I'm nervous that adb and per-device write times are incredibly difficult to predict. We should let this be a little sloppy.

tberghammer edited edge metadata.

Use the ScopedTimeout class

From now on this CL is depends on D7826

source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
233

Currently we have a previous layer which makes each request at most 1024 byte but the latency still have a huge variance (most of the request is fast, but some of them is very slow). Based on it I don't think we can make a reasonable function from buffer size to timeout because a huge part of the latency caused by factors independent from it.

233

I created the scoped timeout class (D7826) and updated this CL to use it

ovyalov accepted this revision.Feb 23 2015, 9:53 AM
ovyalov edited edge metadata.
This revision is now accepted and ready to land.Feb 23 2015, 9:53 AM
tberghammer abandoned this revision.Feb 25 2015, 3:44 AM

Abandon as D7853 make it unnecessary.