From: george anzinger <george@mvista.com>
To: Robert Love <rml@tech9.net>
Cc: "Dieter Nützel" <Dieter.Nuetzel@hamburg.de>,
"Oliver Xymoron" <oxymoron@waste.org>,
"Andrea Arcangeli" <andrea@suse.de>,
"Roger Larsson" <roger.larsson@norran.net>,
linux-kernel <linux-kernel@vger.kernel.org>,
"ReiserFS List" <reiserfs-list@namesys.com>
Subject: Re: [PATCH] Preemption Latency Measurement Tool
Date: Fri, 21 Sep 2001 08:48:30 -0700 [thread overview]
Message-ID: <3BAB614E.8600D074@mvista.com> (raw)
In-Reply-To: <Pine.LNX.4.30.0109201659210.5622-100000@waste.org> <200109202252.f8KMqLG17327@zero.tech9.net> <1001042255.7291.39.camel@phantasy>
[-- Attachment #1: Type: text/plain, Size: 2786 bytes --]
Robert Love wrote:
>
> On Thu, 2001-09-20 at 18:51, Dieter Nützel wrote:
> > > Does your audio source depend on any files (eg mp3s) and if so, could they
> > > be moved to a ramfs? Do the skips go away then?
> >
> > Good point.
> >
> > I've copied one video (MP2) and one Ogg-Vorbis file into /dev/shm.
> > Little bit better but hiccup still there :-(
>
> As I've been saying, the problem really shouldn't be disk I/O. I would
> think (and really hope) the readahead code can fit a little mp3 in
> memory. Even if not, its a quick read to load it. The continued blips
> you see are caused by something, well, continual :)
>
Are you running your application at some real time priority? I suspect
that, when dbench starts, it floods the system with a lot of new tasks
and the system must visit each one until it gets back to your ap. Nice
will only do so much here. Real time priority is the way to go.
Attached are a couple of small programs to help here. "rt" runs a given
ap at a given priority. I.e. > rt 10 foo, runs foo at priority 10.
(There are more options, try rt -h.) getrt reports the priority of a
task. If you do something like > rt 10 bash everything you run from
the new bash prompt will be at priority 10. You must be root to run rt
:(
George
> > dbench 16
> > Throughput 25.7613 MB/sec (NB=32.2016 MB/sec 257.613 MBit/sec)
> > 7.500u 29.870s 1:22.99 45.0% 0+0k 0+0io 511pf+0w
> >
> > Worst 20 latency times of 3298 measured in this period.
> > usec cause mask start line/file address end line/file
> > 11549 spin_lock 1 678/inode.c c01566d7 704/inode.c
>
> A single 11ms latency is not bad. Again, this looks OK.
>
> > *******************************************************
> >
> > dbench 16 + renice artsd -20 works
> > GREAT!
> >
> > *******************************************************
>
> Great :)
>
> > dbench 32 and above + renice artsd -20 fail
> >
> > Writing this during dbench 32 ...:-)))
> >
> > dbench 32 + renice artsd -20
> > Throughput 18.5102 MB/sec (NB=23.1378 MB/sec 185.102 MBit/sec)
> > 15.240u 63.070s 3:49.21 34.1% 0+0k 0+0io 911pf+0w
> >
> > Worst 20 latency times of 3679 measured in this period.
> > usec cause mask start line/file address end line/file
> > 17625 spin_lock 1 678/inode.c c01566d7 704/inode.c
>
> What do you mean failed?
>
> --
> Robert M. Love
> rml at ufl.edu
> rml at tech9.net
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
[-- Attachment #2: rt.c --]
[-- Type: text/plain, Size: 3205 bytes --]
/*
rt - a utility to set the realtime priority and scheduling policy
*/
/* includes */
#include <stdio.h>
#include <stdlib.h>
#include <sched.h>
#include <unistd.h>
#define _GNU_LIBRARY__
#include <getopt.h>
/* defines */
#define RUNSTRING "usage: rt [-f] [-v] prio [--] runstring \n \
or: rt [-f] [-v] -p PID prio\\ \n\n \
where: prio specifies the realtime priority \n \
-f set scheduling policy to SCHED_FIFO \n \
-v turns on verbose mode. \n \
-p PID specifies an existing process to modify \n \
runstring is a process and parameters \n \
(use '--' if runstring contains options). \n"
#define POLICY(x) x ? x-1 ? "SCHED_RR" : "SCHED_FIFO" : "SCHED_OTHER"
/* prototypes */
void print_usage(char *[]);
/* globals */
int verbose=0; /* 0=none, !0=verbose */
main(int argc, char *argv[])
{
struct sched_param prio_struct;
int policy = -1;
int pid = 0;
int pidopt = 0;
int optprobs = 0; /* problems parsing? */
int c; /* generic single character */
/* "standard" option parsing... */
while ( (c=getopt(argc, argv, "+fp:v?")) != EOF)
{
switch (c) {
case 'f': /* set FIFO mode */
policy = SCHED_FIFO;
break;
case 'p': /* read PID */
sscanf(optarg,"%d",&pid);
pidopt=1;
break;
case 'v':
verbose=1; /* verbosity */
break;
case '?': /* help? */
printf("%s",RUNSTRING);
exit(0);
default: /* something went wrong */
optprobs=1; /* we'll deal with this problem later */
break;
}
}
if (optprobs) {
fprintf(stderr,RUNSTRING);
exit(1);
}
if((argc - optind) < 2-pidopt) {
print_usage(argv);
}
sscanf(argv[optind], "%d", &(prio_struct.sched_priority));
/* sanity checking... */
if ( (prio_struct.sched_priority != 0) && (policy < 0 ) ) {
policy=SCHED_RR;
if (verbose)
printf("Defaulting sched policy to %s.\n", POLICY(policy));
}
if ( (prio_struct.sched_priority == 0 ) && (policy != SCHED_OTHER) ) {
policy=SCHED_OTHER;
fprintf(stderr,"Priority of %d implies sched policy of %s.\n",
prio_struct.sched_priority, POLICY(policy));
}
policy = (prio_struct.sched_priority)? policy : SCHED_OTHER;
if( sched_setscheduler(pid,policy,&prio_struct)){
perror("Priority out of range");
print_usage(argv);
}
if ( pid ) exit(0);
argv+=optind; /* adjust argv to point to the runstring */
argv++;
execvp(argv[0],argv);
perror("exec failed..");
}
void print_usage(char * who[])
{
printf("%s",RUNSTRING);
exit (1);
}
[-- Attachment #3: getrt.c --]
[-- Type: text/plain, Size: 1336 bytes --]
#include <sched.h>
#include <stdlib.h>
main(int args,char* argc[])
{
struct sched_param p;
pid_t pid;
int policy;
int prio,max_prio,max_rt_prio;
char * cpolicy;
if (args < 2) {
pid = 0;
}else{
pid = atoi(argc[1]);
}
policy = sched_getscheduler(pid);
sched_getparam(pid,&p);
prio = p.sched_priority;
max_prio = sched_get_priority_max(policy);
max_rt_prio = sched_get_priority_max(SCHED_FIFO);
switch(policy){
case SCHED_OTHER:
cpolicy = "SCHED_OTHER";
break;
case SCHED_RR:
cpolicy = "SCHED_RR";
break;
case SCHED_FIFO:
cpolicy = "SCHED_FIFO";
break;
default:
perror("sched_getscheduler");
exit(1);
}
if (policy == SCHED_OTHER){
printf("%s at priority %d (MAX_PRIO(%s) = %d, MAX_PRIO(SCHED_FIFO) = %d)\n",
cpolicy, prio, cpolicy,max_prio, max_rt_prio);
}else{
printf("%s at priority %d (MAX_PRIO(%s) = %d)\n",
cpolicy, prio, cpolicy, max_prio);
}
exit(0);
}
next prev parent reply other threads:[~2001-09-21 15:49 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-19 22:44 [PATCH] Preemption Latency Measurement Tool Robert Love
2001-09-20 1:40 ` Ignacio Vazquez-Abrams
2001-09-20 2:23 ` safemode
2001-09-20 1:13 ` David Lang
2001-09-20 2:57 ` Robert Love
2001-09-20 2:38 ` Robert Love
2001-09-20 6:31 ` Dieter Nützel
2001-09-20 20:27 ` Robert Love
[not found] ` <200109202111.f8KLBgG16833@zero.tech9.net>
2001-09-20 22:09 ` [PATCH] Preemption patch 2.4.9-ac12 Robert Love
2001-09-20 6:31 ` [PATCH] Preemption Latency Measurement Tool Dieter Nützel
[not found] ` <20010920063143.424BD1E41A@Cantor.suse.de>
2001-09-20 6:41 ` Andrea Arcangeli
2001-09-20 7:57 ` Dieter Nützel
[not found] ` <20010920075751.6CA791E6B2@Cantor.suse.de>
2001-09-20 8:21 ` Andrea Arcangeli
2001-09-20 20:13 ` george anzinger
2001-09-20 20:38 ` Randy.Dunlap
2001-09-20 21:10 ` Robert Love
2001-09-20 21:35 ` Dieter Nützel
2001-09-20 22:03 ` Oliver Xymoron
2001-09-20 22:51 ` Dieter Nützel
[not found] ` <200109202252.f8KMqLG17327@zero.tech9.net>
2001-09-21 3:17 ` Robert Love
2001-09-21 15:48 ` george anzinger [this message]
2001-09-22 21:09 ` Dieter Nützel
2001-09-22 23:40 ` safemode
2001-09-22 23:46 ` Dieter Nützel
2001-09-23 0:15 ` safemode
[not found] ` <200109222340.BAA37547@blipp.internet5.net>
2001-09-23 0:38 ` Roger Larsson
2001-09-23 1:42 ` safemode
2001-09-23 3:02 ` Robert Love
2001-09-23 16:43 ` Roger Larsson
2001-09-23 0:42 ` Dieter Nützel
[not found] ` <200109222341.f8MNfnG25152@zero.tech9.net>
2001-09-23 2:50 ` Robert Love
2001-09-23 3:14 ` george anzinger
2001-09-23 4:06 ` Dieter Nützel
[not found] ` <200109222347.f8MNlMG25157@zero.tech9.net>
2001-09-23 2:54 ` Robert Love
2001-09-27 0:02 ` [reiserfs-list] " Dieter Nützel
[not found] ` <200109230016.f8N0G6G25222@zero.tech9.net>
2001-09-23 2:58 ` Robert Love
[not found] ` <200109222120.f8MLKYG24859@zero.tech9.net>
2001-09-23 2:44 ` Robert Love
[not found] ` <200109200757.JAA60995@blipp.internet5.net>
2001-09-20 17:37 ` Roger Larsson
2001-09-20 21:29 ` Robert Love
2001-09-20 21:53 ` Dieter Nützel
[not found] ` <200109200758.f8K7wEG13675@zero.tech9.net>
2001-09-20 21:09 ` Robert Love
2001-09-20 20:01 ` Tobias Diedrich
2001-09-20 22:01 ` Robert Love
2001-09-22 3:57 ` Andre Pang
2001-09-22 6:10 ` Robert Love
2001-09-22 7:22 ` Andre Pang
2001-09-23 3:18 ` george anzinger
2001-09-23 3:21 ` Robert Love
2001-09-23 7:05 ` Robert Love
2001-09-23 12:03 ` Andre Pang
2001-09-23 18:31 ` Robert Love
2001-09-22 12:56 ` ksoftirqd? (Was: Re: [PATCH] Preemption Latency Measurement Tool) Roger Larsson
2001-09-22 13:14 ` Andrea Arcangeli
2001-09-22 20:51 ` Roger Larsson
2001-09-22 21:33 ` Andrea Arcangeli
[not found] <200109202253.RAA21082@waste.org>
2001-09-20 23:15 ` [PATCH] Preemption Latency Measurement Tool Oliver Xymoron
2001-09-21 0:42 ` Roger Larsson
2001-09-21 1:03 ` Alan Cox
2001-09-21 1:22 ` Andrea Arcangeli
2001-09-21 1:51 ` Rik van Riel
2001-09-21 1:38 ` Roger Larsson
2001-09-21 1:53 ` Roger Larsson
2001-09-21 2:08 ` Roger Larsson
2001-09-21 2:29 ` Rik van Riel
2001-09-21 16:24 ` Jussi Laako
2001-09-21 16:36 ` Alan Cox
2001-09-21 18:46 ` Thomas Sailer
2001-09-22 10:30 ` Jussi Laako
2001-09-21 16:18 ` Stefan Westerfeld
2001-09-21 20:18 ` Dieter Nützel
[not found] ` <200109212018.f8LKImG21229@zero.tech9.net>
2001-09-21 21:47 ` Robert Love
-- strict thread matches above, loose matches on Subject: below --
2002-04-09 5:23 [PATCH] preemption latency measurement tool Robert Love
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=3BAB614E.8600D074@mvista.com \
--to=george@mvista.com \
--cc=Dieter.Nuetzel@hamburg.de \
--cc=andrea@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=oxymoron@waste.org \
--cc=reiserfs-list@namesys.com \
--cc=rml@tech9.net \
--cc=roger.larsson@norran.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox