Discussion:
Force one processor with Linux
(too old to reply)
Philip K. Dick
2005-12-21 09:30:42 UTC
Permalink
Hi

On multi-processor LINUX machines, is there a way
to force an executable run on only one
processor ?

(my application crashes on multi-processor
or hyper-threaded architectures)

PKD
Josef Moellers
2005-12-21 10:02:27 UTC
Permalink
Post by Philip K. Dick
Hi
On multi-processor LINUX machines, is there a way
to force an executable run on only one
processor ?
(my application crashes on multi-processor
or hyper-threaded architectures)
Your application will always run on only a single CPU unless it's a
multi-threaded application.
Binding an application to a single CPU is usually only done to have a
positive effect on cache utilzation.

If your application crashes on multi-CPU, you most likely have buggy
hardware. There is no reason wny your application should have problems
with migrating from one CPU to another.
If it's really your application having problems with SMP, then your
program is buggy and needs fixed. Find the root cause and fix that.
--
Josef Möllers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
Philip K. Dick
2005-12-21 10:28:31 UTC
Permalink
Post by Josef Moellers
Post by Philip K. Dick
Hi
On multi-processor LINUX machines, is there a way
to force an executable run on only one
processor ?
(my application crashes on multi-processor
or hyper-threaded architectures)
Your application will always run on only a single CPU unless it's a
multi-threaded application.
Binding an application to a single CPU is usually only done to have a
positive effect on cache utilzation.
If your application crashes on multi-CPU, you most likely have buggy
hardware. There is no reason wny your application should have problems
with migrating from one CPU to another.
If it's really your application having problems with SMP, then your
program is buggy and needs fixed. Find the root cause and fix that.
Thanks Josef

My application is multi-threaded, but does not crash on
Solaris multi-processor architectures.

Unfortunately, there are parts of the code that I cannot
change because it comes from other people (CORBA middleware)
and it is very difficult to find the problem,
that's why I asked if possible to force the application
run on one processor
Michael Heiming
2005-12-21 14:09:14 UTC
Permalink
Post by Philip K. Dick
Post by Philip K. Dick
Hi
On multi-processor LINUX machines, is there a way
to force an executable run on only one
processor ?
[..]
Post by Philip K. Dick
My application is multi-threaded, but does not crash on
Solaris multi-processor architectures.
Unfortunately, there are parts of the code that I cannot
change because it comes from other people (CORBA middleware)
and it is very difficult to find the problem,
that's why I asked if possible to force the application
run on one processor
man taskset

(YMMV)
--
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo ***@urvzvat.qr | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 309: firewall needs cooling
Kasper Dupont
2005-12-21 11:01:44 UTC
Permalink
Post by Philip K. Dick
(my application crashes on multi-processor
or hyper-threaded architectures)
Then it is most likely going to crash on single
CPU machines as well, maybe not as often.
--
Kasper Dupont
Note to self: Don't try to allocate
256000 pages with GFP_KERNEL on x86.
General Schvantzkoph
2005-12-21 15:02:19 UTC
Permalink
Post by Philip K. Dick
Hi
On multi-processor LINUX machines, is there a way
to force an executable run on only one
processor ?
(my application crashes on multi-processor
or hyper-threaded architectures)
PKD
Which kernel are you running?
Philip K. Dick
2005-12-21 16:57:09 UTC
Permalink
Post by General Schvantzkoph
Post by Philip K. Dick
Hi
On multi-processor LINUX machines, is there a way
to force an executable run on only one
processor ?
(my application crashes on multi-processor
or hyper-threaded architectures)
PKD
Which kernel are you running?
I run on kernel 2.6, so that I can use
'taskset' (package utils/schedutils)
and my application crashes no more !

MANY THANKS TO ALL !!!

PKD
John-Paul Stewart
2005-12-21 18:13:51 UTC
Permalink
Post by Philip K. Dick
Post by General Schvantzkoph
Post by Philip K. Dick
Hi
On multi-processor LINUX machines, is there a way
to force an executable run on only one
processor ?
(my application crashes on multi-processor
or hyper-threaded architectures)
PKD
Which kernel are you running?
I run on kernel 2.6, so that I can use
'taskset' (package utils/schedutils)
and my application crashes no more !
I'd take that as a pretty clear sign that there's a bug in your code! I
strongly encourage you to look into *why* you're getting crashes and fix
it so that it works without the need for 'taskset'.
linc
2005-12-22 04:03:50 UTC
Permalink
Post by John-Paul Stewart
Post by Philip K. Dick
Post by General Schvantzkoph
Post by Philip K. Dick
Hi
On multi-processor LINUX machines, is there a way
to force an executable run on only one
processor ?
(my application crashes on multi-processor
or hyper-threaded architectures)
PKD
Which kernel are you running?
I run on kernel 2.6, so that I can use
'taskset' (package utils/schedutils)
and my application crashes no more !
I'd take that as a pretty clear sign that there's a bug in your code! I
strongly encourage you to look into *why* you're getting crashes and fix
it so that it works without the need for 'taskset'.
I'd take the crash as a sign that there is a bug. But if you take the
fix as a sign that there is a bug, then whatever works for you...
John-Paul Stewart
2005-12-22 16:25:38 UTC
Permalink
Post by linc
Post by John-Paul Stewart
Post by Philip K. Dick
I run on kernel 2.6, so that I can use
'taskset' (package utils/schedutils)
and my application crashes no more !
I'd take that as a pretty clear sign that there's a bug in your code! I
strongly encourage you to look into *why* you're getting crashes and fix
it so that it works without the need for 'taskset'.
I'd take the crash as a sign that there is a bug. But if you take the
fix as a sign that there is a bug, then whatever works for you...
Well, I said I take *that particular fix* as a sign that the bug is in
*his* code. Sure, the crash itself is indeed a sign of a bug somewhere
(potentially even in bad hardware). The fact that it now works on the
exact same hardware with the exact same kernel and libraries strongly
suggests the bug is in his code (which now appears unable to cope with
being run on an SMP system) rather than anyplace else.
General Schvantzkoph
2005-12-21 19:53:53 UTC
Permalink
Post by Philip K. Dick
Post by General Schvantzkoph
Post by Philip K. Dick
Hi
On multi-processor LINUX machines, is there a way
to force an executable run on only one
processor ?
(my application crashes on multi-processor
or hyper-threaded architectures)
PKD
Which kernel are you running?
I run on kernel 2.6, so that I can use
'taskset' (package utils/schedutils)
and my application crashes no more !
MANY THANKS TO ALL !!!
PKD
Which 2.6? There are huge differences between the different versions of
2.6. If you are running an older version of the kernel try upgrading to
the latest version, 2.6.14.4.
David Schwartz
2005-12-22 00:47:35 UTC
Permalink
Post by Philip K. Dick
I run on kernel 2.6, so that I can use
'taskset' (package utils/schedutils)
and my application crashes no more !
At least it crashes much less often. I caution you that you should *NOT*
consider this code to be reliable.

By the way, you may be able to get the same effect a less drastic way.
Just make sure all your calls into the untrustworthy code come from a single
thread. Basically, you wrap their code in a service thread that makes all
the calls into it on your behalf. Think of it as a quarantine. If you can do
this in a separate process, all the better!

DS
George M. Reagan
2005-12-22 04:15:07 UTC
Permalink
I really enjoyed your novel "UBIK".
Post by Philip K. Dick
Hi
On multi-processor LINUX machines, is there a way
to force an executable run on only one
processor ?
(my application crashes on multi-processor
or hyper-threaded architectures)
PKD
Erik Max Francis
2005-12-22 04:29:32 UTC
Permalink
Post by George M. Reagan
I really enjoyed your novel "UBIK".
Right, a From line indicating the name of a famous person is surely
authenaticated proof of their identity.

Not to mention Dick has been dead for over two decades.
--
Erik Max Francis && ***@alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
Think twice before you speak to a friend in need.
-- Ambrose Bierce
George M. Reagan
2005-12-23 00:55:44 UTC
Permalink
You OBVIOUSLY cannot take a joke.
Post by Erik Max Francis
Post by George M. Reagan
I really enjoyed your novel "UBIK".
Right, a From line indicating the name of a famous person is surely
authenaticated proof of their identity.
Not to mention Dick has been dead for over two decades.
--
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
Think twice before you speak to a friend in need.
-- Ambrose Bierce
Erik Max Francis
2005-12-23 01:23:05 UTC
Permalink
Post by George M. Reagan
You OBVIOUSLY cannot take a joke.
And you obviously don't realize that sarcasm doesn't come across well on
Usenet.
--
Erik Max Francis && ***@alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
Custom reconciles us to everything.
-- Edmund Burke
George M. Reagan
2005-12-25 02:06:23 UTC
Permalink
BLOW ME
Post by Erik Max Francis
Post by George M. Reagan
You OBVIOUSLY cannot take a joke.
And you obviously don't realize that sarcasm doesn't come across well on
Usenet.
--
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
Custom reconciles us to everything.
-- Edmund Burke
Joseph2k
2006-01-31 05:17:11 UTC
Permalink
Post by George M. Reagan
BLOW ME
Post by Erik Max Francis
Post by George M. Reagan
You OBVIOUSLY cannot take a joke.
And you obviously don't realize that sarcasm doesn't come across well on
Usenet.
--
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
Custom reconciles us to everything.
-- Edmund Burke
Tell us where to find you so we can place the C4.
--
JosephKK
Gegen dummheit kampfen Die Gotter Selbst, vergebens.
--Shiller
James J. Dines
2006-02-02 00:28:48 UTC
Permalink
Post by Philip K. Dick
Hi
On multi-processor LINUX machines, is there a way
to force an executable run on only one
processor ?
(my application crashes on multi-processor
or hyper-threaded architectures)
PKD
Well, PKD, sorry to see that all you got for responses was some ridiculous
back and forth about the novelist Philip K. Dick. Apparently they never
heard of namespace clashes, but I digress.

If you are using lilo, I believe you can pass the string smp=off to disable
Symmetric Multi-Processing, and the kernel will then use only one
processor. If you are having trouble making this work, let me know and I
will look into it a bit better.

If you are not using lilo as your bootloader, and you still need a solution,
make sure to include the name of the bootloader you are using here.

I just came on board here at comp.os.linux. I know the question is old, but
I figured I'd reply anyway just in case you never received an answer.

Cheers,

Jim D.

Loading...