Bug 106437 - magicdev is taking up excess cpu cycles 7-25%
Summary: magicdev is taking up excess cpu cycles 7-25%
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: magicdev
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: John (J5) Palmieri
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-10-07 03:21 UTC by Tommy McNeely
Modified: 2013-03-13 04:46 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-08-25 17:51:31 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
strace -o magicdev.strace magicdev (30 seconds or so) (120.90 KB, text/plain)
2003-10-07 03:24 UTC, Tommy McNeely
no flags Details
strace -ttT -o magicdev.strace-ttT /usr/bin/magicdev (165.66 KB, text/plain)
2003-10-09 00:39 UTC, Tommy McNeely
no flags Details
strace -ttT -p PID of magicdev using 20% (24.39 KB, text/plain)
2003-10-13 23:47 UTC, Tommy McNeely
no flags Details

Description Tommy McNeely 2003-10-07 03:21:54 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703

Description of problem:
magicdev seems to chew up a lot of excess CPU cycles... I usually just end up
killing it and removing it as I dont need its functionality, but was asked to
file a bug :)


Version-Release number of selected component (if applicable):
magicdev-1.1.4-7

How reproducible:
Always

Steps to Reproduce:
Start with a freshly installed Fedora box (severn-test2)
1. login to gnome
2. wait some time
3. check top output
    

Actual Results:  magicdev seems to be taking up lots of cpu cycles for its
function. usually sitting around 10-20% on my system (athlon 2100+)

Expected Results:  If magicdev consistently appears at the top of your top, then
that's a
bug. (Please provide information as detailed in the last mail)

What I'd expect is that it doesn't appear at all in top, except perhaps
popping up occasionally with 1-2% cpu if the sampling gets lucky.

Regards,
						Owen


Additional info:

my system is a dual athlon 2100+ running 2.4.22-1.2061.nptl (smp kernel broken
in test2 release).

I have a dual channel U160 SCSI controller onboard, and a 2940 for my "cdroms"
... I have a Toshiba 5x DVD, TEAC 32X CDROM (532S), and Yamaha CD burner..
(16x10x40) ... I cannot find the equivilant of /proc/bus/ide/hdc/model for scsi.

[root@cookies aic7xxx]# magicdev --verbose
magicdev: Checking for blacklisting of /dev/cdrom (/dev/scd0)
magicdev: Could not retrieve model
magicdev: Checking for blacklisting of /dev/cdrom1 (/dev/scd1)
magicdev: Could not retrieve model
magicdev: Checking for blacklisting of /dev/cdrom2 (/dev/scd2)
magicdev: Could not retrieve model

Comment 1 Tommy McNeely 2003-10-07 03:24:54 UTC
Created attachment 94970 [details]
strace -o magicdev.strace magicdev (30 seconds or so)

here is a 30 second (approx) strace output. it was riding at 11% towards the
end.. I think over time it takes more and more.

Tommy

Comment 2 Tommy McNeely 2003-10-07 04:24:13 UTC
also... take a look at that strace... I wonder why it opens like every single
png file in /usr/share/icons/Bluecurve/24x24/stock/ ? this application doesnt
even have a human interface does it?

Comment 3 Owen Taylor 2003-10-07 15:09:12 UTC
- The model information should be in /proc/scsi/scsi

- With three CDROM drives, I'd expect usage to be a bit higher,
  but 7-11% sounds too high.

- The strace, while not explaining why the CPU usage is high,
  is a bit strange; for all three drives, you are getting:

   ioctl(16, 0x5325, 0x7fffffff)           = 1
             MEDIA_CHANGED                   YES
   ioctl(16, 0x5326, 0x7fffffff)           = 2
             DRIVE_STATUS                    TRAY_OPEN

- Could you rerun the strace with strace -ttT; that will
  giving timestamps and syscall times, and hopefully figure
  out where the CPU is going.

- The bluecurve icons all getting loaded at startup is a consequence
  of doing icon themes in a bit of a hacky way. GTK+-2.4 will do better.
  When timed, it turns out that loading all those icons doesn't
  actually take that much time, though it certainly looks bad in a
  strace.

  Magicdev actually will display a dialog or two on occasion ...
  for example, the confirmation dialog for CD-ROMS with "autorun" scripts.



Comment 4 Tommy McNeely 2003-10-07 21:17:15 UTC
[root@cookies root]# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 03 Lun: 00
  Vendor: TOSHIBA  Model: DVD-ROM SD-M1401 Rev: 1007
  Type:   CD-ROM                           ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 04 Lun: 00
  Vendor: TEAC     Model: CD-ROM CD-532S   Rev: 3.0A
  Type:   CD-ROM                           ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 06 Lun: 00
  Vendor: YAMAHA   Model: CRW2100S         Rev: 1.0H
  Type:   CD-ROM                           ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: IBM-PSG  Model: DPSS-318350N  F  Rev: S94S
  Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi1 Channel: 00 Id: 02 Lun: 00
  Vendor: IBM-PSG  Model: DPSS-318350N  F  Rev: S94S
  Type:   Direct-Access                    ANSI SCSI revision: 03
[root@cookies root]#


Comment 5 Tommy McNeely 2003-10-07 21:25:06 UTC
... ok .. for some reason it has decided to behave for right now? so, um, the
only thing I did was watch a dvd on mplayer last night?

I did cause gnome-terminal to hang the whole desktop by forgetting the -o
filename option :) I suppose thats a bug too :)

I am going to reboot and try it again (from a fresh state?)

Tommy

Comment 6 Tommy McNeely 2003-10-09 00:39:20 UTC
Created attachment 95035 [details]
strace -ttT -o magicdev.strace-ttT /usr/bin/magicdev

here is the strace for approx 30 seconds... it was running from 3-8% the whole
time... it seems to vary quite a bit, but when it behaves, it doesnt even
hardly show up on top.. maybe .5% every 3rd or 4th refresh.

Tommy

Comment 7 Tommy McNeely 2003-10-13 23:47:49 UTC
Created attachment 95143 [details]
strace -ttT -p PID of magicdev using 20%

  PID USER     PRI  NI	SIZE  RSS SHARE STAT %CPU %MEM	 TIME CPU COMMAND
 5102 tommy	16   0	1996 1208  1100 S     9.1  0.1 301:19	1 magicdev

strace -ttT -o magicdev-20.strace -p 5102
Process 5102 attached - interrupt to quit
Process 5102 detached


its up to 25% now... if you need data, I have it in a "mis-behaved" state :)

Tommy

Comment 8 Tommy McNeely 2003-10-13 23:50:08 UTC
damn I wish this was like a forum and I could edit previous posts :)

  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND
 5102 tommy     16   0  1996 1212  1104 S    24.2  0.1 301:47   0 magicdev


Comment 9 Tommy McNeely 2003-10-14 00:01:49 UTC
it looks like the time is spent on whatever "irq" or "softirq" is?


 
 17:56:05  up 3 days, 19:21,  3 users,  load average: 0.59, 0.46, 0.36
99 processes: 96 sleeping, 3 running, 0 zombie, 0 stopped
CPU states:  cpu    user    nice  system    irq  softirq  iowait    idle
           total    0.0%    0.0%    0.0%  66.6%    66.8%   66.2%    0.0%
           cpu00    0.0%    0.0%    0.0%  33.3%    33.5%   33.1%    0.0%
           cpu01    0.0%    0.0%    0.0%  33.3%    33.4%   33.1%    0.0%
Mem:  1032128k av, 1012828k used,   19300k free,       0k shrd,   40340k buff
       475828k active,             488416k inactive
Swap: 1831400k av,  202856k used, 1628544k free                  677192k cached
                                                                               
                                          
  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND
 5102 tommy     16   0  1996 1212  1104 D    12.7  0.1 303:19   0 magicdev
24596 tommy     15   0  7256 7256  4776 S     6.6  0.7   8:33   0 xmms
 5287 tommy     15   0 11912  10M  8304 R     1.9  1.0   4:05   0 gnome-terminal



...



[tommy@cookies tommy]$ uname -a
Linux cookies.local.redneck.nu 2.4.22-1.2087.nptlsmp #1 SMP Sat Oct 4 09:28:12
EDT 2003 i686 athlon i386 GNU/Linux





Comment 10 Owen Taylor 2003-10-14 15:00:56 UTC
Bastien Nocera suggests that (if you don't actually need all three
CDs once) it would be useful to try disconnecting some of them
and see if there is a particular drive or combination of drives
that triggers the problem.


Comment 11 Tommy McNeely 2003-10-14 23:19:20 UTC
well.. its kindof nice to be able to watch DVD's and copy CD's at the same time,
but next time I can shut down my box, I will pull the cable on one of them and
see how things go.. I have my suspects.. only one of them flashes its light for
the check (TEAC 532S) so I will try unplugging it first :)

Tommy

Comment 12 Tommy McNeely 2003-10-21 20:31:45 UTC
just noticed with just the Toshiba DVD and Yamaha CRW, its climbing again :) I
will grab a strace and once my download (wget) gets done, I will reboot and take
off the CDRW :)


97 processes: 96 sleeping, 1 running, 0 zombie, 0 stopped
CPU states:  cpu    user    nice  system    irq  softirq  iowait    idle
           total    0.0%    0.0%    0.0%   0.0%     0.0%    0.0%    0.0%
           cpu00    0.0%    0.0%    0.0%   0.0%     0.0%    0.0%    0.0%
           cpu01    0.0%    0.0%    0.0%   0.0%     0.0%    0.0%    0.0%
Mem:  1032128k av, 1017972k used,   14156k free,       0k shrd,  153176k buff
       333336k active,             626264k inactive
Swap: 1831400k av,   22876k used, 1808524k free                  659880k cached
                                                                                
  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND
 4680 tommy     16   0  5344 4848  4644 S     9.7  0.4  83:55   0 magicdev
16214 tommy     15   0  1624 1620  1320 S     6.7  0.1   4:19   1 wget
 4561 root      15   0  297M  40M  9308 S     0.5  4.0  11:28   0 X

Comment 13 d_rosky 2003-12-27 19:50:00 UTC
I was about to file a bug on this as well, but it would be a
duplicate, so I'll just post a comment here.  I've actually seen this
behavior in magicdev since RH 7.3.  This bug has been there for years.

-Dave


Comment 14 Edward Aubert Carter 2004-02-27 01:05:33 UTC
I have also seen this behavior out of magicdev for years.  I currently
see it on Fedore Core 1.

Comment 15 David McKellar 2004-04-04 18:52:09 UTC
Sorry if this is very obvious but here goes... why not just add
a parameter for the number of seconds to sleep between checks
(or something like that).  I don't insert CD-ROM very often
I won't mind waiting 10 seconds for it to be mounted.

Comment 16 John (J5) Palmieri 2004-08-25 17:51:31 UTC
Closing.  Magicdev has been removed in favor of gnome-volume-manager
in devel branch.

Comment 17 Gunther Mayer 2006-02-20 14:48:02 UTC
there is a longstanding bug (or performance issue) in the kernel,
see https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=179573



Note You need to log in before you can comment on or make changes to this bug.