Commit Graph

207 Commits

Author SHA1 Message Date
Yuri Chornoivan bbac757b1e textual: fix typos in messages 2012-09-04 17:26:31 +02:00
Karel Zak dcdb349be7 build-sys: always use default $(LDADD)
The global variable $(LDADD) is always used if program_LDADD is
not specified. Let's use $LDADD everywhere to avoid exceptions for
people who need to specify global $LDADD.

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-09 16:23:51 +02:00
Karel Zak f38e5ff355 build-sys: cleanup .gitignore files
- move all binaries to top-level .gitignore
 - remove unnecessary */.gitignore files

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-26 20:50:54 +02:00
Karel Zak d77ab74af7 build-sys: convert lib/ to libcommon.la
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-26 20:50:53 +02:00
Karel Zak 5ed5df5d6e build-sys: convert schedutils/ to module
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-26 17:25:24 +02:00
Karel Zak 630ed89d5a schedutils: cleanup strtoxx_or_err()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-15 17:45:05 +02:00
Sami Kerola ed8ec2a65d schedutils: verify writing to streams was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-04-04 19:51:32 +02:00
Sami Kerola f06b43285d build-sys: enhance readability of the autotools files
Several horizontal lists are turned to vertical, and sorted to
alphabetical order. Additionally spaces are converted to tabs where
ever possible.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-02-28 13:29:35 +01:00
Sami Kerola 7cebf0bb4f docs: corrections to FSF license files, and postal address
The COPYING and Documentation/licenses/COPYING* files are being
replaced by files from GNU web site.

http://www.gnu.org/licenses/gpl-2.0.txt
http://www.gnu.org/licenses/lgpl-2.1.txt

Postal addresses to FSF in other files are updated to match with the
address in license files.

Reference: http://lists.gnu.org/archive/html/freefont-announce/2005-04/msg00001.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-02-24 14:13:35 +01:00
Sami Kerola 2f5a248420 taskset: use appropriate variable type [cppcheck]
[schedutils/taskset.c:182]: (style) Checking if unsigned variable 'ncpus' is less than zero.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-02-08 14:13:34 +01:00
Karel Zak 337b8eade0 chrt: add comment to keep static analysers happy 2012-01-31 21:16:28 +01:00
Karel Zak 17d5e11bf8 build-sys: cleanup BUILD_SCHEDUTILS
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-11-03 12:32:50 +01:00
Karel Zak b82c15bd19 Merge branch 'chcpu' of git://git.kernel.org/pub/scm/linux/kernel/git/heiko/util-linux
* 'chcpu' of git://git.kernel.org/pub/scm/linux/kernel/git/heiko/util-linux:
  chcpu: new tool
  cpuset: add option to allow cpulist_parse() to fail
2011-08-31 11:49:27 +02:00
Benno Schulenberg 530395f2d5 ionice: adjust synopsis and wording and formatting on the man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-29 11:24:45 +02:00
Benno Schulenberg 232dc924c4 docs: uniformize the header and footer lines in man pages
Use dates without the day, use the full month name, put "util-linux" in
the lower left corner, and "User Commands" or "System Administration"
at the top center.

Also improve here and there the one-line program description.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-22 10:39:21 +02:00
Heiko Carstens b16f615afb cpuset: add option to allow cpulist_parse() to fail
This is a preparation patch for chcpu. If a cpu should be added to
a cpu_set where the cpu doesn't fit into the cpu_set this got silently
ignored.
Since the cpu-list is user space provided it should be checked if cpus
are specified that are completely out of range of the system.
In order to do that add a parameter which specifies if cpulist_parse()
should fail if it parses a cpu-list with "impossible" cpus.
The current callers have been converted so they behave like before.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-08-15 07:52:44 +02:00
Benno Schulenberg a92eea152b ionice: slightly improve grammar, spacing and consistency of man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-08 11:58:51 +02:00
Benno Schulenberg 64109bbaf5 taskset: adjust style of man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-08 11:58:50 +02:00
Benno Schulenberg 397a511458 chrt: adjust style of man page, alphabetize option -p
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-08 11:58:48 +02:00
Karel Zak c150589fce chrt: silently ignore -R if unsupported
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-02 14:29:03 +02:00
Karel Zak cee12fc60c ionice: fix compiler warnings [-Wsign-compare]
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-01 13:17:54 +02:00
Karel Zak 9feec79cc5 misc: use unsigned int for bit-fileds
Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-29 10:51:06 +02:00
Karel Zak cbc1dc969b ionice: make -t more tolerant
* replace errx() with warnx() for unknown -c class

  The right place to check I/O scheduler features is in kernel. We should
  not try to be more smart than kernel.

* make the code ready (robust) for unknown sched.classes

* fix -t behavior

	old version:
	  $ ionice -c 4 -t bash
	  ionice: bad prio class 4

	new version:
	  $ ionice -c 4 -t bash

Reported-by: Voelker, Bernhard" <bernhard.voelker@siemens-enterprise.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-22 12:55:01 +02:00
Karel Zak fe040397f9 ionice: allow to use names for -c <class>
for example:

   $ ionice -c best-effort bash

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-22 11:39:06 +02:00
Karel Zak fcc2b2da4c ionice: improve command line interpretation
ionice                       : print the current I/O prio.
 ionice COMMAND               : exec command with default (best-effort) class
 ionice -p PID [...]          : return info about the PID(s)
 ionice -c CLASS COMMAND      : exec command with the class
 ionice -c CLASS -p PID [...] : modify PID(s) class

This should be backwardly compatible and also compatible with nice(1)
from coreutils.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-22 11:24:05 +02:00
Sami Kerola 8a44fb011d chrt: add strings to use NLS
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-21 17:32:28 +02:00
Sami Kerola 02ad010012 taskset: coding style fixes
Reindentation and deletion of few empty lines etc. There is no
actual code changes in this patch.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-21 17:30:24 +02:00
Sami Kerola 6f45c0e9ff taskset: include-what-you-use header check
taskset.c should add these lines:
 #include <sched.h>   for sched_getaffinity, etc
 #include <stddef.h>  for size_t
 #include <string.h>  for memset

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-21 17:29:38 +02:00
Sami Kerola 4033fbe3e6 docs: mention long options in ionice.1
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-21 17:28:32 +02:00
Sami Kerola a5e9b75fac ionice: coding style fixes
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-21 17:09:28 +02:00
Sami Kerola abd57eb3e3 ionice: fix -V output
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-21 17:04:36 +02:00
Karel Zak 7ab08ba3e5 ionice: fix -p
$ ionice 123
 none: prio 4
 none: prio 4

It calls ioprio_get(0x1, 0) and ioprio_get(0x1, 123), because the
code does not check it the "-p" options was specified.

The proper command line syntax is:

  $ ionice -p 123

and the ioprio_get() should be called only once.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-21 17:02:52 +02:00
Karel Zak 560cdabbfa ionice: IOPRIO_PRIO_* macros
* make the code more robust
 * follow kernel conventions for variable names
   (data = classdata, ioprio = classdata | class)

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-21 16:33:20 +02:00
Sami Kerola 976b7580e0 ionice: add long options
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-21 16:03:35 +02:00
Sami Kerola 110d680af8 chrt: coding style fix
Make horizontal list vertical and few other enhancements to
readability.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-21 15:53:44 +02:00
Sami Kerola 90b7d261b9 chrt: data type compiler warning fixed
chrt.c:158:16: warning: comparison of integers of different
	signs: 'int' and 'unsigned long' [-Wsign-compare]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-21 15:52:25 +02:00
Karel Zak 58a111bdb2 build-sys: move BUILD_SCHEDUTILS to top-level Makefile
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-06-20 13:51:26 +02:00
Davidlohr Bueso 1b9b57ace5 chrt: clarify use of -a option
With this option we can operate on all the thread group of a process not just
for changes, but also when obtaining information via sched_getscheduler().

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2011-05-17 16:29:59 +02:00
Davidlohr Bueso 42708f12f0 taskset: make threads aware
Add a new '-a' option to view/modify the CPU affinity for an entire
group of threads belonging to a given PID.  We create two new
functions, print_affinity() and do_taskset() for code simplification.

Example:

zeus@jilguero:~/src/util-linux/schedutils$ ./taskset -a -p 01 3142
pid 3142's current affinity mask: 2
pid 3142's new affinity mask: 1
pid 3164's current affinity mask: 2
pid 3164's new affinity mask: 1
pid 854's current affinity mask: 2
pid 854's new affinity mask: 1

[kzak@redhat.com: - clean up
                  - move variables to struct taskset]

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Tested-by: Jonathan Gonzalez <zeus@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-05-11 16:17:56 +02:00
Davidlohr Bueso dd29a76293 taskset: use xalloc lib
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2011-05-11 10:06:58 +02:00
Davidlohr Bueso f82ce2aab1 chrt.1: fix grammar
Corrent the English grammar for the new -a option.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2011-05-10 14:21:33 +02:00
Karel Zak 503cbbe1d4 chrt: allow to use --all-tasks when retrieve info
master thread:
 $ chrt --pid $(pidof firefox)

all threads:
 $ chrt --all-tasks --pid $(pidof firefox)

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-05-05 14:23:38 +02:00
Davidlohr Bueso 78904e7647 chrt: make threads aware
Currently this program works only with the master thread. Add a '-t'
option to propagate changes to the entire group of threads.

Example:

root@offworld:~/projects/util-linux/schedutils# ls /proc/2111/task/
2111  2112  2119  2121  2138  2139  2159  2160
root@offworld:~/projects/util-linux/schedutils# ./chrt -p 2111
pid 2111's current scheduling policy: SCHED_RR
pid 2111's current scheduling priority: 3
root@offworld:~/projects/util-linux/schedutils# ./chrt -t -p 2 2111
root@offworld:~/projects/util-linux/schedutils# ./chrt -p 2112
pid 2112's current scheduling policy: SCHED_RR
pid 2112's current scheduling priority: 2
root@offworld:~/projects/util-linux/schedutils# ./chrt -p 2111
pid 2111's current scheduling policy: SCHED_RR
pid 2111's current scheduling priority: 2

[kzak@redhat.com: - rename -t/--thread to -a/--all-tasks]

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-05-05 14:02:34 +02:00
Karel Zak 6c7d5ae9a2 move struct option to .rodata
It does not make sense to have writable large arrays of "struct
option" on the stack.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-03 15:00:30 +01:00
Fabian Groffen eb76ca98b0 build-sys: provide alternatives for err, errx, warn and warnx
Solaris lacks err, errx, warn and warnx.  This also means the err.h header
doesn't exist.  Removed err.h include from all files, and included err.h from
c.h instead if it exists, otherwise alternatives are provided.

Signed-off-by: Fabian Groffen <grobian@gentoo.org>
2011-02-14 17:45:24 +01:00
Davidlohr Bueso f2f0dcaf11 schedutils: remove unneeded header files
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2011-02-08 16:23:28 +01:00
Davidlohr Bueso cdc1ae5fb2 schedutils: fix typos
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2011-01-17 15:26:35 +01:00
Karel Zak 601d12fb10 rename util-linux-ng back to util-linux
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-30 11:41:59 +01:00
Davidlohr Bueso 8abcf29002 lib: [strutils] general purpose string handling functions
This patch replaces a few functions used throughout the source:
* Renames getnum (from schedutils) to strtol_or_err
* Moves strtosize (from lib/strtosize.c)
* Moves xstrncpy (from include/xstrncpy.h)
* Adds strnlen, strnchr and strndup if not available (remove it from libmount utils)

A few Makefile.am files were modified to compile accordingly along with trivial renaming
in schedutils source code.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2010-11-23 21:06:49 +01:00
Marek Polacek 98da1298ca chrt: Add noreturn attribute to show_usage() function
Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
2010-10-29 13:26:25 +02:00
Karel Zak 2429509658 taskset: proper numbers parsing
Reported-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-09-30 23:29:14 +02:00
Benno Schulenberg 5f71997106 chrt: add --verbose to man page, correct -V for --version, alphabetize
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2010-06-15 12:34:09 +02:00
Benno Schulenberg aaf6349f7f chrt: slice help text into manageable chunks for translators
[kzak@redhat.com: - clean up usage() function]

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-06-15 12:31:21 +02:00
Benno Schulenberg a9a3e5f2f9 chrt: change two messages into four translatable sentences
In several languages the translations for "current" and "new" will
have to be slightly different depending on whether they apply to
"policy" or "priority".  (As a general rule, translatable messages
should be full sentences, and not partial ones with optional words
filled in via %s.)

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-06-15 12:23:47 +02:00
Samuel Thibault 4951f9b38f build-sys: minor changes for GNU/Hurd
Here is a patch to fix the build on GNU/Hurd.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2010-06-14 11:10:02 +02:00
Karel Zak bae91ecf07 taskset: move NR_CPUS determination to lib/cpuset.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-06-01 11:11:26 +02:00
Karel Zak de87877662 taskset: add NLS support, use err.h, cleanup
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-06-01 11:10:01 +02:00
Karel Zak ff5a6d2067 taskset: use libc based cpu_set_t
The glibc already supports dynamically allocated CPU sets. We don't
have to maintains our private non-compatible implementation.

Signed-off-by: Karel Zak <kzak@redhat.com>
2010-06-01 11:06:50 +02:00
Karel Zak efcb71f8ff taskset: move bitmap routines to lib/cpuset.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-06-01 11:04:44 +02:00
Ævar Arnfjörð Bjarmason 048b81c9ff ionice: non-cryptic error message when ionice can't execvp
Previously ionice would reply like this when it couldn't find the
command to execute:

    $ ionice -c 3 does-not-exist
    ionice: execvp failed: No such file or directory

Getting that message from cron because you haven't set the right $PATH
makes it hard to track down the problem. Now it says:

    $ ionice -c 3 does-not-exist
    ionice: executing does-not-exist failed: No such file or directory

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
2010-05-06 09:18:20 +02:00
Pierre Hauweele 4880a6f1ed ionice: fix typo
Signed-off-by: Pierre Hauweele <antegallya@gmail.com>
2010-03-14 22:58:56 +01:00
Karel Zak cdfb1e8822 chrt: add --reset-on-fork
This new option allows to set SCHED_RESET_ON_FORK flag for FIFO and RR
policies.

Example:

	$ chrt --fifo --reset-on-fork 1 /bin/bash

	$ schedutils/chrt --pid $$
	pid 31579's current scheduling policy: SCHED_FIFO|SCHED_RESET_ON_FORK
	pid 31579's current scheduling priority: 1

Signed-off-by: Karel Zak <kzak@redhat.com>
2010-02-02 21:28:45 +01:00
Adrian Knoth 0fefbedc72 chrt: add support for SCHED_RESET_ON_FORK
From 9262c9832134f8a33ac2ea2854dc6d20acc712d1 Mon Sep 17 00:00:00 2001
From: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Date: Tue, 2 Feb 2010 16:57:23 +0100
Subject: [PATCH] Add support for SCHED_RESET_ON_FORK to chrt

SCHED_RESET_ON_FORK has been added in 2.6.31. If a thread has this flag
set, chrt reports "unknown" policy, which is confusing.

The patch adds support for this new flag. It will (can) only be applied
to SCHED_FIFO or SCHED_RR, so there's no need to catch the other
scheduling policies.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
2010-02-02 18:16:05 +01:00
Karel Zak 04c944419d po: fix msgid bugs
Reported-by: Petr Pisar <petr.pisar@atlas.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-12-10 13:04:41 +01:00
Karel Zak 75c1d2aee6 ionice: add a note about none class and CFQ
Reported-by: Corrado Zoccolo <czoccolo@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-11-18 17:13:35 +01:00
Karel Zak b6534e4fd8 chrt: use c.h
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-10-16 01:01:48 +02:00
Peter Breitenlohner 7c7c2e5d19 ionice.1: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:13 +02:00
Karel Zak 30688dde55 build-sys: rename to _execdir
The variable name "usrlibexecdir" is very confusing (because we have
/usr/libexec). The "exec" prefix is required for user-defined
directories, see

   http://www.gnu.org/software/hello/manual/automake/The-Two-Parts-of-Install.html#The-Two-Parts-of-Install

This patch renames all usr*execdir variables to usr*_execdir.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-07-04 01:23:41 +02:00
Jakob Unterwurzacher 5dc9371ce6 ionice: Allow setting the none class
Allow users to set the "none" class on processes. Using the
none class has the distict advantage that the io priority
is inherited from the cpu nice level. Update the man page
to reflect the change.

Signed-off-by: Jakob Unterwurzacher <jakobunt@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-27 23:43:18 +02:00
Aurelien Jarno b64279dab8 chrt: don't assume SCHED_BATCH and SCHED_IDLE exist
SCHED_FIFO, SCHED_OTHER, SCHED_RR are part of POSIX 1003.1b Process
Scheduling, so it is correct to assume they always exists.

SCHED_BATCH and SCHED_IDLE are Linux specific, we should not assume
they exists.

Defining SCHED_BATCH and SCHED_IDLE to random values (ie the ones found
on Linux systems) is not an option as they may *collide* with the one of
other systems. For example on GNU/kFreeBSD we have:

   #define SCHED_RR        3

and on Linux we have:

   #define SCHED_BATCH     3

[kzak@redhat.com: - add "Linux specific" notes to chrt.1
                  - add a note about BATCH and PR conflict to
                    this commit message]

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-07 11:28:08 +02:00
Karel Zak 357e7c3b2d ionice: change Jens Axboe's email
Based on
   util-linux-2.14.2-schedutils_fix_email.patch
from SUSE src.rpm package.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-04-23 13:22:27 +02:00
Aurelien Jarno 40bc2ab516 chrt: add a comment about non POSIX 1003.1b attributes in chrt.1
Mention that only SCHED_FIFO, SCHED_OTHER and SCHED_RR are part of
POSIX 1003.1b Process Scheduling in chrt.1.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-04-23 13:14:33 +02:00
Karel Zak 6c00cbbe97 chrt: output buglet when reporting scheduling class
% chrt -i 0 ./a.out &
[1] 60479
% chrt -p 60479
pid 60479's current scheduling policy: SCHED_IDLE
SCHED_RR
pid 60479's current scheduling priority: 0

We have a spurious and incorrect SCHED_RR in there...

Address-Red-Hat-Bugzilla: #483706
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-02-03 10:22:07 +01:00
Karel Zak 97fd43f5d3 ionice: fix typo in manpage
Reported-by: Jakob Unterwurzacher <jakobunt@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-02-02 11:21:04 +01:00
Karel Zak 9bc0e24612 ionice: a little cleanup of "none" description
We practically have three io scheduling classes. The "none" is
de facto "best-effort" class for processes that has not asked
for io priority.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-01-22 15:27:47 +01:00
Jakob Unterwurzacher 9b93a22389 ionice: Extend the man page to explain the "none" class and cpu-nice inheritance
Extend the ionice man page to explain the "none" class and how the
cpu-nice => io-priority inheritance works.

Signed-off-by: Jakob Unterwurzacher <jakobunt@gmail.com>
2009-01-16 13:47:56 +01:00
Karel Zak bd9d9f05e6 chrt: add NLS support, clean error messages and return codes
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-23 23:33:10 +02:00
Martin Steigerwald c779d6e94f chrt: support CFS SCHED_IDLE priority and document it
Signed-off-by: Martin Steigerwald <ms@teamix.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-23 23:28:00 +02:00
Karel Zak 030d18fd2a ionice: add strtol() checks, cleanup usage text and man page
* cleanup usage() output

 * check strtol(); don't ignore wrong command line options

The original ionice design was a little broken, because it was
possible to specify a PID and also a COMMAND:

	ionice -c2 -p 123 /bin/foo

but the command /bin/foo was executed without requested scheduling
class. That's stupid behaviour.

Now you have to use "-p PID" **or** COMMAND, but not both. Nothing is
ignored and all options are checked.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-06 14:54:01 +02:00
Stephan Maka ef0fe2e8aa ionice: let -p handle multiple PIDs
Makes ionice -p usable like renice, this time backwards compatible

[kzak@redhat.com: - fix coding style
                  - add ioprio_setpid()]

Signed-off-by: Stephan Maka <stephan@spaceboyz.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-05 16:18:14 +02:00
Karel Zak 5bd11d0d11 ionice: cleanup error messages, add NLS support
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-14 11:40:08 +02:00
Karel Zak 8eec9db243 ionice: cleanup man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-14 11:19:07 +02:00
Lubomir Kundrak 4d125dfc41 ionice: add -t option
This patch allows "tolerant" behavior, i.e. proceeding even if
priority could not be set. This might be of use in case something
(selinux, old kernel, etc.) does not allow the requested scheduling
priority to be set.

This could be to some extend done as follows:

	ionice -c3 command || command

but the downside is that one could not really tell if what failed was
setting priority or command itself, which could result in duplicate
command run.

This patch solves the situation, so that user can do

	ionice -t -c3 command

Addresses-Red-Hat-Bugzilla: #443842
Signed-off-by: Lubomir Kundrak <lkundrak@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-06-16 13:08:51 +02:00
Karel Zak 776452cbfc ionice: update man page to reflect IDLE class change in 2.6.25
The idle class is safe for non-root users since 2.6.25.
http://lwn.net/Articles/266256/

Addresses-Red-Hat-Bugzilla: #443823
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-28 12:23:40 +02:00
James Youngman c4e1583799 build-sys: ignore a bunch of generated files, mostly binaries
Signed-off-by: James Youngman <jay@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-14 14:08:00 +02:00
Stepan Kasal a3ca3a44c5 build-sys: use dist_man_MANS instead of man_MANS
Signed-off-by: Stepan Kasal <skasal@redhat.com>
2007-12-17 10:08:49 +01:00
Karel Zak cd66291bde ionice: add a note about permissions to ionice.1
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-09-20 14:33:31 +02:00
Karel Zak bf928360f2 build-sys: remove hardcoded _GNU_SOURCE
We have AC_GNU_SOURCE, so we needn't any extra hardcoded _GNU_SOURCE.

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-09-20 00:57:01 +02:00
Mike Frysinger 72065909cc build-sys: unify method for checking system calls and fallback handling
Co-Author: Stepan Kasal <skasal@redhat.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Stepan Kasal <skasal@redhat.com>
2007-09-20 00:22:22 +02:00
Matthias Koenig 2b25841371 ionice: clean up error handling
Print error in case execvp fails and use exit macros.

Based on patch by Bernhard Voelker <mail@bernhard-voelker.de>

Signed-off-by: Matthias Koenig <mkoenig@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-08-27 23:58:05 +02:00
Mike Frysinger 19a224ad6a taskset: check for existence of sched_getaffinity
Some architectures do no reliably provide sched_getaffinity, so make sure the
define exists before we try using it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2007-08-27 10:48:29 +02:00
LaMont Jones 5ebbcdf9c8 man-pages: cleanup of chrt.1 and taskset.1
Signed-off-by: LaMont Jones <lamont@mmjgroup.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-08-15 12:03:51 +02:00
Matthias Koenig 8dbfe5a1fe ionice: cleanup usage for idle class
The idle class has no class data. It will print a warning if
a prio argument is given for it, since this will be ignored.
Output for idle class will not contain prio data.

Signed-off-by: Matthias Koenig <mkoenig@suse.de>
2007-07-25 16:44:17 +02:00
Matthias Koenig 697d58e867 schedutils: fix chrt docs and pid=0 usage
Fix some documentation bugs for chrt.
Make it work with PID 0, which means current process.

Signed-off-by: Matthias Koenig <mkoenig@suse.de>
2007-07-16 15:12:36 +02:00
Karel Zak 4dfadf9c3a ionice: prefer SYS_ioprio_{set,get} from glibc to hardcoded version
It's better to use glibc SYS_ioprio_{set,get} definitions rather than an
incomplete (not all archs) and hardcoded version from ionice.c.

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-07-16 12:22:54 +02:00
Karel Zak 86d62711a9 man pages: add "AVAILABILITY" section
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-07-03 01:17:04 +02:00
David Miller eba338783e ionice: fix ionice build on sparc
Provide the proper syscall numbers for this architecture.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-07-02 13:52:41 +02:00
Cliff Wickman f7e3dc0533 taskset: independent of hardcoded NR_CPUS max.
This patch makes the taskset command independent of the system's maximum
number of cpus (CONFIG_NR_CPUS).  The maximum for CONFIG_NR_CPUS is a
moving target.

With this patch the size of the systems's cpumask_t is gotten from
sched_getaffinity(2).

This patch uses variable length bitmasks borrowed from Paul Jackson's
variable size bitmask routines (hence I kept his copyright notice).
This replaces the use of the glibc CPU_SETSIZE, CPU_SET, CPU_ZERO and
CPU_ISSET macros which depend on a hardcoded size for cpu_set_t.

(also fixes one little nit: the -V option is "-v" in the built-in help, so
 changed the built-in help)

Signed-off-by: Cliff Wickman <cpw@sgi.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-06-19 15:00:10 +02:00
Karel Zak 09dd84cac7 schedutils: define SCHED_BATCH when compile with old glibc
This is temporary workaround and it will be removed in 2.14 when
minimal number of people will use old systems where is not defined
SCHED_BATCH in (bits/)sched.h.

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-04-11 23:18:08 +02:00
Karel Zak df3773fba0 schedutils: add support for SCHED_BATCH
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-01-16 15:24:13 +01:00
Karel Zak 5ee003094e schedutils: remove extra hyptens from man pages
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-01-16 14:30:24 +01:00
Karel Zak 8eeb575c0d build-sys: remove generated autotools stuff from git
The generated autotools stuff shouldn't be maintained by SCM. After check out
from git use ./autogen.sh. For more details see README.devel.

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-01-03 22:20:44 +01:00
Karel Zak cf6d7faebb Imported from util-linux-2.13-pre6 tarball. 2006-12-07 00:27:13 +01:00
Karel Zak ca3ea756e7 Imported from util-linux-2.13-pre4 tarball. 2006-12-07 00:27:06 +01:00
Karel Zak 9cb689775c Imported from util-linux-2.13-pre3 tarball. 2006-12-07 00:27:03 +01:00
Karel Zak baf39af15b Imported from util-linux-2.13-pre2 tarball. 2006-12-07 00:26:58 +01:00
Karel Zak 48d7b13a1e Imported from util-linux-2.13-pre1 tarball. 2006-12-07 00:26:54 +01:00