From owner-freebsd-current@FreeBSD.ORG Wed Jul 14 18:36:03 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5364116A4CE; Wed, 14 Jul 2004 18:36:03 +0000 (GMT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id A308B43D5A; Wed, 14 Jul 2004 18:36:02 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.11/8.12.11) with ESMTP id i6EIa15q012612; Wed, 14 Jul 2004 20:36:01 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Gleb Smirnoff From: "Poul-Henning Kamp" In-Reply-To: Your message of "Wed, 14 Jul 2004 19:42:54 +0400." <20040714154254.GB9999@cell.sick.ru> Date: Wed, 14 Jul 2004 20:36:01 +0200 Message-ID: <12611.1089830161@critter.freebsd.dk> Sender: phk@critter.freebsd.dk cc: Robert Watson cc: current@freebsd.org Subject: Re: Some netgraph node global locking patches X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jul 2004 18:36:03 -0000 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.