Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Jul 2004 20:36:01 +0200
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Gleb Smirnoff <glebius@freebsd.org>
Cc:        current@freebsd.org
Subject:   Re: Some netgraph node global locking patches 
Message-ID:  <12611.1089830161@critter.freebsd.dk>
In-Reply-To: Your message of "Wed, 14 Jul 2004 19:42:54 %2B0400." <20040714154254.GB9999@cell.sick.ru> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20040714154254.GB9999@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@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?12611.1089830161>