From owner-freebsd-geom@freebsd.org Thu May 19 21:31:34 2016 Return-Path: Delivered-To: freebsd-geom@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46C02B41DAD for ; Thu, 19 May 2016 21:31:34 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 3147F1724 for ; Thu, 19 May 2016 21:31:34 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 304DCB41DAB; Thu, 19 May 2016 21:31:34 +0000 (UTC) Delivered-To: geom@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FD37B41DAA; Thu, 19 May 2016 21:31:34 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 A45EB1723; Thu, 19 May 2016 21:31:33 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u4JLVSL7017475 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 20 May 2016 00:31:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u4JLVSL7017475 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u4JLVSbX017474; Fri, 20 May 2016 00:31:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 20 May 2016 00:31:28 +0300 From: Konstantin Belousov To: Alfred Perlstein Cc: geom@freebsd.org, arch@freebsd.org Subject: Re: Removing Giant asserts from geom Message-ID: <20160519213128.GT89104@kib.kiev.ua> References: <20160519105634.GO89104@kib.kiev.ua> <573DEA73.4080408@mu.org> <20160519191247.GQ89104@kib.kiev.ua> <53397f3f-1056-ceb7-ce3a-5269ac1d29e2@mu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53397f3f-1056-ceb7-ce3a-5269ac1d29e2@mu.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 21:31:34 -0000 On Thu, May 19, 2016 at 01:57:53PM -0700, Alfred Perlstein wrote: > OK, and why is thread0 needing Giant for so long? [Below is my opinion] It does not need Giant per se, it needs a work done to audit and turn it off. Probably most high profile subsystem in the kernel still relying on Giant is the newbus. Easy to see consequence is that handling thread0, that spends most of the time in discovering and configuring devices, actually needs to provide proper locking for the newbus. At least one attempt to do the later failed. Troubles are both in the strange recursiveness of newbus, where device method could call into subr_bus.c, and in potential offloading of some work to other thread, which means that naive surround of the subr_bus.c methods with some global sleepable (and even recursive) lock would not work. Since newbus activity and early startup are rare events, fine-grained locking for them would result in, well, fine grained locking. There would be no break-through performance improvements after really hard work, including handling user reports for long time. So, it is not a priority for most people.