All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH V2] syscalls/sched_rr_get_interval: Validate the timeslice
Date: Mon, 6 Jul 2020 12:41:22 +0800	[thread overview]
Message-ID: <c3ffe29c-580d-5c7d-feb9-071c4dee98e0@cn.fujitsu.com> (raw)
In-Reply-To: <81a952af30185d5c72cda19d322d7abbbf7bd8fe.1594006171.git.viresh.kumar@linaro.org>

Hi Viresh

Acked-by.

> Validate the timespec returned by sched_rr_get_interval() against the
> value read from /proc/sys/kernel/sched_rr_timeslice_ms.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
> V2:
> - Add .tags entry
> - check if file is present or not.
> 
>   .../sched_rr_get_interval01.c                     | 15 +++++++++++++++
>   1 file changed, 15 insertions(+)
> 
> diff --git a/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval01.c b/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval01.c
> index 31d7b5d56a52..0466be36bec0 100644
> --- a/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval01.c
> +++ b/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval01.c
> @@ -5,11 +5,18 @@
>    *
>    * Gets round-robin time quantum by calling sched_rr_get_interval() and
>    * checks that the value is sane.
> + *
> + * It is also a regression test for kernel
> + * commit 975e155ed873 ("sched/rt: Show the 'sched_rr_timeslice' SCHED_RR
> + * timeslice tuning knob in milliseconds").
>    */
>   
>   #include <sched.h>
>   #include "tst_timer.h"
>   
> +#define PROC_SCHED_RR_TIMESLICE_MS	"/proc/sys/kernel/sched_rr_timeslice_ms"
> +static int proc_flag;
> +
>   struct tst_ts tp;
>   
>   static struct test_variants {
> @@ -39,6 +46,8 @@ static void setup(void)
>   
>   	if ((sched_setscheduler(0, SCHED_RR, &p)) == -1)
>   		tst_res(TFAIL | TTERRNO, "sched_setscheduler() failed");
> +
> +	proc_flag = !access(PROC_SCHED_RR_TIMESLICE_MS, F_OK);
>   }
>   
>   static void run(void)
> @@ -62,6 +71,8 @@ static void run(void)
>   		        tst_ts_get_sec(tp), tst_ts_get_nsec(tp));
>   	}
>   
> +	if (proc_flag)
> +		TST_ASSERT_INT("/proc/sys/kernel/sched_rr_timeslice_ms", tst_ts_to_ms(tp));
>   }
>   
>   static struct tst_test test = {
> @@ -69,4 +80,8 @@ static struct tst_test test = {
>   	.test_variants = ARRAY_SIZE(variants),
>   	.setup = setup,
>   	.needs_root = 1,
> +	.tags = (const struct tst_tag[]) {
> +		{"linux-git", "975e155ed873"},
> +		{}
> +	}
>   };
> 



  reply	other threads:[~2020-07-06  4:41 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-26  6:22 [LTP] [PATCH V7 00/19] Syscalls: Add support for time64 variants Viresh Kumar
2020-06-26  6:22 ` [LTP] [PATCH V7 01/19] tst_timer: Add new definitions Viresh Kumar
2020-06-26  9:49   ` Cyril Hrubis
2020-06-26  6:22 ` [LTP] [PATCH V7 02/19] syscalls/timer_gettime: Add support for time64 tests Viresh Kumar
2020-06-26  9:49   ` Cyril Hrubis
2020-06-26  6:22 ` [LTP] [PATCH V7 03/19] syscalls/timer_settime: " Viresh Kumar
2020-06-29  9:39   ` Cyril Hrubis
2020-06-29 11:43     ` Viresh Kumar
2020-06-26  6:22 ` [LTP] [PATCH V7 04/19] syscalls/timerfd: " Viresh Kumar
2020-07-02 12:24   ` Cyril Hrubis
2020-06-26  6:22 ` [LTP] [PATCH V7 05/19] syscalls/sched_rr_get_interval: " Viresh Kumar
2020-07-02 13:06   ` Cyril Hrubis
2020-07-03  3:15     ` Viresh Kumar
2020-07-03  5:52       ` Yang Xu
2020-07-03  7:26         ` Viresh Kumar
2020-07-03  7:38   ` [LTP] [PATCH] syscalls/sched_rr_get_interval: Validate the timeslice Viresh Kumar
2020-07-03  7:43     ` Yang Xu
2020-07-03  7:51       ` Viresh Kumar
2020-07-03  8:00         ` Yang Xu
2020-07-03  8:18           ` Viresh Kumar
2020-07-03  9:01             ` Yang Xu
2020-07-03 14:08     ` Cyril Hrubis
2020-07-06  3:31     ` [LTP] [PATCH V2] " Viresh Kumar
2020-07-06  4:41       ` Yang Xu [this message]
2020-07-07  9:30       ` Cyril Hrubis
2020-06-26  6:22 ` [LTP] [PATCH V7 06/19] syscalls/futex: Merge futex_wait_bitset tests Viresh Kumar
2020-07-03  9:15   ` Cyril Hrubis
2020-06-26  6:22 ` [LTP] [PATCH V7 07/19] syscalls/futex: Add support for time64 tests Viresh Kumar
2020-07-03 12:45   ` Cyril Hrubis
2020-07-06 10:40     ` Viresh Kumar
2020-07-06 11:36       ` Viresh Kumar
2020-07-06 11:40   ` [LTP] [PATCH V7.1 " Viresh Kumar
2020-07-23 19:44     ` Cyril Hrubis
2020-07-24  2:33       ` Viresh Kumar
2020-06-26  6:22 ` [LTP] [PATCH V7 08/19] syscalls/io_pgetevents: " Viresh Kumar
2020-07-03 14:59   ` Cyril Hrubis
2020-06-26  6:22 ` [LTP] [PATCH V7 09/19] syscalls/sigwaitinfo: Migrate to new test framework Viresh Kumar
2020-07-03 13:58   ` Cyril Hrubis
2020-07-06  2:39     ` Viresh Kumar
2020-07-07 15:16       ` Cyril Hrubis
2020-07-09 10:46         ` Viresh Kumar
2020-06-26  6:22 ` [LTP] [PATCH V7 10/19] syscalls/rt_sigtimedwait: Add support for time64 tests Viresh Kumar
2020-07-22 10:03   ` Cyril Hrubis
2020-06-26  6:22 ` [LTP] [PATCH V7 11/19] syscalls/mq_timed{send|receive}: " Viresh Kumar
2020-07-24 14:51   ` Cyril Hrubis
2020-06-26  6:22 ` [LTP] [PATCH V7 12/19] syscalls/recvmmsg: " Viresh Kumar
2020-07-24 15:13   ` Cyril Hrubis
2020-06-26  6:22 ` [LTP] [PATCH V7 13/19] syscalls/ppoll: " Viresh Kumar
2020-07-27  9:17   ` Cyril Hrubis
2020-06-26  6:22 ` [LTP] [PATCH V7 14/19] syscalls/select6: " Viresh Kumar
2020-07-27  9:40   ` Cyril Hrubis
2020-07-28  7:23     ` Viresh Kumar
2020-07-28  8:02       ` Arnd Bergmann
2020-06-26  6:22 ` [LTP] [PATCH V7 15/19] syscalls/semop: Migrate to new test framework Viresh Kumar
2020-07-27 13:46   ` Cyril Hrubis
2020-06-26  6:22 ` [LTP] [PATCH V7 16/19] syscalls/semtimedop: Add support for semtimedop and its time64 version Viresh Kumar
2020-06-26  6:22 ` [LTP] [PATCH V7 17/19] syscalls/utimensat: Migrate to new test framework Viresh Kumar
2020-07-27 15:35   ` Cyril Hrubis
2020-06-26  6:22 ` [LTP] [PATCH V7 18/19] syscalls/utimensat: Add support for time64 tests Viresh Kumar
2020-06-26  6:22 ` [LTP] [PATCH V7 19/19] syscalls: clock_settime: Add test around y2038 vulnerability Viresh Kumar
2020-07-28 12:11   ` Cyril Hrubis
2020-08-04 12:37     ` Viresh Kumar
2020-07-20 10:19 ` [LTP] [PATCH V7 00/19] Syscalls: Add support for time64 variants Viresh Kumar
2020-07-22 10:04   ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c3ffe29c-580d-5c7d-feb9-071c4dee98e0@cn.fujitsu.com \
    --to=xuyang2018.jy@cn.fujitsu.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.