From owner-p4-projects@FreeBSD.ORG Wed Sep 12 22:30:29 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 609D716A46C; Wed, 12 Sep 2007 22:30:29 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3111A16A469 for ; Wed, 12 Sep 2007 22:30:29 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.188]) by mx1.freebsd.org (Postfix) with ESMTP id B12A413C467 for ; Wed, 12 Sep 2007 22:30:28 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so316543nfb for ; Wed, 12 Sep 2007 15:30:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=htWFh8EiAPD5bD8EGyQmIf/18/nsRdNmqbyUuB6Uhwc=; b=muzhPFO0zjVIo/OskITCahG/hK6vQTHJESDlo/2vOX7RcP2cKAL6TeD1AleKfCE8ivayA/jZXASgp1d1K1ByNdf8ZUN+pBbghJQ1KNKd5F8XUlGfXTq2HN/nysLmTEYW0ixuZ8hCOdDeaRZDvFI0xnTuaJuQuPLU6Rb7oNh8rlg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=FZ8ocjfIpJ55iRuhGxjDgtheH9HiwBdHFwoQC8MWEBiSkzNmcp9rPA8HkR41nasybxJ46qFZEQfzZMn/oelepkhznWF60qvENsQV+qWp2puRvwGdjVryOjcY5ZsME3PC+Mf8rcFLHL2qDbEL6UBUpflGFb/Ou/Ten6W5YGHd+AI= Received: by 10.78.150.7 with SMTP id x7mr25566hud.1189636226887; Wed, 12 Sep 2007 15:30:26 -0700 (PDT) Received: by 10.78.120.9 with HTTP; Wed, 12 Sep 2007 15:30:26 -0700 (PDT) Message-ID: <3bbf2fe10709121530h6d0681c4xa247fe7d31cb2c2e@mail.gmail.com> Date: Thu, 13 Sep 2007 00:30:26 +0200 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Kip Macy" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200709120832.l8C8WLlm085731@repoman.freebsd.org> <20070912150017.GA3553@garage.freebsd.pl> X-Google-Sender-Auth: e7bcc27b38f18b1e Cc: Perforce Change Reviews , Pawel Jakub Dawidek , Kip Macy Subject: Re: PERFORCE change 126330 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2007 22:30:29 -0000 2007/9/12, Kip Macy : > On 9/12/07, Pawel Jakub Dawidek wrote: > > On Wed, Sep 12, 2007 at 08:32:21AM +0000, Kip Macy wrote: > > > http://perforce.freebsd.org/chv.cgi?CH=126330 > > > > > > Change 126330 by kmacy@kmacy_home:ethng on 2007/09/12 08:31:36 > > > > > > convert radix node head and route locks from mutexes to rwlocks > > [...] > > > rt->rt_flags |= RTF_LLINFO; > > > - callout_init_mtx(&la->la_timer, &rt->rt_mtx, > > > - CALLOUT_RETURNUNLOCKED); > > > + callout_init_rwlock(&la->la_timer, &rt->rt_lock, > > > + CALLOUT_RETURNUNLOCKED_RW); > > > > > > > Kip, don't add callout_init_rwlock() to the tree. I've > > callout_init_lock() implemented that operates on any lock type, just > > like condvar(9). > > point me to a diff I'm courious to know another thing instead. As like condvar() works, it is allowed to before release and later acquire the lock. This scheme let you acquire the lock again following the previous pattern for sx and rw locks (if for example you had a rwlock mantained in write mode you will acquire it in the same way). This is not applicable to callout, instead, as you have the lock 'blank', so with double-kind locks (like rw and sx) how do you lock it? Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein