From owner-freebsd-current@FreeBSD.ORG Wed Dec 3 16:47:40 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BBB4F867; Wed, 3 Dec 2014 16:47:40 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94165A59; Wed, 3 Dec 2014 16:47:40 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B001BB989; Wed, 3 Dec 2014 11:47:38 -0500 (EST) From: John Baldwin To: freebsd-current@freebsd.org Subject: Re: witness and modules. Date: Wed, 03 Dec 2014 10:21:01 -0500 Message-ID: <1758681.vj4zSF7cnf@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <547F15D0.8050009@freebsd.org> References: <54788FF3.3030602@freebsd.org> <547EF378.8090202@FreeBSD.org> <547F15D0.8050009@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 03 Dec 2014 11:47:38 -0500 (EST) Cc: freebsd-current@freebsd.org, Warner Losh , Andriy Gapon X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-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, 03 Dec 2014 16:47:40 -0000 On Wednesday, December 03, 2014 09:53:20 PM Julian Elischer wrote: > On 12/3/14, 7:26 PM, Andriy Gapon wrote: > > On 03/12/2014 04:33, Julian Elischer wrote: > >> On 12/3/14, 12:24 AM, Warner Losh wrote: > >>>> On Dec 1, 2014, at 10:08 PM, Julian Elischer > >>>> wrote: > >>>>=20 > >>>> On 12/1/14, 11:39 PM, John Baldwin wrote: > >>>>> On Friday, November 28, 2014 11:08:35 PM Julian Elischer wrote:= > >>>>>> Do we need to compile all modules with witness definitions whe= n > >>>>>> linking with a kernel compiled with witness? > >>>>>> This was true at one stage but I remember some work was done t= o make > >>>>>> them compatible. > >>>>>=20 > >>>>> You should not need this. modules always call functions in the= kernel > >>>>> for > >>>>> lock operations and this functions are what invoke WITNESS. > >>>>=20 > >>>> that's what I thought but empirical evidence disagrees. > >>>> I'll try some more cases. > >>>=20 > >>> I swap back and forth all the time between the two. Kernel module= s don=E2=80=99t > >>> change when you compile them with WITNESS or without. > >>=20 > >> not entirely.. > >> hwpmc.ko: U witness_restore > >> hwpmc.ko: U witness_save > >> zfs.ko: U witness_restore > >> zfs.ko: U witness_save > >=20 > > Seems like the problem affects modules that use DROP_GIANT / PICKUP= _GIANT. >=20 > that's a good observation. I'll take a look a that later. Yes, that isn't really intended to be used publically. The pmc one is stale as system calls haven't run with Giant in several=20= releases. All the ones for g_topology_lock() also seem to be broken-by-designed. = There=20 is no good reason I can think of for g_topology_lock() to assert that G= iant=20 isn't held. I suspect phk@ just wanted to force geom to be locked with= out=20 Giant, but I'm not sure that is the best way to achieve that? Poul, is= that=20 correct? If you fix that you can remove almost all of the DROP_GIANT/PICKUP_GIAN= T in=20 the tree. They should really only be in the _sleep() and cv_wait_*()=20= functions where they are used to give Giant its "special" property of b= eing=20 dropped while asleep. --=20 John Baldwin