diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-08-02 23:07:33 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-08-02 23:07:33 +0000 |
commit | e4d8ddafc8ab03f1cb0a62c9b35271860942ea8f (patch) | |
tree | ebbac187d1b4096a25072c9052f17515b5fd4e46 | |
parent | 796c31279f04f38de848f9b1e0adafa34d6d48e2 (diff) | |
parent | 41c8d3e8ace06400c2f65f138d34e22ca7720875 (diff) | |
download | ltp-android14-d1-s1-release.tar.gz |
Snap for 10601469 from 41c8d3e8ace06400c2f65f138d34e22ca7720875 to udc-d1-releaseandroid-14.0.0_r9android-14.0.0_r8android-14.0.0_r7android-14.0.0_r6android-14.0.0_r5android-14.0.0_r4android-14.0.0_r3android-14.0.0_r12android-14.0.0_r11android-14.0.0_r10android14-d1-s7-releaseandroid14-d1-s6-releaseandroid14-d1-s5-releaseandroid14-d1-s4-releaseandroid14-d1-s3-releaseandroid14-d1-s2-releaseandroid14-d1-s1-releaseandroid14-d1-release
Change-Id: Ibb1c928b59780b2c2573ddd83c2a0d448d6fc9fe
-rw-r--r-- | lib/tst_timer_test.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/tst_timer_test.c b/lib/tst_timer_test.c index ef9b24d11..eaafc6f0f 100644 --- a/lib/tst_timer_test.c +++ b/lib/tst_timer_test.c @@ -15,6 +15,11 @@ #include "tst_timer_test.h" #define MAX_SAMPLES 500 +#if defined (__arm__) || defined(__aarch64__) +#define BASE_THRESHOLD 500 +#else +#define BASE_THRESHOLD 400 +#endif static const char *scall; static void (*setup)(void); @@ -166,8 +171,10 @@ static int cmp(const void *a, const void *b) /* * The threshold per one syscall is computed as a sum of: * - * 400 us - accomodates for context switches, process - * migrations between CPUs on SMP, etc. + * 400 or 500 us - accomodates for context switches, process + * migrations between CPUs on SMP, etc. Increase to + * 500 on arm/arm64 to allow for increased little CPU + * scheduling * 2*monotonic_resolution - accomodates for granurality of the CLOCK_MONOTONIC * slack_per_scall - max of 0.1% of the sleep capped on 100ms or * current->timer_slack_ns, which is slack allowed @@ -188,7 +195,7 @@ static long long compute_threshold(long long requested_us, slack_per_scall = MAX(slack_per_scall, timerslack); - return (400 + 2 * monotonic_resolution + slack_per_scall) * nsamples + return (BASE_THRESHOLD + 2 * monotonic_resolution + slack_per_scall) * nsamples + 3000/nsamples; } |