Re: [ANNOUNCE] udev 016 release

From: Martin Schlemmer
Date: Tue Feb 03 2004 - 23:26:40 EST


On Wed, 2004-02-04 at 01:13, Greg KH wrote:
> On Wed, Feb 04, 2004 at 01:03:33AM +0200, Martin Schlemmer wrote:
> > On Tue, 2004-02-03 at 23:28, Martin Schlemmer wrote:
> > > On Tue, 2004-02-03 at 22:13, Greg KH wrote:
> > >
> > > Except if I miss something major, udevsend and udevd still do not
> > > work:
> > >
> >
> > Skip that, it does work if SEQNUM is set :P
> >
> > Anyhow, is it _really_ needed for SEQNUM to be set? What about
> > the attached patch?
>
> Yes it is necessary, as that is what the kernel spits out. It's also
> the whole reason we need udevd :)
>
> If you don't want to give a SEQNUM, just call udev directly.
>

Ok, was just thinking it could lead to confusion with debug usually not
compiled in. Maybe a more visible error (as we then know it was outside
the kernel)?

> > Then, order I have not really checked yet, but there are two things
> > that bother me:
> >
> > 1) latency is even higher than before (btw Greg, is there going to be
> > more sysfs/whatever fixes to get udev even faster, or is this the
> > limit?)
>
> Care to measure the latency somehow? The first event is a bit slow, but
> everything after that is as fast as I ever remember it being.
>

Hmm, Ok, it seems it is much better on batch jobs (or if udevd is
running) then from clean start, sorry.

> > 2) events gets missing. If you for example use udevsend in the
> > initscript that populate /dev (/udev), the amount of nodes/links
> > created is off with about 10-50 (once about 250) entries.
>
> Hm, that's not good. I'll go test that and see what's happening.
>

Script is attached. If I was being silly here, let me know. Some
quick testing again, it seems like the missing events is more with
the echo not commented, but could be just some fluke (there was
still however more than 5 usually missing).


Thanks,

--
Martin Schlemmer
#!/bin/bash

SEQNUM=0

call_udev() {
export SEQNUM=$((SEQNUM + 1))
#echo "DEVPATH=$DEVPATH, CLASS=$1, SEQNUM=$SEQNUM"
/sbin/udevsend $1
}

populate_udev() {
local x=
local y=
local CLASS=

# Propogate /dev from /sys - we only need this while we do not
# have initramfs and an early user-space with which to do early
# device bring up
export ACTION=add

# Add block devices and their partitions
for x in /sys/block/*
do
# Add each drive
export DEVPATH="${x#/sys}"
call_udev block

# Add each partition, on each device
for y in ${x}/*
do
if [ -f "${y}/dev" ]
then
export DEVPATH="${y#/sys}"
call_udev block
fi
done
done

# All other device classes
for x in /sys/class/*
do
for y in ${x}/*
do
if [ -f "${y}/dev" ]
then
CLASS="$(echo "${x#/sys}" | cut --delimiter='/' --fields=3-)"
export DEVPATH="${y#/sys}"
call_udev ${CLASS}
fi
done
done

unset ACTION DEVPATH

return 0
}

populate_udev

Attachment: signature.asc
Description: This is a digitally signed message part