On Tuesday, January 31, 2012 09:02:45 AM Tom Easterday did opine:

> On Jan 31, 2012, at 2:00 AM, gene heskett wrote:
> > The crosspost didn't work apparently, came from the wrong email
> > account I suppose.
> > 
> > Anyway, the answer is 'taskset' see the manpage.
> > 
> > So I wrote a 3 line script to use taskset to launch emc AND pin it to
> > the 2nd cpu core.  Runs sweet & likely 50% faster than I ever ran
> > before once I get done fine tuning the base_thread time in the .ini
> > file.  32 u-secs is only using 26% of that core, so there is room to
> > play yet.
> > 
> > The script:
> > --------------
> > #!/bin/bash
> > taskset 0x00000002 /usr/bin/emc -l &
> > exit 0
> > --------------
> > 
> > Note the manpage explains that the 2nd argument above very obtusely. 
> > cpu0 would be 0x00000001, cpu2 then would be 0x00000004, cpu3 is then
> > 0x00000008.  etc etc.  Bit wise control starting from the ls bit IOW.
> >  And if the cores are available, you can set it to use 2 or more.
> 
> I have a dual core D510MO board.  I put the rtai kernel on the first
> core using the instructions here: 
> http://wiki.linuxcnc.org/cgi-bin/wiki.pl?The_Isolcpus_Boot_Parameter_An
> d_GRUB2
> 
> In activity monitor it looks like nothing is happening at all on the
> second core.  So, are you saying using taskset you are putting your
> other processes on the other core?  Our machine is quite slow after
> doing the isolcpus fix, even when not running Axis.  Web pages or any
> other tasks take many seconds to launch.   So if you want other tasks
> to run there do you have to launch each with a script like this?
> 
> Tom

No Tom, at least not in my vision of how this is supposed to work.

In grub, if the rtai kernel line has "isolcpus=1" appended, which takes 
cpu1 out of the scheduler, then after the boot in completed, everything is 
running on cpu0.  gkrellm makes a heck of a nice monitor for such, I don't 
have a box that isn't running it, set in the "on every screen always on top 
mode".  With hyperthreading turned off in the bios, it will show you how 
busy the two cores are.  If hyperthreading is enabled, then gkrellm thinks 
it has 4 cores.

Then, using taskset, put emc/linuxcnc to running on the now forcibly idled 
cpu1.  The rest of the stuff, running on cpu0, then has plenty of time to 
run.

FWIW, I called that script 'lcnc', a lot easier to type than linuxcnc. :)

Now, if you had something which, when emc/linuxcnc wasn't running, needed 
some help, taskset claims to be able to move a PID if that other task is 
running already.

But the point here is to give emc/linuxcnc's realtime stuff that whole cpu1 
core, without any interference from the rest of the system.  I'm told that 
the display related stuff, being user, still uses cpu0.

The end result is that I would only use taskset to run emc/linuxcnc because 
when its running that way, it doesn't seem to interfere with the rest of 
the machine at all.  Conversely, the rest of the machines tasks and how 
busy they may be, does not seem to effect emc/linuxcnc.  Hence the sub 3 
microsecond latency-test results when taskset was used to run latency-test, 
which before were about 7 microseconds and above 14 microseconds if some 
gfx operation needed to build a screen or such on another window.

Cheers, Gene
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page: <http://coyoteden.dyndns-free.com:85/gene>
The eagle may soar, but the weasel never gets sucked into a jet engine.

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to