# [Solved] Udev using extra CPU

## ruivilela

I have updated my system with stable udev 146-r1. And I noticed some CPU usage (always 6-10%, constantly). Which didn't happen before. I'm running fluxbox.

This are the top processes.

```

 3629 root      18  -2  2212  920  436 S    5  0.0   0:03.53 udevd              

   505 root      15  -5     0    0    0 R    1  0.0   0:00.25 scsi_eh_1          

 2724 haldaemo  20   0  5464 3512 2848 S    0  0.1   0:00.44 hald               

 3194 root      20   0 53896  37m 7612 S    0  1.3   0:05.93 X                  

      1 root      20   0  1680  576  512 S    0  0.0   0:00.40 init               

```

Udev is always doing something. After searching a while. I found that other people have this problem http://bugs.archlinux.org/task/16001

So i ran "udevadm monitor --property" and I get over and over again the same output from changes on CDR (which has no CD)

```

KERNEL[1258583687.141801] change   /devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0 (block)

UDEV_LOG=3

ACTION=change

DEVPATH=/devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0

SUBSYSTEM=block

DEVTYPE=disk

SEQNUM=73943

MAJOR=11

MINOR=0

UDEV  [1258583687.144037] change   /devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0 (scsi)

UDEV_LOG=3

ACTION=change

DEVPATH=/devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0

SUBSYSTEM=scsi

SDEV_MEDIA_CHANGE=1

DEVTYPE=scsi_device

DRIVER=sr

MODALIAS=scsi:t-0x05

SEQNUM=73942

UDEV  [1258583687.165289] change   /devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0 (block)

UDEV_LOG=3

ACTION=change

DEVPATH=/devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0

SUBSYSTEM=block

DEVTYPE=disk

SEQNUM=73943

ID_CDROM=1

ID_CDROM_CD_R=1

ID_CDROM_CD_RW=1

ID_CDROM_DVD=1

ID_CDROM_DVD_R=1

ID_CDROM_DVD_RAM=1

ID_CDROM_MRW=1

ID_CDROM_MRW_W=1

ID_VENDOR=Optiarc

ID_VENDOR_ENC=Optiarc\x20

ID_MODEL=DVD_RW_AD-7560S

ID_MODEL_ENC=DVD\x20RW\x20AD-7560S\x20

ID_REVISION=S801

ID_TYPE=cd

ID_BUS=scsi

ID_PATH=pci-0000:00:1f.2-scsi-1:0:0:0

GENERATED=1

DEVNAME=/dev/sr0

MAJOR=11

MINOR=0

DEVLINKS=/dev/block/11:0 /dev/scd0 /dev/disk/by-path/pci-0000:00:1f.2-scsi-1:0:0:0 /dev/cdrom /dev/cdrw /dev/dvd /dev/dvdrw

```

Post edit. 

I decided to mask udev-1.46. And use the previous 1.41. Back to 0-1% of usage of CPU, (less 9 Deg. of temp.)

Even with udev 1.41 i get constant notiication of CD state (but not spammed):

```

KERNEL[1258622589.013475] change   /devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0 (scsi)

KERNEL[1258622589.014749] change   /devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0 (block)

UDEV  [1258622589.014773] change   /devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0 (scsi)

UDEV  [1258622589.065234] change   /devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0 (block)

```

Last edited by ruivilela on Wed Jan 20, 2010 3:29 pm; edited 1 time in total

----------

## mikegpitt

I'm also having this issue... were you able to sort anything out about the CDROM properties repeating?

----------

## mikegpitt

I found a workaround for this issue until a proper fix is released.  Downgrading udev or upgrading to an unstable udev doesn't sit well with me...

As you mentioned above, if you run `udevadm monitor` you can see which device is having events spammed.  In my case it was /dev/sr0.

It is possible to disable hal polling of this device, which is the source of the problems:

```
hal-disable-polling --device /dev/sr0

Polling for drive /dev/sr0 have been disabled. The fdi file written was

  /etc/hal/fdi/information/media-check-disable-storage_model_DVD_RW_AD_7560S.fdi

```

I'm assuming after a fix is released,  to reverse this change it will be as simple as deleting /etc/hal/fdi/information/media-check-disable-storage_model_DVD_RW_AD_7560S.fdi.

I got this advice from here:

http://bugzilla.kernel.org/show_bug.cgi?id=13783#c8

I'm surprised that this issue isn't being talked about more on the gentoo forums... google has hits from many different distros and users experiencing this problem.

----------

## Anon-E-moose

I'm not having a problem with /dev/sr0 and udev constantly pinging it.

I do have an entry for it in fstab, not commented out.

I'm using xfce instead of gnome or kde

I've had "udevadm monitor" running while typing this out and absolutely no activity on it.

(((shrugs)))

----------

## mikegpitt

 *Anon-E-moose wrote:*   

> I'm not having a problem with /dev/sr0 and udev constantly pinging it.
> 
> I do have an entry for it in fstab, not commented out.
> 
> I'm using xfce instead of gnome or kde
> ...

 I don't think it's something that affects 100% of Linux users, but a decent number for sure.  Based on your sig, it looks like you are running a bunch of "unstable" packages, so it could be that one of your upgrades has fixed the issue -- or the issue could only be related to x86 or not affect amd64.

----------

## ruivilela

 *mikegpitt wrote:*   

> I'm also having this issue... were you able to sort anything out about the CDROM properties repeating?

 

I didn't saw more since i downgraded udev.

For what I read before, the problem is related with the way udev handles this specific hardware (cdrom). And it is not mounted or being used at all.

----------

## ruivilela

Still using the 141 udev. And the udev is constantly reporting this messages, each second (but not as spammed as in 146):

```

KERNEL[1263980635.011899] change   /devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0 (scsi)

KERNEL[1263980635.012613] change   /devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0 (block)

UDEV  [1263980635.013044] change   /devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0 (scsi)

UDEV  [1263980635.084598] change   /devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0 (block)

```

----------

## VoidMage

You could try a more recent udev.

But there's a different idea: try disabling CONFIG_IDE (with all of the suboptions), if it's enabled.

----------

## ruivilela

I don't have CONFIG_IDE enabled. udev-149 asks for a previous kernel as dep (?)

----------

## mikegpitt

 *ruivilela wrote:*   

> Still using the 141 udev. And the udev is constantly reporting this messages, each second (but not as spammed as in 146):
> 
> ```
> 
> KERNEL[1263980635.011899] change   /devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0 (scsi)
> ...

 I would recommend trying the workaround I wrote a few posts above:

https://forums.gentoo.org/viewtopic-p-6091540.html#6091540

Since I've done this I've completely forgotten about the problem... although I'd still like a better fix.

----------

## ruivilela

 *mikegpitt wrote:*   

> 
> 
> I would recommend trying the workaround I wrote a few posts above:
> 
> https://forums.gentoo.org/viewtopic-p-6091540.html#6091540
> ...

 

That solved the problem. Thanks!

----------

