mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* CPU Loading
@ 2006-10-27  5:37 Indian Mogul
  2006-10-27  7:26 ` Mike Galbraith
  0 siblings, 1 reply; 3+ messages in thread
From: Indian Mogul @ 2006-10-27  5:37 UTC (permalink / raw)
  To: linux-kernel

****Apologies if I have posted at the wrong mailing
list ***** 

Hi,

I need some help in understanding the impact of cpu
loading and 
multimedia characteristics. My current system is
Pentium4, HT, 1GB Ram; i am also using LInux 2.6.18.1
kernel (vanilla). For stressing the cpu, I am 
using interbench which run a loop using asm volatile
identifier and the multimedia player I am using is
mplayer.

Here are my steps:
1. Fire Interbench in the background. Using top I see
that the CPU 
utlization is 99.1%.
2. Fire mplayer with Interbench running.

Both of them have equal priority.

However, I am NOT seeing any impact of loading the cpu
on the performance of mplyaer (i.e no dropped frames,
lack of synchronization,...). 

How can I load the CPU such that the scheduling time
slice is insuffucent for mplayer to playout the video?
To the mplayer the system thus appears "slow" ?

Thanks,
IM



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: CPU Loading
  2006-10-27  5:37 CPU Loading Indian Mogul
@ 2006-10-27  7:26 ` Mike Galbraith
  2006-10-27 21:36   ` Indian Mogul
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Galbraith @ 2006-10-27  7:26 UTC (permalink / raw)
  To: Indian Mogul; +Cc: linux-kernel

On Thu, 2006-10-26 at 22:37 -0700, Indian Mogul wrote:

> How can I load the CPU such that the scheduling time
> slice is insuffucent for mplayer to playout the video?
> To the mplayer the system thus appears "slow" ?

:) unusual request.

The proglet below, which someone posted a while back, should meet your
needs nicely.  Fire up a few copies in the background with args like
5000 6000 7000 8000 9000.., and mplayer should become decidedly unhappy.

The scheduler round robin schedules tasks which it has classified as
interactive (tasks which sleep somewhat regularly basically) at a higher
rate than their timeslice to reduce latency, but the more tasks
circulating at the same priority (or above) as mplayer, the bigger the
latency hit mplayer will take.

	-Mike

#include <stdlib.h>
#include <unistd.h>

static void burn_cpu(unsigned int x)
{
	static char buf[1024];
	int i;
	
	for (i=0; i < x; ++i)
		buf[i%sizeof(buf)] = (x-i)*3;
}

int main(int argc, char **argv)
{
	unsigned long burn;
	if (argc != 2)
		return 1;
	burn = (unsigned long)atoi(argv[1]);
	while(1) {
		burn_cpu(burn*1000);
		usleep(1);
	}
	return 0;
}



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: CPU Loading
  2006-10-27  7:26 ` Mike Galbraith
@ 2006-10-27 21:36   ` Indian Mogul
  0 siblings, 0 replies; 3+ messages in thread
From: Indian Mogul @ 2006-10-27 21:36 UTC (permalink / raw)
  To: Mike Galbraith, linux-kernel

Thanks for the code snippet.. One more question. I
want to  load the cpu with x% load & take
measurements. For eg, cpu_burn <x> should load the CPU
 with x% occupancy.. Is there a way this could be
done? Any program / pointers greatly appreciated..

Thanks,
IM 

--- Mike Galbraith <efault@gmx.de> wrote:

> On Thu, 2006-10-26 at 22:37 -0700, Indian Mogul
> wrote:
> 
> > How can I load the CPU such that the scheduling
> time
> > slice is insuffucent for mplayer to playout the
> video?
> > To the mplayer the system thus appears "slow" ?
> 
> :) unusual request.
> 
> The proglet below, which someone posted a while
> back, should meet your
> needs nicely.  Fire up a few copies in the
> background with args like
> 5000 6000 7000 8000 9000.., and mplayer should
> become decidedly unhappy.
> 
> The scheduler round robin schedules tasks which it
> has classified as
> interactive (tasks which sleep somewhat regularly
> basically) at a higher
> rate than their timeslice to reduce latency, but the
> more tasks
> circulating at the same priority (or above) as
> mplayer, the bigger the
> latency hit mplayer will take.
> 
> 	-Mike
> 
> #include <stdlib.h>
> #include <unistd.h>
> 
> static void burn_cpu(unsigned int x)
> {
> 	static char buf[1024];
> 	int i;
> 	
> 	for (i=0; i < x; ++i)
> 		buf[i%sizeof(buf)] = (x-i)*3;
> }
> 
> int main(int argc, char **argv)
> {
> 	unsigned long burn;
> 	if (argc != 2)
> 		return 1;
> 	burn = (unsigned long)atoi(argv[1]);
> 	while(1) {
> 		burn_cpu(burn*1000);
> 		usleep(1);
> 	}
> 	return 0;
> }
>


> 
> 




 
____________________________________________________________________________________
Low, Low, Low Rates! Check out Yahoo! Messenger's cheap PC-to-Phone call rates 
(http://voice.yahoo.com)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-10-27 21:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-27  5:37 CPU Loading Indian Mogul
2006-10-27  7:26 ` Mike Galbraith
2006-10-27 21:36   ` Indian Mogul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome