Bug 106437 - magicdev is taking up excess cpu cycles 7-25%
magicdev is taking up excess cpu cycles 7-25%
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: magicdev (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: John (J5) Palmieri
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-10-06 23:21 EDT by Tommy McNeely
Modified: 2013-03-13 00:46 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-08-25 13:51:31 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Tommy McNeely 2003-10-06 23:21:54 EDT
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-06 23:24:54 EDT
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 00:24:13 EDT
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 11:09:12 EDT
- 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 17:17:15 EDT
[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 17:25:06 EDT
... 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-08 20:39:20 EDT
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 19:47:49 EDT
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 19:50:08 EDT
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-13 20:01:49 EDT
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 11:00:56 EDT
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 19:19:20 EDT
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 16:31:45 EDT
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 14:50:00 EST
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-26 20:05:33 EST
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 14:52:09 EDT
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 13:51:31 EDT
Closing.  Magicdev has been removed in favor of gnome-volume-manager
in devel branch.
Comment 17 Gunther Mayer 2006-02-20 09:48:02 EST
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.