Commit Graph

556 Commits

Author SHA1 Message Date
John Kacur f0b2df877c cyclictest: Change the output from function sighand() to stderr
cyclictest can be run from other tools such as rteval
in order to get current status on long runs, SIGUSR1 is sent to
cyclictest and caught by function sighand()

This creates difficulties for rteval when parsing cyclictest output, so
change the output to stderr.

Note, a RFC was sent out on Apr.15 2014 entitled
"RFC: SIGUSR1 to stderr"
to:	 RT <linux-rt-users@vger.kernel.org>
cc:	 Carsten Emde <C.Emde@osadl.org>,
	 Thomas Gleixner <tglx@linutronix.de>,
	  Clark Williams <williams@redhat.com>

Since I didn't receive any replies, I'm assumin there are no objections

Signed-off-by: John Kacur <jkacur@redhat.com>
2014-08-14 16:22:11 +02:00
John Kacur 4b430a7678 cyclictest: Always print an err message if write of 0 to cpu-dma_latency fails
In set_latency_target() there are some paths that don't print an error
message even when a write of 0 to /dev/cpu_dma_latency fails.

This patch does the following
- always print an error message if the write to /dev/cpu_dma_latency
fails
- Fix the error check with the write call. (a return of 0 or -1 indicate
 problems
- rename ret to err since this function is void and returns no value
- use err_msg_n instead of printf (which also prints to stderr)

Signed-off-by: John Kacur <jkacur@redhat.com>
2014-08-14 16:03:07 +02:00
Joakim Hernberg 629b13d338 make SMP option only use online cpus. 2014-07-23 16:16:16 -05:00
John Kacur 245b19c5f6 rt_numa.h: Suppress discards 'const' qualifier warning
In rt-tests we try to use const where appropriate for read-only, but
we need to tell the compiler we are intentionally discarding const
when calling library functions that expect char *

Signed-off-by: John Kacur <jkacur@redhat.com>
2014-05-09 14:12:26 +02:00
John Kacur 6b6ebd9f0d lib: Rework err_msg_n to output strerror after message
Outputting the message first followed by the strerror makes
the error messages more readable.

Signed-off-by: John Kacur <jkacur@redhat.com>
2014-05-09 01:21:06 +02:00
Clark Williams c5f2a44360 Merge branch 'work' 2014-03-30 11:17:52 -05:00
Clark Williams 9164ec4db2 version bump to 0.89
Signed-off-by: Clark Williams <clark.williams@gmail.com>
2014-03-30 11:16:44 -05:00
Clark Williams 041e643710 cyclictest: fix leftover debbuging comment in argument processing
Left a single line comment in the switch statement for handling
affinity options. Removed it.

Signed-off-by: Clark Williams <clark.williams@gmail.com>
2014-03-30 11:05:49 -05:00
Clark Williams 266a7b90a5 hwlatdetect: convert to run with both python2 and python3
Ran 2to3 on hwlatdetect.py and checked in the result. Tested
on F20 system running 3.12.14-rt23 with both python2 and python3.

Signed-off-by: Clark Williams <clark.williams@gmail.com>
2014-03-29 10:39:26 -05:00
Clark Williams 9a345c1375 removed debugging comments and printfs
Signed-off-by: Clark Williams <clark.williams@gmail.com>
2014-03-28 13:07:55 -05:00
Clark Williams bd4493d6ef Merge branch 'work' 2014-03-28 09:27:18 -05:00
Clark Williams a7fbe4c58b version bump to 0.88
Signed-off-by: Clark Williams <clark.williams@gmail.com>
2014-03-28 09:26:31 -05:00
Gary S. Robertson 9bdd51a808 cyclictest: Don't offer --numa option when unavailable
Signed-off-by: Gary S. Robertson <gary.robertson@linaro.org>
Signed-off-by: Clark Williams <williams@redhat.com>
2014-03-28 09:23:59 -05:00
Gary S. Robertson 618427fab9 cyclictest: Restore CPU affinity function for non-NUMA builds
Signed-off-by: Gary S. Robertson <gary.robertson@linaro.org>
Signed-off-by: Clark Williams <williams@redhat.com>
2014-03-28 09:22:53 -05:00
Gary S. Robertson 751b683a9d Don't offer --numa option when unavailable
Signed-off-by: Gary S. Robertson <gary.robertson@linaro.org>
Signed-off-by: Clark Williams <williams@redhat.com>
2014-03-26 22:37:50 -05:00
Gary S. Robertson 04db73f6c7 Restore CPU affinity function for non-NUMA builds
Signed-off-by: Gary S. Robertson <gary.robertson@linaro.org>
Signed-off-by: Clark Williams <williams@redhat.com>
2014-03-26 22:37:27 -05:00
Uwe Kleine-König 87f1158245 cyclictest: Fix tracemark output when the latency threshold is hit on ARM
on ARM I'm seeing output like:

	cyclicte-623     0....... 19619418us+: tracing_mark_write: hit latency threshold (2000 > 2097)

That's because of a format mismatch in

	tracemark("hit latency threshold (%d > %d)", diff, tracelimit);

diff is a u64 and tracelimit an int. So on ARM the string is passed in r0,
tracelimit in r1 and diff in r2+r3. vsnprintf used in tracemark only
expects two ints passed and so only uses r1 and r2 yielding the permutation
in the output.

This patch also adds a gcc attribute to tracemark that helps catching
similar bugs. In this case just adding the attribute but not touching
the call site, would result in:

	src/cyclictest/cyclictest.c: In function ‘timerthread’:
	src/cyclictest/cyclictest.c:899:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘uint64_t’ [-Wformat]

---
Hello

after some chatting with Clark and John I dropped the c99 stuff and added the
attribute annotation.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Clark Williams <clark.williams@gmail.com>
2014-01-31 14:11:46 -06:00
Ciprian Barbu 3917fdbe56 rt-tests: hackbench: fix for uninitialized start time
Hello,

While playing around with hackbench I discovered that I would sometimes
get an enormous time reported, even if the run time would be less than a
second or so. The problem was that the struct timeval start was not
initialized until after all children have been created. But if the
program receives a signal before this is done, the start time is left
uninitialized.

I propose that in such situations an error message be displayed, like
the following patch does.

Please let me know if this is acceptable.

Regards,
/Ciprian

Signed-off-by: Clark Williams <williams@redhat.com>
2013-12-12 09:13:12 -06:00
Clark Williams b0413ae5ed version bump to 0.87
Signed-off-by: Clark Williams <clark.williams@gmail.com>
2013-12-11 16:43:14 -06:00
Clark Williams 7c21340615 fixed #ifdef that cuts -A option in display_help()
Signed-off-by: Clark Williams <clark.williams@gmail.com>
2013-12-11 15:30:29 -06:00
Aaron Fabbri 2f060c9ac6 CPU affinity now takes arbitrary set of cpus.
e.g.
  cyclictest -a4,6-8 -t5

will use 5 threads, assigned round-robin to the set of CPUs {4,6,7,8}.
CPU 4 will get threads 1 and 5, CPU 6 gets thread 2, CPU 7 gets thread 3, and
CPU 8 gets thread 4.

As explained in the updated manpage, libnuma >= v2 is required for these
arbitrary CPU sets.  With libnuma v1, the -a option behaves as before.  As
before, compiling without libnuma is supported. The command usage help is fixed
up at compile time to always show the correct usage of the -a option.

Also note that, since numa_parse_cpustring_all() wasn't available in early
libnuma v2 versions, we use numa_parse_cpustring().  This means you'll have to
use taskset in some cases (isolcpus kernel parameter) to add the desired CPUs to
the set of allowed cores, e.g.:

  taskset -c4-6 cyclictest -a4-6

Tested with out libnuma (numactl), and with versions 1.0.2 and 2.0.9-rc3.

Signed-off-by: Aaron Fabbri <ajfabbri@gmail.com>
(cherry picked from commit 5375ab86e77881d8043e5e309bb8daf5a84cc05f)
Signed-off-by: Clark Williams <clark.williams@gmail.com>
2013-12-11 15:26:57 -06:00
Clark Williams 7ff65cfa9d updated Makefile and do-git-push script to use kup
Signed-off-by: Clark Williams <clark.williams@gmail.com>
2013-11-15 15:39:21 -06:00
Clark Williams 4ab63398b9 version bump to 0.86
Signed-off-by: Clark Williams <clark.williams@gmail.com>
2013-11-15 09:50:49 -06:00
John Kacur 1b46049fb5 cyclictest: Align option fixes
These changes make the align option truly optional as claimed.

1. Rename disaligned to offset for readability.
2. Fix the aligned option so that if no optional argument is given,
the offset defaults to 0
3. Fix some white space problems as reported by checkpatch.pl in the kernel
Signed-off-by: John Kacur <jkacur@redhat.com>
2013-11-14 17:40:03 +01:00
Nicholas Mc Guire 77d109dbea cyclictest: add align thread wakeup times option
This patch provides and additional -A/--align flag to cyclictest to align
thread wakeup times of all threads as closly defined as possible.

When running multiple threads in cyclictest (-S or -t # option) the threads
are launched in an unsynchronized manner. Basically the creation order and
time for thread creation determines the start time. For provoking a maximum
congestion situation (e.g. cache evictions) and to improve reproducibility
or run conditions the start time should be defined distances appart. The
well defined distance is implemented as a offset parameter to -A/--align
and will offset each threads start time by the parameter * the sequentially
assigned thread number (par->tnum), together with the -d0 (distance in the
intervals of the individual threads) this alignment option allows to get
the thread wakeup times as closely synchronized as possible.

The method to sync is simply that the thread with par->tnum == 0 is chosen
to set a globally shared timestamp, and all other threads use this timestamp
as their starting time rather than each calling clock_gettime() at startup.
To ensure synchronization of the thread startup the setting of the global
time is guarded by pthread_barriers.

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
Reviewed-by: Andreas Platschek <andreas.platschek@opentech.at>
Signed-off-by: Clark Williams <clark.williams@gmail.com>
2013-11-14 17:30:32 +01:00
Nicholas Mc Guire fd37e16b20 minor cleanup in cyclictest
HI !

 just noticed a, presumably, unnecessary tsnorm in cyclictest

Signed-off-by: Clark Williams <clark.williams@gmail.com>
2013-11-14 17:29:37 +01:00
Clark Williams a3a7ee1a68 cyclictest: modify option handling to use enumerated types
Change return value from option parsing to be enumerated type
rather than a character. Hopefully this will clean up the option
handling a bit and not confuse me when I come back to add yet
another option to cyclictest.

Signed-off-by: Clark Williams <clark.williams@gmail.com>
2013-11-14 17:26:51 +01:00
Sebastian Andrzej Siewior dd6ae1155d hackbench: init child's struct before using it
Commit ad27df7 ("Reimplement better child tracking and improve error
handling") changed the way of reporting pid/error after creating a
child. It will return an union which is a mix pid_t, pthread_t and a
signed long long for errors.
Now on 32bit x86 both pid_t and pthread_t are four byte in size and are
stored in the first 4 bytes. Now if the most significant bit of the long
long variable happens to be set by chance (because nobody really
initializes the variable here) then error variable will be negative. On
little endian machines the assignment of pid or threadid won't reset the
sign bit and you see this:

| Running in process mode with 10 groups using 40 file descriptors each (== 400 tasks)
| Each sender will pass 100 messages of 100 bytes
| 0 children started.  Expected 40
| sending SIGTERM to all child processes
| signaling 0 worker threads to terminate
| Creating workers (error: Success)

A machine with proper endian handlig (that is big endian) would reset
the sign bit during the assignment of pid and I would not have to make
this patch :)

While here, I make create_worker() since it is not used outside of this
file.

Cc: David Sommerseth <davids@redhat.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Clark Williams <clark.williams@gmail.com>
2013-04-11 12:02:24 -05:00
Clark Williams 83adb67c79 cyclictest: allow break threshold without doing any tracing
Add the --notrace/-A option, intended to be used in conjunction
with the -b option. This will cause cyclictest to exit when a
threshold is hit, but will not perform any tracing operations,
allowing more sophisticated tracing to be done externally.

Signed-off-by: Clark Williams <clark.williams@gmail.com>
2013-03-13 19:36:29 -05:00
Clark Williams 1906cc53f5 cyclictest: add named fifo for statistics
This code adds the -F/--fifo option to cyclictest. Using the
--fifo <path> option will cause cyclictest to create a named
fifo at <path> and will dump the current run statistics to that
fifo when it is opened an read.

Signed-off-by: Clark Williams <clark.williams@gmail.com>
2013-03-13 16:53:53 -05:00
Jim Somerville 1b92da3083 cyclictest: finish removal of 1 second first loops
Huge latencies are observed (close to 1 second) when certain
options are used in cyclictest.

The problem was 1st introduced at commit da4956cbca
("use interval on first loop instead of 1 second").  It removed
the 1 second first timing loop out of the main path in cyclictest
but left it in two other paths, namely the ones triggered by
these two options:

    -r   --relative    use relative timer instead of absolute
    -s   --system      use sys_nanosleep and sys_setitimer

which in turn causes the huge latencies of close to 1 second to
be reported by cyclictest with certain uses of those two options.

Here we extend the original commit to remove the 1 second
hardcoded timer values from the RELTIME and ITIMER options, by
simply using the actual interval provided instead.

Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
Cc: Clark Williams <williams@redhat.com>
Cc: John Kacur <jkacur@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2013-02-15 15:08:35 +01:00
John Kacur b2689a768a Makefile: Don't tag files in dir BUILD from rpm builds
Don't tag copies of files in BUILD created when building an rpm
Without this change tags finds both copies, eg: for tag cyclictest.c
  # pri kind tag               file
  1 F   F    cyclictest.c      BUILD/rt-tests/src/cyclictest/cyclictest.c
               1
  2 F   F    cyclictest.c      src/cyclictest/cyclictest.c

With this change, only the later one is found

Signed-off-by: John Kacur <jkacur@redhat.com>
2013-02-15 15:02:21 +01:00
Frank Rowand 7ffb5a6e20 rt-tests: NUMA optional for make rpm
version 2:
  - Add new placeholders in rt-tests.spec-in to make the replacements by
    "make rpm" more visible to future maintainers of rt-tests.spec-in
  - fix typo of my name in rt-tests.spec-in

rt-tests can be built without NUMA:

   make NUMA=0

But "make rpm" does not have a way to be successful without NUMA:

   build_rt-tests_0.85> make rpm
   for F in cyclictest signaltest pi_stress rt-migrate-test ptsematest sigwaittest svsematest pmqtest sendme pip_stress hackbench *.o .depend *.*~ *.orig *.rej rt-tests.spec *.d *.a  ChangeLog; do find -type f -name $F | xargs rm -f; done
   rm -f hwlatdetect
   rm -f tags
   rm -rf BUILD BUILDROOT RPMS SRPMS SPECS releases *.tar.gz rt-tests.spec tmp
   git log >ChangeLog
   mkdir -p releases
   mkdir -p tmp/rt-tests
   cp -r Makefile COPYING ChangeLog src tmp/rt-tests
   tar -C tmp -czf rt-tests-0.85.tar.gz rt-tests
   rm -f ChangeLog
   cp rt-tests-0.85.tar.gz releases
   sed s/__VERSION__/0.85/ <rt-tests.spec-in >rt-tests.spec
   rpmbuild -ba --define "_topdir /a/home/frowand/me/src/rt-tests/build_rt-tests_0.85" --define "_sourcedir /a/home/frowand/me/src/rt-tests/build_rt-tests_0.85/releases" --define "_builddir /a/home/frowand/me/src/rt-tests/build_rt-tests_0.85/BUILD"  rt-tests.spec
   error: Failed build dependencies:
           numactl-devel is needed by rt-tests-0.85-1.fc12.src
   make: *** [rpm] Error 1

The following patch allows the rpm to be built without NUMA, with the command:

   make NUMA=0 rpm

Signed-off-by: Frank Rowand <frank.rowand@am.sony.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2013-02-15 14:54:43 +01:00
John Kacur cc7b99bf4e Makefile: Add BUILDROOT and SPECS to the dirs to remove for distclean
make rpm creates the dirs BUILDROOT and SPECS that are missed by distclean.
Gather all rpm related DIRS to the RPMDIRS and add that to distclean.

Signed-off-by: John Kacur <jkacur@redhat.com>
Reviewed-by: Frank Rowand <frank.rowand@am.sony.com>
Tested-by: Frank Rowand <frank.rowand@am.sony.com>
2013-02-15 14:46:35 +01:00
John Kacur d29d951dbe Makefile: Add tmp dir to distclean and "make release" call distclean
The files in the tmp dir are generated during make release.
These are the kind of generated files that should be removed for distclean,
So add tmp. make release can be slightly simplified by then depending
on distclean instead of clean.

Signed-off-by: John Kacur <jkacur@redhat.com>
Reviewed-by: Frank Rowand <frank.rowand@am.sony.com>
Tested-by: Frank Rowand <frank.rowand@am.sony.com>
2013-02-15 14:46:10 +01:00
John Kacur 0918c34eff Makefile: Don't tag tmp files created when making a release
Don't tag the copies of the source files placed in the tmp directory
during the creation of a release.
Without this change tags finds both copies, eg: for tag cyclictest.c
  # pri kind tag               file
  1 F C F    cyclictest.c      src/cyclictest/cyclictest.c
               1
  2 F   F    cyclictest.c      tmp/rt-tests/src/cyclictest/cyclictest.c
               1

With this change only the first one is found.

Signed-off-by: John Kacur <jkacur@redhat.com>
Reviewed-by: Frank Rowand <frank.rowand@am.sony.com>
Tested-by: Frank Rowand <frank.rowand@am.sony.com>
2013-02-15 14:45:44 +01:00
Frank Rowand 65c27472cc cyclictest: white space cleanup
Clean up cyclictest formatting:
  Change leading spaces to tabs.
  Align function parameters.
  Place type of function on same line as function name.

Signed-off-by: Frank Rowand <frank.rowand@am.sony.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2013-01-30 17:56:05 +01:00
Clark Williams 210e625227 version bump to 0.85
Signed-off-by: Clark Williams <williams@redhat.com>
2012-11-13 16:02:04 -06:00
John Kacur 93e525fac1 Merge branch 'clrkwllms/work' into rt-tests-0.84-devel
Signed-off-by: John Kacur <jkacur@redhat.com>
2012-11-09 16:25:18 +01:00
Frank Rowand 9854a61da9 V3: cyclictest: report large measured clock latency
V3: Use src/lib/error.c functions instead of fprintf.
    Fix printf format warnings for 32 bit vs 64 bit systems with cast.
    One issue with using warn() and info() instead of fprintf is that
    the compiler no longer warns about format mismatches.
    Fix bad continuation line white space prefix.
    Remove unused variable zero_diff.

cyclictest: ARM panda clock resolution will be ~30 usec unless
CONFIG_OMAP_32K_TIMER=n, resulting in a poor latency report.

This patch does _not_ fix the problem, it merely provides the
instrumentation to make it visible.  The value of measured
resolution is useful information for any system.

Signed-off-by: Frank Rowand <frank.rowand@am.sony.com>
- Fixed up minor white space problem.
Signed-off-by: John Kacur <jkacur@redhat.com>
2012-10-17 00:25:26 +02:00
Frank Rowand fcdef80f5f V3: cyclictest: clean up getopt_long() parameters
V3: unchanged from V2

cyclictest getopt_long() parameter clean up.
Clean up before following patch which will add a new option.

  Some elements of long_options were not in alphabetical order.

  Some elements of optstring were not in alphabetical order.

  '-e', '--latency' was missing help text

  short form of --duration ('D') was missing from optstring

  Change a few instances of leading spaces to tabs.

  Add white space to long_options to improve readability.

  Some cases of the switch processing the result of
    getopt_long() were not in alphabetical order.

  Did _not_ clean up option value parsing and processing.

Signed-off-by: Frank Rowand <frank.rowand@am.sony.com>
Signed-off-by: John Kacur <jkacur@redhat.com>

Conflicts:
	src/cyclictest/cyclictest.c
2012-10-17 00:24:59 +02:00
John Kacur 2400e5e3b5 rt-tests Makefile: Add CPPFLAGS to the pattern rule to generate dependencies
Signed-off-by: John Kacur <jkacur@redhat.com>
2012-10-17 00:22:33 +02:00
Uwe Kleine-König dfcef6e557 rt-tests Makefile: separate CFLAGS and CPPFLAGS
For compilation to work

        -D_GNU_SOURCE -Isrc/include

is needed to be passed to the compiler. For Debian packaging several
things are added but not these two from above. So be a bit more friendly
and add them unconditionally. There is no harm if they are included in
the user supplied CFLAGS and so passed twice.

Moreover be a bit more correct about CFLAGS/CPPFLAGS. Both should be
passed to the compiler with CFLAGS taking options for the compiler and
CPPFLAGS taking options for the preprocessor. This is also needed for
Debian packaging where the helper scripts set CPPFLAGS.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2012-10-17 00:22:11 +02:00
Uwe Kleine-König 954e01fe14 rt-tests: have printf use %s format for strings
Discovered while compiling with "hardening flags"

For Debian 7.0 (aka wheezy) packages it's recommended to use several
hardening flags, the default on amd64 being:

	CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security
	CPPFLAGS=-D_FORTIFY_SOURCE=2
	LDFLAGS=-Wl,-z,relro

This patch doesn't fix all warnings but at least makes all programs compile
again by not using char *variables as printf format strings.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2012-10-17 00:21:52 +02:00
John Kacur d63f567c64 rt-tests / gitignore: Exclude patches and .a libs too.
Minor fix to make working with git nicer.
Now that we're building a lib, we need to exclude it from git status output.
Do the same for patches we generate or apply.

Signed-off-by: John Kacur <jkacur@redhat.com>
2012-10-17 00:21:28 +02:00
Bhavesh Davda 992b905d42 cyclictest: histogram overflow instance tracking
Add feature to cyclictest histogram mode to track cycle counts every time a
sample overflows the histogram limit. This should help identify if there is a
timing pattern to jitters in cyclictest runs.

Example output (with -h 10):
 ...
 Histogram Overflows: 00001 00007 00000 00009 00004 00007 00000 00001
 Histogram Overflow at cycle number:
 Thread 0: 09964
 Thread 1: 00000 00004 00006 00008 00010 09962 11594
 Thread 2:
 Thread 3: 01169 04698 06782 09033 10299 11561 21517 28734 29532
 Thread 4: 11574 11580 11583 11586
 Thread 5: 00020 09448 13954 14954 18954 20587 24973
 Thread 6:
 Thread 7: 18950
 ...

Signed-off-by: Bhavesh Davda <bhavesh@vmware.com>
Reviewed-by: Frank Rowand <frank.rowand@am.sony.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2012-10-17 00:19:23 +02:00
Bhavesh Davda 18cd9775e5 cyclictest: whitespace cleanup
Cosmetic whitespace cleanup

Signed-off-by: Bhavesh Davda <bhavesh@vmware.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
2012-10-17 00:11:54 +02:00
Clark Williams 7667ff6946 add setup and call of tracemark function for breaktrace
Add back call to the tracemark function but only if we're
using the breaktrace option and only when we actually hit
the breaktrace threshold.

Signed-off-by: Clark Williams <williams@redhat.com>
2012-08-30 15:54:02 -05:00
Clark Williams 857cdd5320 version bump to 0.84
Signed-off-by: Clark Williams <williams@redhat.com>
2012-05-09 09:38:00 -05:00
John Kacur 81c42e0162 rt-tests / cyclictest: Make cyclictest fail if it cannot run with requested priority.
Currently if a non-root user requests a priority higher than the soft limit in
/etc/security/limits.conf
the call to sched_setscheduler will silently fail and the user will be running
with priority of 0. Cyclictest will not complain, and display the
requested priority resulting in seemingly poor results.

The following patch fixes this by doing two things.

1. If the requested priority is higher than the soft limit but lower than the
hard limit, it will raise the soft limit to the requested priority.

2. If the requested priority is higher than the hard limit, it will fail with a
warning.

The patch should not affect privileged users.

Reported-by: Nicholas Mc Guire <der.herr@hofr.at>
Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Clark Williams <williams@redhat.com>
2012-05-09 09:22:07 -05:00