Re: Todd's affinity code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 21, 2009 at 02:10:44PM -0700, Arne Chr. Jorgensen wrote:
> 
> Todd Denniston wrote:
> >
> > Question:
> > if you do
> > taskset -p 0x00000002 \
> >  `ps aux |grep /usr/bin/Xorg| \
> >   grep -v grep |awk '{print $2}'`
> >
> > {painful way to get the X pid to feed to taskset, which suggests to the kernel
> > keep the X process on the second processor.}
....
> 
> "..painful way to get the...", - not when you wrote it. But to compose anything
> like that oneself, - that is painful ;)

That is why a sane way to write something of that kind would be

   taskset -p 0x00000002 `pgrep Xorg`

Every time you see a pipe from grep to awk you immediately know that
something is wrong.

> But it did not improve.   

That what I would call painful.

    Michal

p.s.  Even on a system where pgrep and /sbin/pidof are not available
then something like

   ps ax | awk '/[X]org/{print $1}'

or similar will produce a desired process id.

-- 
fedora-test-list mailing list
fedora-test-list@xxxxxxxxxx
To unsubscribe: 
https://www.redhat.com/mailman/listinfo/fedora-test-list

[Index of Archives]     [Fedora Desktop]     [Fedora SELinux]     [Photo Sharing]     [Yosemite Forum]     [KDE Users]

  Powered by Linux