Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* RE: Force app to use single CPU
  2000-01-18 23:14 Blake Carlson
@ 2000-01-18 23:11 ` Greg Lindahl
  2000-01-18 23:46   ` Blake Carlson
  2000-01-19 15:13 ` Sean Hunter
  1 sibling, 1 reply; 6+ messages in thread
From: Greg Lindahl @ 2000-01-18 23:11 UTC (permalink / raw)
  To: axp-list

> I have an imaging app (uses ~500MB of memory) running on my DP264
> (Linux 2.2.10) that seems to spend a lot of time context switching between
> the processors (judging from xosview).

The linux scheduler is supposed to keep processes in the same CPU if
possible. I would suspect that it would switch back and forth mostly if it
were paging. You can modify your kernel to have a bigger
PROC_CHANGE_PENALTY...

The file in question is linux/kernel/sched.c, the function is "goodness()".

-- g


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

* Force app to use single CPU
@ 2000-01-18 23:14 Blake Carlson
  2000-01-18 23:11 ` Greg Lindahl
  2000-01-19 15:13 ` Sean Hunter
  0 siblings, 2 replies; 6+ messages in thread
From: Blake Carlson @ 2000-01-18 23:14 UTC (permalink / raw)
  To: axp-list

Hello all -

I have an imaging app (uses ~500MB of memory) running on my DP264
(Linux 2.2.10) that seems to spend a lot of time context switching between
the processors (judging from xosview).  If I change the priority of the
app, I can get it to stick on one processor longer before context
switching out (no big surprise there).

Would I see a _significant_ difference in performance if I was able to
force the app to stick to one CPU all of the time (forcing all other
processes to run on the second processor)?  Could I get two copies of the
program running at the same time to stick to a single CPU and not context
switch? (runtime for the program is about 1 hour)

What is the best way to do this.  'nice -20 app' as root? 


Thanks for your help -

Blake Carlson
blake-carlson@uiowa.edu
College of Electrical & Computer Engineering
University of Iowa
 


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

* RE: Force app to use single CPU
  2000-01-18 23:11 ` Greg Lindahl
@ 2000-01-18 23:46   ` Blake Carlson
  0 siblings, 0 replies; 6+ messages in thread
From: Blake Carlson @ 2000-01-18 23:46 UTC (permalink / raw)
  To: axp-list

I'm pretty sure that it's not paging memory.  The machine has 2GB of RAM
and I don't see any indications of paging.

-- Blake

On Tue, 18 Jan 2000, Greg Lindahl wrote:

> > I have an imaging app (uses ~500MB of memory) running on my DP264
> > (Linux 2.2.10) that seems to spend a lot of time context switching between
> > the processors (judging from xosview).
> 
> The linux scheduler is supposed to keep processes in the same CPU if
> possible. I would suspect that it would switch back and forth mostly if it
> were paging. You can modify your kernel to have a bigger
> PROC_CHANGE_PENALTY...
> 
> The file in question is linux/kernel/sched.c, the function is "goodness()".
> 
> -- g
> 
> 


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

* RE: Force app to use single CPU
@ 2000-01-19 11:34 Jakma, Paul
  2000-01-19 16:44 ` Wes Bauske
  0 siblings, 1 reply; 6+ messages in thread
From: Jakma, Paul @ 2000-01-19 11:34 UTC (permalink / raw)
  To: 'axp-list@redhat.com'

> that seems to spend a lot of time context 
> switching between
> the processors (judging from xosview). 

or maybe a case of the observed system being influenced by the measuring
tool?

ie xosview needs cpu time aswell. (and quite a lot of it).

consider the unobserved system, where your app and the X server are the main
loads. The linux scheduler will correctly try to keep X on one cpu, and your
app on the other.

Now introduce xosview. You have 3 processes fighting for cpu_time, and only
2 cpu's. The linux scheduler will still try maintain cpu affinity, but if a
cpu becomes free, there's no point in wasting that slot.  

what you are seeing is correct scheduler behaviour.

regards,

paul jakma. 



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

* Re: Force app to use single CPU
  2000-01-18 23:14 Blake Carlson
  2000-01-18 23:11 ` Greg Lindahl
@ 2000-01-19 15:13 ` Sean Hunter
  1 sibling, 0 replies; 6+ messages in thread
From: Sean Hunter @ 2000-01-19 15:13 UTC (permalink / raw)
  To: axp-list

On Tue, Jan 18, 2000 at 05:14:39PM -0600, Blake Carlson wrote:
> Hello all -
> 
> I have an imaging app (uses ~500MB of memory) running on my DP264
> (Linux 2.2.10) that seems to spend a lot of time context switching between
> the processors (judging from xosview).  

xosview is very processor-intensive, and is causing the switching.  If 
it wasn't running, you'd have much better processor-affinity.

Sean


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

* Re: Force app to use single CPU
  2000-01-19 11:34 Force app to use single CPU Jakma, Paul
@ 2000-01-19 16:44 ` Wes Bauske
  0 siblings, 0 replies; 6+ messages in thread
From: Wes Bauske @ 2000-01-19 16:44 UTC (permalink / raw)
  To: axp-list

"Jakma, Paul" wrote:
> 
> > that seems to spend a lot of time context
> > switching between
> > the processors (judging from xosview).
> 
> or maybe a case of the observed system being influenced by the measuring
> tool?
> 
> ie xosview needs cpu time aswell. (and quite a lot of it).
> 
> consider the unobserved system, where your app and the X server are the main
> loads. The linux scheduler will correctly try to keep X on one cpu, and your
> app on the other.
> 
> Now introduce xosview. You have 3 processes fighting for cpu_time, and only
> 2 cpu's. The linux scheduler will still try maintain cpu affinity, but if a
> cpu becomes free, there's no point in wasting that slot.
> 
> what you are seeing is correct scheduler behaviour.
> 

Using affinity though, if the scheduler weights things reasonably,
would put the cpu constrained task on one cpu and leave it there
while putting things like X/xosview/your favorite window manager/the
clock/xterms/etc. on the other. If you want to look at a minimally 
cluttered environment, run things from a text screen, not X. If your 
program needs X, maybe you should separate the compute part from 
the display part. (Works for me... YMMV)


Wes


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

end of thread, other threads:[~2000-01-19 16:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-01-19 11:34 Force app to use single CPU Jakma, Paul
2000-01-19 16:44 ` Wes Bauske
  -- strict thread matches above, loose matches on Subject: below --
2000-01-18 23:14 Blake Carlson
2000-01-18 23:11 ` Greg Lindahl
2000-01-18 23:46   ` Blake Carlson
2000-01-19 15:13 ` Sean Hunter

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