From owner-svn-src-projects@FreeBSD.ORG Mon Aug 26 18:27:58 2013 Return-Path: Delivered-To: svn-src-projects@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 233A7DF7; Mon, 26 Aug 2013 18:27:58 +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 E39B82641; Mon, 26 Aug 2013 18:27:57 +0000 (UTC) Received: from jhbbsd.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B1D0EB962; Mon, 26 Aug 2013 14:27:56 -0400 (EDT) From: John Baldwin To: Alexander Motin Subject: Re: svn commit: r254846 - projects/camlock/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Date: Mon, 26 Aug 2013 14:25:34 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p28; KDE/4.5.5; amd64; ; ) References: <201308251121.r7PBLA3v033536@svn.freebsd.org> <521A06A2.7050807@FreeBSD.org> In-Reply-To: <521A06A2.7050807@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201308261425.34743.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 26 Aug 2013 14:27:56 -0400 (EDT) Cc: svn-src-projects@freebsd.org, Adrian Chadd , "src-committers@freebsd.org" X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2013 18:27:58 -0000 On Sunday, August 25, 2013 9:29:06 am Alexander Motin wrote: > On 25.08.2013 15:48, Adrian Chadd wrote: > > Surely there's a better way to check whether a thread can sleep besides > > digging around in curthread->td_no_sleeping ? What about adding an > > accessor macro along side THREAD_SLEEPING_OK and THREAD_NO_SLEEPING ? > > That sounds good to me. I was also surprised such macros are not there > yet when found some code doing these checks just the same way as I did. It was never intended to be public, only as a debugging aid for assertions. :( I had hoped that the calling code would know when it was in an ithread or not and call different routines as needed (i.e. that the programmer would intentionally think about the context they were in). Perhaps this is not realistic? Are you really queueing new I/O from ithreads and/or timers? -- John Baldwin