Commit Graph

914 Commits

Author SHA1 Message Date
John Kacur 1263ebde63 cyclictest: Make the default scheduling policy SCHED_FIFO
The default scheduling policy if unspecified should be SCHED_FIFO.

Before the change for example.
 sudo ./cyclictest
 policy: other: loadavg: 0.05 0.04 0.05 1/331 22367

 T: 0 (22367) P: 0 I:1000 C:   1321 Min:     14 Act:   89 Avg:   77 Max:     942

After the change
 sudo ./cyclictest
 defaulting realtime priority to 2
 policy: fifo: loadavg: 0.03 0.04 0.05 2/331 22387

 T: 0 (22387) P: 2 I:1000 C:    713 Min:     17 Act:   41 Avg:   81 Max:     161

Signed-off-by: John Kacur <jkacur@redhat.com>
2010-03-08 02:02:13 +01:00
John Kacur ce8c590232 cyclictest: Fix spelling mistake in the man page.
- In the -mlockall section, change "an" to "and"

Signed-off-by: John Kacur <jkacur@redhat.com>
2010-03-08 01:45:35 +01:00
John Kacur e12de2f062 cyclictest: Use symbolic names for scheduling policy
- Use symbolic names for scheduling policies, that is, don't assume
	SCHED_RR is 2, use SCHED_RR instead, and so on.

- Fix the logic in handlepolicy(char *polname)
	- remove the test with the unreachable line,
	- make the default SCHED_FIFO if we don't recognize the
	requested policy.

Signed-off-by: John Kacur <jkacur@redhat.com>
2010-03-08 01:38:49 +01:00
John Kacur 6fb5b9cd90 Revert "simplify equal priority logic for cyclictest"
This reverts commit 582be2a52c.

Unfortunately this commit introduces a bug because the priority is not
retested, and this can result in reported priorities below 0.
For example,

sudo ./cyclictest -t3 -p1
policy: fifo: loadavg: 0.09 0.06 0.05 1/331 21732

T: 0 (21730) P: 1 I:1000 C:    593 Min:     34 Act:  155 Avg:  100 Max:     672
T: 1 (21731) P: 0 I:1500 C:    395 Min:     15 Act:   43 Avg:   72 Max:     853
T: 2 (21732) P:-1 I:2000 C:    297 Min:     21 Act:   57 Avg:   79 Max:     330

Notice that the last priority is reported as -1.

After reverting this commit, we get the correct expected behaviour.

sudo ./cyclictest -t3 -p1
policy: fifo: loadavg: 0.07 0.05 0.04 2/330 21754

T: 0 (21752) P: 1 I:1000 C:  11600 Min:     13 Act: 7072 Avg: 3593 Max:    7841
T: 1 (21753) P: 0 I:1500 C:   7737 Min:     12 Act: 1572 Avg:  516 Max:    2381
T: 2 (21754) P: 0 I:2000 C:   5804 Min:     12 Act:   53 Avg:   59 Max:     548

I think it can be argued that the original code is also clearer, although
that is somewhat subjective. With the original code I don't need to track
down exactly what "sameprio" means, and it is clear what is being tested.

Signed-off-by: John Kacur <jkacur@redhat.com>
2010-03-08 01:07:44 +01:00
Uwe Kleine-König 6214410e57 rename pip to pip_stress as pip is too general
The command name is already taken by a perl script working with CPAN
and a Python package installer.

While at it remove trailing whitespace from three lines in
src/pi_tests/pip_stress.c.

Closes: http://bugs.debian.org/572104
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: John Kacur <jkacur@redhat.com>
2010-03-01 20:43:25 +01:00
Uwe Kleine-König d2b6363c8b Makefile: don't use temporary files in generation of dependency files
These temporary files were a real problem when creating the Debian
package for rt-tests.  debhelper (a generic suite of scripts to ease
packaging) did something like:

	perl -c 'close(STDERR); exec("make distclean");'

which leaked the *.d.$$ files and then wailed that the package contained
untracked changes to the vanilla source.  See
http://bugs.debian.org/570443 for some more details.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: John Kacur <jkacur@redhat.com>
2010-03-01 20:43:03 +01:00
Uwe Kleine-König de3d4d2539 install backfire.c to $(srcdir)/backfire/
Acked-by: John Kacur <jkacur@redhat.com>
2010-03-01 20:42:50 +01:00
Uwe Kleine-König 84367c8e07 trivial: s/specifed/specified/
Acked-by: John Kacur <jkacur@redhat.com>
2010-03-01 20:42:26 +01:00
Clark Williams 4dec55015c fix stupid typo in %changelog date 2010-02-24 15:20:34 -06:00
Clark Williams 6fc24e1719 Merge remote branch 'uwe/for-clark' into work 2010-02-24 15:07:50 -06:00
Clark Williams 2afa6340dc added hackbench manpage installation bits
Added hackbench.8 installation to both Makefile and specfile

Signed-off-by: Clark Williams <williams@redhat.com>
2010-02-24 15:07:19 -06:00
Clark Williams 24cc3c0830 Merge remote branch 'davids/master' into work 2010-02-24 10:47:19 -06:00
David Sommerseth bd43983e36 Updated hackbench man page with some examples and some extra details re. fds 2010-02-24 17:29:46 +01:00
Uwe Kleine-König 0fbe09d46c Makefile: don't use temporary files in generation of dependency files
These temporary files were a real problem when creating the Debian
package for rt-tests.  debhelper (a generic suite of scripts to ease
packaging) did something like:

	perl -c 'close(STDERR); exec("make distclean");'

which leaked the *.d.$$ files and then wailed that the package contained
untracked changes to the vanilla source.  See
http://bugs.debian.org/570443 for some more details.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
2010-02-24 17:22:15 +01:00
Uwe Kleine-König a893258ef9 install backfire.c to $(srcdir)/backfire/
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
2010-02-24 16:51:11 +01:00
Clark Williams 19b274dbf5 Merge remote branch 'davids/master' into work 2010-02-24 09:36:13 -06:00
David Sommerseth 94d8566d6c hackbench - Taken out the runit.pl script
We don't need to ship that, and Craig Thomas wrote only that code as far
as we know, so taking him out of man page as well.
2010-02-24 16:26:13 +01:00
David Sommerseth 1bb501caeb hackbench, man page: Added another contributor and a brief history of hackbench 2010-02-24 16:04:47 +01:00
David Sommerseth fb278a79b5 man page, hackbench - Corrected wrong spelling 2010-02-24 14:42:24 +01:00
David Sommerseth 0ece6f784b Updated man page for hackbench 2010-02-24 13:50:46 +01:00
Clark Williams 61482066d5 Merge remote branch 'davids/master' into work 2010-02-23 13:48:05 -06:00
David Sommerseth eba5ee5e69 Merge remote branch 'origin/work' 2010-02-23 17:40:26 +01:00
David Sommerseth 4b563630e6 Merge remote branch 'dsommers/master'
Signed-off-by: David Sommerseth <davids@redhat.com>
2010-02-23 17:38:25 +01:00
David Sommerseth 4e37a2b689 Added signal handling in hackbench
When receiving SIGINT or SIGTERM, it will now reap all worker
threads/processes and properly stop them.
2010-02-23 17:30:43 +01:00
David Sommerseth f273b4bd85 hackbench: Implemented getopt
Improved argument/option handling by using getopt_long().  Made more of the
parameters tunable as well.  Hackbench now accepts the following arguments:
       -P | --pipe          Use pipe
       -s | --datasize      Number of bytes to pass from sender to receiver
                               (default 100 bytes)
       -l | --loops         Number of messages each sender will send
                               (default 100 rounds)
       -g | --groups        Number of groups with sender/receivers
                               (default 10 groups)
       -f | --fds           Number of file descriptors each group will use
                               (default 20*2)
       -T | --threads       Run using pthreads
       -P | --process           Run using fork()

Signed-off-by: David Sommerseth <davids@redhat.com>
2010-02-23 17:30:43 +01:00
David Sommerseth faa1f165c4 (code cleanup) Tabified lines which was not tabbed
Signed-off-by: David Sommerseth <davids@redhat.com>
2010-02-23 17:30:42 +01:00
David Sommerseth 5fd7c301eb Simplified and improved error logging, clarified some messages
Signed-off-by: David Sommerseth <davids@redhat.com>
2010-02-23 17:30:42 +01:00
David Sommerseth ba166b6415 Fixed a memory leak, receiver contexts not getting freed upon exit
Signed-off-by: David Sommerseth <davids@redhat.com>
2010-02-23 17:30:42 +01:00
David Sommerseth ad27df7b94 Reimplement better child tracking and improve error handling
This does much what earlier commits did before hackbench got updated
to the latest version in the previous commit.

Consider the following commits being "forward ported", feature wise:
4c39eff213
0a72fcaade
fbd80c495b
bd588c92b8

Signed-off-by: David Sommerseth <davids@redhat.com>
2010-02-23 17:30:42 +01:00
David Sommerseth 310dd41438 Updated hackbench to lastest version available
Downloaded from http://people.redhat.com/mingo/cfs-scheduler/tools/hackbench.c
February 19 2010.

Signed-off-by: David Sommerseth <davids@redhat.com>
2010-02-23 17:30:42 +01:00
Clark Williams 2359346741 added hackbench.8 manpage framework
Signed-off-by: Clark Williams <williams@redhat.com>
2010-02-23 10:27:08 -06:00
Clark Williams 98a082ca9f Merge remote branch 'davids/master' into work 2010-02-23 09:56:57 -06:00
David Sommerseth b0aad1d13c hackbench: Implemented getopt
Improved argument/option handling by using getopt_long().  Made more of the
parameters tunable as well.  Hackbench now accepts the following arguments:
       -P | --pipe          Use pipe
       -s | --datasize      Number of bytes to pass from sender to receiver
                               (default 100 bytes)
       -l | --loops         Number of messages each sender will send
                               (default 100 rounds)
       -g | --groups        Number of groups with sender/receivers
                               (default 10 groups)
       -f | --fds           Number of file descriptors each group will use
                               (default 20*2)
       -T | --threads       Run using pthreads
       -P | --process           Run using fork()

Signed-off-by: David Sommerseth <davids@redhat.com>
2010-02-23 11:34:14 +01:00
David Sommerseth 92c53f9db3 (code cleanup) Tabified lines which was not tabbed
Signed-off-by: David Sommerseth <davids@redhat.com>
2010-02-23 10:49:29 +01:00
David Sommerseth 51a6e57359 Simplified and improved error logging, clarified some messages
Signed-off-by: David Sommerseth <davids@redhat.com>
2010-02-23 10:47:13 +01:00
David Sommerseth d5ae77c4af Fixed a memory leak, receiver contexts not getting freed upon exit
Signed-off-by: David Sommerseth <davids@redhat.com>
2010-02-23 10:39:59 +01:00
David Sommerseth 2ff7b647b2 Reimplement better child tracking and improve error handling
This does much what earlier commits did before hackbench got updated
to the latest version in the previous commit.

Consider the following commits being "forward ported", feature wise:
4c39eff213
0a72fcaade
fbd80c495b
bd588c92b8

Signed-off-by: David Sommerseth <davids@redhat.com>
2010-02-23 10:38:01 +01:00
David Sommerseth a0e5fa847d Updated hackbench to lastest version available
Downloaded from http://people.redhat.com/mingo/cfs-scheduler/tools/hackbench.c
February 19 2010.

Signed-off-by: David Sommerseth <davids@redhat.com>
2010-02-23 10:23:47 +01:00
Uwe Kleine-König bd4cd378a2 trivial: s/specifed/specified/
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
2010-02-22 21:56:49 +01:00
Clark Williams fae4312eb2 added hackbench to specfile
Signed-off-by: Clark Williams <williams@redhat.com>
2010-02-19 09:52:50 -06:00
Clark Williams 69ef7d4835 added hackbench target
added makefile targets for hackbench scheduler benchmark

Signed-off-by: Clark Williams <williams@redhat.com>
2010-02-18 14:36:44 -06:00
David Sommerseth bd588c92b8 Fixed a few compiler and valgrind warnings
Valgrind complained about usage of non-initialised data.  The compiler
complained about the out_fds argument being unsigned int when calling
sender().

Signed-off-by: David Sommerseth <davids@redhat.com>
2010-02-18 15:51:10 +01:00
David Sommerseth fbd80c495b Re-implement WIFEXITED() check on all children
Instead of just exiting immediately the original version did, we now
count how many children who failed to exit properly and report it.

Signed-off-by: David Sommerseth <davids@redhat.com>
2010-02-18 15:45:27 +01:00
David Sommerseth 0a72fcaade Fix waitpid() implementation
In commit 4c39eff213 a new approach for tracking
each child was implemented.  But this implementation ignored the fact that each
group() call creates 2*num_fds children.

This patch refactors the previous attempt and will now track absolutely all
children.  If fork() fails when called in group(), all spawned children will
now also be killed explicitly.

Signed-off-by: David Sommerseth <davids@redhat.com>
2010-02-18 15:36:01 +01:00
David Sommerseth 4c39eff213 hackbench: Wait for each child explicitly by using waitpid()
Quite often it's experienced in rteval that hackbench leaves some children
as zombies during closure.  This is an attempt to keep an overview of the
status of each child separately.  It's solved by having an array with all
sender and reciever children's pids and calling waitpid() on each of these
children pairs.

Signed-off-by: David Sommerseth <davids@redhat.com>
2010-02-17 19:09:46 +01:00
David Sommerseth f79ca322df Imported hackbench from rteval-1.18 (rteval-loads-1.0.1)
Signed-off-by: David Sommerseth <davids@redhat.com>
2010-02-17 19:08:44 +01:00
Clark Williams 73d48f4e04 version bump to 0.66
Signed-off-by: Clark Williams <williams@redhat.com>
2010-02-15 13:10:58 -06:00
Clark Williams 527835d963 Fix incorrect usage of sched_setscheduler() in check_privs()
Fix code in check_privs() that passes NULL as parameter
to sched_setscheduler().

Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Clark Williams <williams@redhat.com>
2010-02-15 12:58:32 -06:00
Clark Williams 398445bc37 version bump to 0.65
Signed-off-by: Clark Williams <williams@redhat.com>
2010-02-08 15:37:41 -06:00
Clark Williams 1e781f5634 [hwlatdetect] workaround for borken smi_detector.ko module
Add a workaround to hwlatdetect to deal with a broken block of
code in drivers/misc/smi_detector.ko, where whenever you enable
the module (write a 1 to debugfs/smi_detector/enable) the stats
initialization routine resets the threshold from whatever it was
set to to 1us. This workaround checks the threshold after enabling
the module and resets it to what we want.

Signed-off-by: Clark Williams <williams@redhat.com>
2010-02-08 15:31:57 -06:00