2015-05-13 22:13:14

by John Stultz

[permalink] [raw]
Subject: [PATCH 0/3] A few small fixups to the alarmtimer-suspend test

Hey Shuah,
Wanted to send along a few small fixups to the alarmtimer-suspend
test that I had pending.

Let me know if you have any objections or feedback.

thanks
-john

Cc: Shuah Khan <[email protected]>
Cc: Prarit Bhargava <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Richard Cochran <[email protected]>

John Stultz (3):
kselftests: timers: Increase delay between suspends in
alarmtimer-suspend
kselftests: timers: Ease alarmtimer-suspend unreasonable latency value
kselftests: timers: Check _ALARM clockids are supported before
suspending

tools/testing/selftests/timers/alarmtimer-suspend.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

--
1.9.1


2015-05-13 22:14:26

by John Stultz

[permalink] [raw]
Subject: [PATCH 1/3] kselftests: timers: Increase delay between suspends in alarmtimer-suspend

When testing on some hardware, waiting only a second before
re-triggering suspend can keep TCP connections from re-establishing
which after a number of cycles can cause TCP connections to close
while the test is running.

So extend the delay between suspend calls to 3 seconds to let
the connections stay alive.

Cc: Shuah Khan <[email protected]>
Cc: Prarit Bhargava <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Richard Cochran <[email protected]>
Signed-off-by: John Stultz <[email protected]>
---
tools/testing/selftests/timers/alarmtimer-suspend.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/timers/alarmtimer-suspend.c b/tools/testing/selftests/timers/alarmtimer-suspend.c
index aaffbde..99a1ad3 100644
--- a/tools/testing/selftests/timers/alarmtimer-suspend.c
+++ b/tools/testing/selftests/timers/alarmtimer-suspend.c
@@ -172,7 +172,7 @@ int main(void)
while (alarmcount < 10) {
int ret;

- sleep(1);
+ sleep(3);
ret = system("echo mem > /sys/power/state");
if (ret)
break;
--
1.9.1

2015-05-13 22:14:23

by John Stultz

[permalink] [raw]
Subject: [PATCH 2/3] kselftests: timers: Ease alarmtimer-suspend unreasonable latency value

On the hardware I have, resume latency from an alarm is often
2-3 seconds (with a fair amount of variability due to the RTC's
single second granularity). Having four seconds be the pass/fail
bar is maybe a little too tight, so extend this to 5 seconds.

Cc: Shuah Khan <[email protected]>
Cc: Prarit Bhargava <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Richard Cochran <[email protected]>
Signed-off-by: John Stultz <[email protected]>
---
tools/testing/selftests/timers/alarmtimer-suspend.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/timers/alarmtimer-suspend.c b/tools/testing/selftests/timers/alarmtimer-suspend.c
index 99a1ad3..13586b6 100644
--- a/tools/testing/selftests/timers/alarmtimer-suspend.c
+++ b/tools/testing/selftests/timers/alarmtimer-suspend.c
@@ -57,7 +57,7 @@ static inline int ksft_exit_fail(void)


#define NSEC_PER_SEC 1000000000ULL
-#define UNREASONABLE_LAT (NSEC_PER_SEC * 4) /* hopefully we resume in 4secs */
+#define UNREASONABLE_LAT (NSEC_PER_SEC * 5) /* hopefully we resume in 5 secs */

#define SUSPEND_SECS 15
int alarmcount;
--
1.9.1

2015-05-13 22:13:18

by John Stultz

[permalink] [raw]
Subject: [PATCH 3/3] kselftests: timers: Check _ALARM clockids are supported before suspending

It was reported that the alarmtimer-suspend test hangs on older
systems that don't support _ALARM clockids.

This is due to the fact that we don't check if the timer_create
fails, and thus when we suspend, the system will not programatically
resume.

Fix this by checking the timer_create call for errors.

Cc: Shuah Khan <[email protected]>
Cc: Prarit Bhargava <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Richard Cochran <[email protected]>
Signed-off-by: John Stultz <[email protected]>
---
tools/testing/selftests/timers/alarmtimer-suspend.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/timers/alarmtimer-suspend.c b/tools/testing/selftests/timers/alarmtimer-suspend.c
index 13586b6..72cacf5 100644
--- a/tools/testing/selftests/timers/alarmtimer-suspend.c
+++ b/tools/testing/selftests/timers/alarmtimer-suspend.c
@@ -152,7 +152,11 @@ int main(void)
alarm_clock_id++) {

alarmcount = 0;
- timer_create(alarm_clock_id, &se, &tm1);
+ if (timer_create(alarm_clock_id, &se, &tm1) == -1) {
+ printf("timer_create failled, %s unspported?\n",
+ clockstring(alarm_clock_id));
+ break;
+ }

clock_gettime(alarm_clock_id, &start_time);
printf("Start time (%s): %ld:%ld\n", clockstring(alarm_clock_id),
--
1.9.1

2015-05-13 23:05:00

by Shuah Khan

[permalink] [raw]
Subject: Re: [PATCH 0/3] A few small fixups to the alarmtimer-suspend test

On 05/13/2015 04:13 PM, John Stultz wrote:
> Hey Shuah,
> Wanted to send along a few small fixups to the alarmtimer-suspend
> test that I had pending.
>
> Let me know if you have any objections or feedback.
>

Hi John,

No issues with these. We are tweaking sleep and suspend
times. The nature of the beast I am guessing. I gave it
test run and looks good. I would like to get these into
rc5. Patches 1 and 3 look like critical fixes to
me. I will wait a couple of days for any reviews comments
before I apply them to linux-kselftest fixes.

thanks,
-- Shuah


--
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
[email protected] | (970) 217-8978

2015-05-13 23:16:26

by John Stultz

[permalink] [raw]
Subject: Re: [PATCH 0/3] A few small fixups to the alarmtimer-suspend test

On Wed, May 13, 2015 at 4:04 PM, Shuah Khan <[email protected]> wrote:
> On 05/13/2015 04:13 PM, John Stultz wrote:
>> Hey Shuah,
>> Wanted to send along a few small fixups to the alarmtimer-suspend
>> test that I had pending.
>>
>> Let me know if you have any objections or feedback.
>>
>
> Hi John,
>
> No issues with these. We are tweaking sleep and suspend
> times. The nature of the beast I am guessing. I gave it
> test run and looks good. I would like to get these into
> rc5. Patches 1 and 3 look like critical fixes to
> me. I will wait a couple of days for any reviews comments
> before I apply them to linux-kselftest fixes.

I'd not claim any of them are actually urgent. So if you'd rather
queue these for 4.2 I'm fine with it.

thanks
-john

2015-05-13 23:18:30

by Shuah Khan

[permalink] [raw]
Subject: Re: [PATCH 0/3] A few small fixups to the alarmtimer-suspend test

On 05/13/2015 05:16 PM, John Stultz wrote:
> On Wed, May 13, 2015 at 4:04 PM, Shuah Khan <[email protected]> wrote:
>> On 05/13/2015 04:13 PM, John Stultz wrote:
>>> Hey Shuah,
>>> Wanted to send along a few small fixups to the alarmtimer-suspend
>>> test that I had pending.
>>>
>>> Let me know if you have any objections or feedback.
>>>
>>
>> Hi John,
>>
>> No issues with these. We are tweaking sleep and suspend
>> times. The nature of the beast I am guessing. I gave it
>> test run and looks good. I would like to get these into
>> rc5. Patches 1 and 3 look like critical fixes to
>> me. I will wait a couple of days for any reviews comments
>> before I apply them to linux-kselftest fixes.
>
> I'd not claim any of them are actually urgent. So if you'd rather
> queue these for 4.2 I'm fine with it.
>

ok I will get them into 4.2 then.

thanks,
-- Shuah


--
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
[email protected] | (970) 217-8978

2015-05-14 00:39:57

by Shuah Khan

[permalink] [raw]
Subject: Re: [PATCH 0/3] A few small fixups to the alarmtimer-suspend test

On 05/13/2015 05:16 PM, John Stultz wrote:
> On Wed, May 13, 2015 at 4:04 PM, Shuah Khan <[email protected]> wrote:
>> On 05/13/2015 04:13 PM, John Stultz wrote:
>>> Hey Shuah,
>>> Wanted to send along a few small fixups to the alarmtimer-suspend
>>> test that I had pending.
>>>
>>> Let me know if you have any objections or feedback.
>>>
>>
>> Hi John,
>>
>> No issues with these. We are tweaking sleep and suspend
>> times. The nature of the beast I am guessing. I gave it
>> test run and looks good. I would like to get these into
>> rc5. Patches 1 and 3 look like critical fixes to
>> me. I will wait a couple of days for any reviews comments
>> before I apply them to linux-kselftest fixes.
>
> I'd not claim any of them are actually urgent. So if you'd rather
> queue these for 4.2 I'm fine with it.
>

Applied to linux-kselftest next for 4.2

thanks,
-- Shuah


--
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
[email protected] | (970) 217-8978