From owner-p4-projects@FreeBSD.ORG Wed Sep 12 22:49:58 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3795A16A41A; Wed, 12 Sep 2007 22:49:58 +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 0DB1716A417 for ; Wed, 12 Sep 2007 22:49:58 +0000 (UTC) (envelope-from kip.macy@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.235]) by mx1.freebsd.org (Postfix) with ESMTP id BD06113C467 for ; Wed, 12 Sep 2007 22:49:57 +0000 (UTC) (envelope-from kip.macy@gmail.com) Received: by nz-out-0506.google.com with SMTP id l8so230924nzf for ; Wed, 12 Sep 2007 15:49:57 -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:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=TuLMDVHkf9V6+v5AMdoAho8+5SDpV5CqewypujthJo0=; b=W6+QDSbc+Nmeqx81ZnvIax4VObCpWiQ/6Q+BBlPbCJ09XWts8r69WXnagj8tV7XHwJ6UBl3WsNdjcLoerLu5kX2nz8TCshWpsszx5J7aKSuSoT2oPps2T8/0na6uGlAJMB5jeoIBdeV6m6JfupOT7s1h128a+w+jL7qgxR4J+o4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=tEE46hNUEzZaL6gQ3m7p9z2vgmvVTc3UB7bZcgYsMP79O4nXLJib7Jz+lYDCsBDiwD0YwAU/+7dkleJaKzafzm2a2tyfxvzfjzgZa0N+U6wdu7/ictbom61fdKrq4/hyoUj9hmh1ShF8j9vTdKeZEsLdpnapG3IE+ekxzQrwIzU= Received: by 10.115.78.1 with SMTP id f1mr67321wal.1189637396023; Wed, 12 Sep 2007 15:49:56 -0700 (PDT) Received: by 10.114.13.15 with HTTP; Wed, 12 Sep 2007 15:49:55 -0700 (PDT) Message-ID: Date: Wed, 12 Sep 2007 15:49:55 -0700 From: "Kip Macy" To: "Pawel Jakub Dawidek" In-Reply-To: <20070912223833.GC4909@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200709120832.l8C8WLlm085731@repoman.freebsd.org> <20070912150017.GA3553@garage.freebsd.pl> <3bbf2fe10709121530h6d0681c4xa247fe7d31cb2c2e@mail.gmail.com> <20070912223833.GC4909@garage.freebsd.pl> Cc: Attilio Rao , Perforce Change Reviews , 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:49:58 -0000 Andrew Thompson explicitly asked for the possibility of shared acquisition. -Kip On 9/12/07, Pawel Jakub Dawidek wrote: > On Thu, Sep 13, 2007 at 12:30:26AM +0200, Attilio Rao wrote: > > 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? > > Always write/exclusive. > > -- > Pawel Jakub Dawidek http://www.wheel.pl > pjd@FreeBSD.org http://www.FreeBSD.org > FreeBSD committer Am I Evil? Yes, I Am! > >