From owner-svn-src-head@FreeBSD.ORG Fri Aug 23 18:55:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 30AAA508; Fri, 23 Aug 2013 18:55:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F2FE42BD0; Fri, 23 Aug 2013 18:55:11 +0000 (UTC) Received: from jhbbsd.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 57E75B98A; Fri, 23 Aug 2013 14:55:10 -0400 (EDT) From: John Baldwin To: Davide Italiano Subject: Re: svn commit: r254703 - in head: share/man/man9 sys/sys Date: Fri, 23 Aug 2013 12:58:50 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p28; KDE/4.5.5; amd64; ; ) References: <201308231412.r7NECdG7081565@svn.freebsd.org> <201308231051.08997.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201308231258.50969.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 23 Aug 2013 14:55:10 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2013 18:55:12 -0000 On Friday, August 23, 2013 11:29:45 am Davide Italiano wrote: > On Fri, Aug 23, 2013 at 4:51 PM, John Baldwin wrote: > > On Friday, August 23, 2013 10:12:39 am Davide Italiano wrote: > >> Author: davide > >> Date: Fri Aug 23 14:12:39 2013 > >> New Revision: 254703 > >> URL: http://svnweb.freebsd.org/changeset/base/254703 > >> > >> Log: > >> Introduce callout_init_rm() so that callouts can be used in conjunction > >> with rmlocks. This works only with non-sleepable rm because handlers run > >> in SWI context. While here, document the new KPI in the timeout(9) > >> manpage. > > > > It also only works with exclusive locks. (lc_unlock/lc_lock only handle > > write locks for rmlocks). > > > > -- > > John Baldwin > > Thanks for pointing out this. > I think it would be nice to have lc_lock/lc_unlock working both for > shared and exclusive locks but I'm not 100% sure about all the > implications/complications. From what I see for rwlocks asserting if a > lock is held in read-mode is really cheap (check against a flag) while > for rmlocks the assertion relies on traversing the tracker list for > the rmlock so I'm worried this operation could be expensive. What's > your opinion about? The much bigger problem is you need an rmtracker object to pass to the lock/unlock routines. You could make this work hackishly in the callout case by special casing rm locks that use read locking and using a tracker on softclock's stack, but it is much harder to fix this for the rm_sleep() case where the sequence is lc_unlock/lc_lock. -- John Baldwin