From owner-svn-src-all@freebsd.org Mon May 16 17:28:46 2016 Return-Path: Delivered-To: svn-src-all@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 33483B3C837; Mon, 16 May 2016 17:28:46 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE72211E5; Mon, 16 May 2016 17:28:45 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 1320C1FE024; Mon, 16 May 2016 19:28:43 +0200 (CEST) Subject: Re: svn commit: r299933 - in head/sys: compat/linuxkpi/common/include/linux sys To: "Ngie Cooper (yaneurabeya)" References: <201605160956.u4G9umAT025380@repo.freebsd.org> <222500EB-85C1-4FF7-ADB9-0BD71F55D835@gmail.com> <308052a8-f574-5725-f6d7-e395956ca78a@selasky.org> <4049F31C-6F86-4284-B3A5-8A4640671E43@gmail.com> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: Date: Mon, 16 May 2016 19:32:02 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <4049F31C-6F86-4284-B3A5-8A4640671E43@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 17:28:46 -0000 On 05/16/16 18:51, Ngie Cooper (yaneurabeya) wrote: > >> On May 16, 2016, at 09:47, Hans Petter Selasky wrote: >> >> On 05/16/16 18:31, Ngie Cooper (yaneurabeya) wrote: >>> Dumb question — couldn’t we run the check without locking Giant, then delete the child, e.g. >>> >>> if (bsddev != NULL) { >>> mtx_lock(&Giant); >>> device_delete_child(device_get_parent(bsddev), bsddev); >>> mtx_unlock(&Giant); >>> } >>> put_device(dev); >> >> I guess so. Does it make a difference for you? > > First off, how often does the bsddev == NULL case occur? > > If it doesn’t occur often, doing this increases contention on Giant unnecessarily… In general this piece of code is called very rarely. I'll look into it. --HPS