OK I have to take this back.  It didn't work.

<Holds head in shame.>

It turned out that when I put the pauses in between
the modprobes, I first tested it by restarting Myth
(including X and rmmod'ing and modprobing the modules)
using my /etc/init.d/myth start script.  After doing
this, Xorg's CPU usage was behaving properly, leading
me to believe it was fixed.

But when I actually *rebooted* the machine, Xorg was
back to ~100% when the machine was otherwise doing
nothing.  Increasing the pause times between modprobes
didn't help.  I found it repeatably depended on
whether or not I actually rebooted.

Then I realized X is being shut down and restarted, so
I tried adding a line to my startX script which
briefly runs and then shuts down an X server, and then
starts the actual server and programs for MythTV. 
Now, my startX script looks like this:

#!/bin/sh

# Added the line below
/usr/X11R6/bin/xinit /usr/bin/xterm -e "echo hello;
sleep 2; exit" -- /usr/X11R6/bin/Xorg :1 -layout
"Hauppauge Layout"

su - --command="/usr/X11R6/bin/xinit /etc/X11/startXrc
-- /usr/X11R6/bin/Xorg :1 -layout \"Hauppauge
Layout\"" mythtv


Of course, startXrc contains the part that starts
mythfrontend, etc.  startX is called once all the
modules are loaded and lircd and mythbackend are
started.

Now, I no longer get a pegged Xorg even on reboot
(cough).  It seems to be only the very first instance
of the Xorg X server that pegs the CPU.  Why it is, I
don't know, but at least I found a workaround.  Now I
can take out all those unnecessary time consuming
sleeps from my myth startup script.

Cheers.


--- [EMAIL PROTECTED] wrote:

> Mike, you rock.  Thank you.
> 
> In my myth startup script, I placed a "sleep 2" in
> between all the modprobes.  Now, Xorg no longer pegs
> to 100% while on.
> 
> Fantastic!
> 
> The modprob'ing portion of the startup script now
> looks like this:
> 
> /sbin/modprobe tuner type=39
> sleep 2
> /sbin/modprobe ivtv
> sleep 2
> /sbin/modprobe ivtv-fb
> sleep 2
> /sbin/modprobe lirc_i2c
> sleep 2
> /sbin/modprobe lirc-dev
> sleep 2
> [...other stuff...]
> 
> 
> And top shows (while myth is running):
> 
> top - 21:59:50 up 58 min,  2 users,  load average:
> 0.04, 0.60, 0.80
> Tasks:  82 total,   1 running,  81 sleeping,   0
> stopped,   0 zombie
> Cpu(s): 15.4% us, 72.0% sy,  0.0% ni, 11.7% id, 
> 0.5%
> wa,  0.4% hi,  0.0% si
> Mem:   1034256k total,   390268k used,   643988k
> free,
>    33632k buffers
> Swap:  1052216k total,        0k used,  1052216k
> free,
>   257532k cached
> 
>   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM  
> 
> TIME+  COMMAND
>  5449 root      15   0     0    0    0 S  2.0  0.0  
> 0:02.13 lirc_dev
>     1 root      16   0   596  236  452 S  0.0  0.0  
> 0:00.87 init
>     2 root      34  19     0    0    0 S  0.0  0.0  
> 0:00.00 ksoftirqd/0
>     3 root       5 -10     0    0    0 S  0.0  0.0  
> 0:00.00 events/0
>     4 root       5 -10     0    0    0 S  0.0  0.0  
> 0:00.00 khelper
> [...]
> 
> 
> --- Mike Shields <[EMAIL PROTECTED]> wrote:
> 
> > I used to see the same thing - if I killed X and
> > restarted it, it
> > would not peg the cpu anymore.
> > 
> > I removed the module load and X start from my
> > startup scripts, and
> > load them manually (thank goodness for the static
> > buffers in new 0.3's
> > - the dynamic buffers never let me get any more
> than
> > 24 hours without
> > a reboot) - and when loading manually I never see
> > the pegging - I
> > guess because I take longer between loading the
> > modules and starting X
> > than a script does.
> > 
> > Try killing off X and restarting it. I will
> > resurrect my old scripts
> > and see if I still get the same behavior.
> > 
> > On 6/11/05, [EMAIL PROTECTED]
> > <[EMAIL PROTECTED]> wrote:
> > > I have found that when my computer (set up with
> > MythTV
> > > 0.18.1) is sitting idle, Xorg is always pegging
> > the
> > > CPU, even when Myth isn't running.  Here is a
> > typical
> > > "top":
> > > 
> > > 
> > > top - 18:45:20 up 18:14,  2 users,  load
> average:
> > > 1.77, 1.75, 1.71
> > > Tasks:  90 total,   2 running,  88 sleeping,   0
> > > stopped,   0 zombie
> > > Cpu(s): 30.4% us, 69.2% sy,  0.0% ni,  0.0% id, 
> > 0.0%
> > > wa,  0.3% hi,  0.0% si
> > > Mem:   1034256k total,  1031360k used,     2896k
> > free,
> > >     2488k buffers
> > > Swap:  1052216k total,    40204k used,  1012012k
> > free,
> > >   883056k cached
> > > 
> > >   PID USER      PR  NI  VIRT  RES  SHR S %CPU
> %MEM
> > > TIME+  COMMAND
> > >  4602 root      25   0 24256 9112 4692 R 97.2 
> 0.9
> > > 1037:43 Xorg
> > >  4526 root      15   0     0    0    0 S  1.0 
> 0.0
> > > 10:51.49 lirc_dev
> > >     1 root      16   0   596  148  452 S  0.0 
> 0.0
> > > 0:00.90 init
> > >     2 root      34  19     0    0    0 S  0.0 
> 0.0
> > > 0:00.00 ksoftirqd/0
> > >     3 root       5 -10     0    0    0 S  0.0 
> 0.0
> > > 0:00.00 events/0
> > > [...]
> > > 
> > > 
> > > The near 100% cpu usage shows whether or not I
> am
> > > running myth and whether or not anything in myth
> > is
> > > actually being done.  The system is still quite
> > > responsive, whenever I do anything
> CPU-intensive,
> > Xorg
> > > backs off the CPU usage as if it were niced.
> > > 
> > > --> ivtv 0.2.0-rc3j (used also as pvr350
> > framebuffer
> > > with ivtvdev)
> > > --> Xorg 6.8.1 (recompiled as necessary for
> > > framebuffer)
> > > --> MythTV 0.18.1 (FE/BE, headless)
> > > --> icewm as window manager
> > > --> P4 2.4GHz + PVR350
> > > 
> > > I don't see anything in the appropriate
> Xorg.1.log
> > > that looks like a related error message.
> > > 
> > > Is this a bug in Xorg that I can fix with an
> > upgrade
> > > to 6.8.2?  Is this a "feature" of ivtv?  I
> > recently
> > > reinstalled the entire Myth box from scratch due
> > to a
> > > complete hard drive failure (a 200G Seagate
> drive,
> > for
> > > those who care) and actually upgraded to a P4. 
> I
> > > think Xorg wasn't doing this before (at that
> time
> > I
> > > was running ivtv 0.2.0-rc3e), but I can't be
> sure.
> > > I've searched ivtv-dev and googled, but can't
> find
> > any
> > > references to this type of thing so far.
> > > 
> > > Any help will be greatly appreciated by my
> > electric
> > > bill.  ;)
> > > 
> > > 
> > >
> >
>
-------------------------------------------------------
> > > This SF.Net email is sponsored by: NEC IT Guy
> > Games.  How far can you shotput
> > > a projector? How fast can you ride your desk
> chair
> > down the office luge track?
> > > If you want to score the big prize, get to know
> > the little guy.
> > > Play to win an NEC 61" plasma display:
> > http://www.necitguy.com/?r=20
> > > _______________________________________________
> > > ivtv-devel mailing list
> > > [email protected]
> > >
> >
>
https://lists.sourceforge.net/lists/listinfo/ivtv-devel
> > >
> > 
> > 
> >
>
-------------------------------------------------------
> > This SF.Net email is sponsored by: NEC IT Guy
> Games.
> >  How far can you shotput
> 
=== message truncated ===



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
ivtv-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ivtv-devel

Reply via email to