[PATCH 4/4] chrt: don't rely on exact values of SCHED_* defines

2018-01-13 Thread Povilas Kanapickas
--- util-linux/chrt.c | 29 - 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/util-linux/chrt.c b/util-linux/chrt.c index 5c5513aeb..8fd4b7bea 100644 --- a/util-linux/chrt.c +++ b/util-linux/chrt.c @@ -36,17 +36,20 @@ #include #include "libbb.h" -s

[PATCH 0/4] Add SCHED_BATCH and SCHED_IDLE support to chrt

2018-01-13 Thread Povilas Kanapickas
Hi, The following patches add SCHED_BATCH and SCHED_IDLE support to chrt. The priority limits are fixed to follow the specification. The last patch avoids hardcoding the values of SCHED_* macros as array indices. Perhaps counter-intuitively, this leads to binary size reduction of 90 bytes on x86

[PATCH 1/4] chrt: add support for SCHED_BATCH

2018-01-13 Thread Povilas Kanapickas
--- util-linux/chrt.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/util-linux/chrt.c b/util-linux/chrt.c index 2712ea3e3..e7abd4f5a 100644 --- a/util-linux/chrt.c +++ b/util-linux/chrt.c @@ -17,13 +17,14 @@ //kbuild:lib-$(CONFIG_CHRT) += chrt.o //usage:

[PATCH 2/4] chrt: add support for SCHED_IDLE

2018-01-13 Thread Povilas Kanapickas
--- util-linux/chrt.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/util-linux/chrt.c b/util-linux/chrt.c index e7abd4f5a..bbd6e2deb 100644 --- a/util-linux/chrt.c +++ b/util-linux/chrt.c @@ -17,7 +17,7 @@ //kbuild:lib-$(CONFIG_CHRT) += chrt.o //usa

[PATCH 3/4] chrt: fix incorrect maximum priority on SCHED_{OTHER,BATCH,IDLE}

2018-01-13 Thread Povilas Kanapickas
--- util-linux/chrt.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/util-linux/chrt.c b/util-linux/chrt.c index bbd6e2deb..5c5513aeb 100644 --- a/util-linux/chrt.c +++ b/util-linux/chrt.c @@ -78,6 +78,8 @@ int chrt_main(int argc UNUSED_PARAM, char **argv)

Re: [PATCH 4/4] chrt: don't rely on exact values of SCHED_* defines

2018-01-23 Thread Povilas Kanapickas
Hi, On 14/01/2018 07:48, Kang-Che Sung wrote: > On Sun, Jan 14, 2018 at 5:30 AM, Povilas Kanapickas wrote: >> --- a/util-linux/chrt.c >> +++ b/util-linux/chrt.c >> @@ -36,17 +36,20 @@ >> #include >> #include "libbb.h" >> >> -static con

Re: [PATCH 0/4] Add SCHED_BATCH and SCHED_IDLE support to chrt

2018-01-23 Thread Povilas Kanapickas
On 23/01/2018 17:09, Denys Vlasenko wrote: > On Sat, Jan 13, 2018 at 10:25 PM, Povilas Kanapickas wrote: >> Hi, >> >> The following patches add SCHED_BATCH and SCHED_IDLE support to chrt. >> The priority limits are fixed to follow the specification. The last >> p