Re: Some netgraph node global locking patches

From: Poul-Henning Kamp <phk_at_phk.freebsd.dk>
Date: Wed, 14 Jul 2004 20:36:01 +0200
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_at_ 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.
Received on Wed Jul 14 2004 - 16:36:03 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:01 UTC