Some netgraph node global locking patches
Poul-Henning Kamp
phk at phk.freebsd.dk
Wed Jul 14 11:36:03 PDT 2004
In message <20040714154254.GB9999 at cell.sick.ru>, Gleb Smirnoff writes:
>Yes it does. But qsort() already used in ng_ppp is as much recursive as
>qsort_r() is. It will help us to get rid of global variable.
>I Cc phk@ to this mail, because he copied qsort() to libkern from libc.
It was put there to get rid of a couple of badly implemented bubble
sorts.
It is true that qsort() is recursive, but it is limited to log2(N)
levels and kernel programmers hopefully don't routinely sort arrays
of hundreds of things in the kernel.
>R> > One question: are any locks held when linesw callbacks (ngt_open,
>R> > ngt_close, etc..) are called?
Not yet, and the exact semantics are not defined yet.
My current guess is that they will be called with a reference count
on struct tty but no lock held.
First I need to get over the cleanup so that I don't have so
many entrance points into the tty code to lock in the first place.
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
More information about the freebsd-current
mailing list