From owner-svn-src-head@freebsd.org Thu Feb 22 07:18:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDCA3F0AB1C; Thu, 22 Feb 2018 07:18:20 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4237071795; Thu, 22 Feb 2018 07:18:20 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f50.google.com with SMTP id t204so5953610lff.9; Wed, 21 Feb 2018 23:18:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=JY9Y1s8IS+fCUUVE7LTFyIKWsueAKn/YRaXaXLsLfhg=; b=g1ZK5nAaMmBHngczyu7gCFTdSWnynzx9d0Ls37195vL4QAHHUkXgQM/ltZallWDmHl cRVfMljq9EtafskBNtwYzqV5JEQFri2wvemzBpe4DS5hx6S8kGotWadug8+vtLTi8SxV eZeNX/2PvfC98XelhFmWdi8oW3bnDgo52pU0gt4ycWv8FYdxYkdkG8/7xzKzEo7WzVcI pMtleL1S29keKxnRxwAKrEZi4vGeW5TP1fSSvOvCDq9tSYR06CV4eSeOP4cyQj1wKh3D T0EyPrlIB1Flrj+8UQvMfjfA29GM/qERDRRUD2w916kSUQR/j7l7mZpRbrT67HxzHZme 0UHg== X-Gm-Message-State: APf1xPA+XnLpgmpMd/FW2J0emf5uY4yNzfKLgBg/RomgOHn7Qu9Q7g6N pWtiBs8ojlToSMuMOuKANWofkc00 X-Google-Smtp-Source: AH8x226CvTEXJFvbW1nISwn3kUV0Fxz/Pt8hal9fT3c8O/pTxO6htTDLm7AwZUCdhP0gsV+y92YStA== X-Received: by 10.25.207.145 with SMTP id f139mr4535737lfg.75.1519283893222; Wed, 21 Feb 2018 23:18:13 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id h71sm2156996ljh.77.2018.02.21.23.18.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 23:18:12 -0800 (PST) Subject: Re: svn commit: r329796 - head/sys/dev/vt To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802220226.w1M2QTR2068451@repo.freebsd.org> From: Andriy Gapon Message-ID: Date: Thu, 22 Feb 2018 09:18:11 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201802220226.w1M2QTR2068451@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 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: Thu, 22 Feb 2018 07:18:21 -0000 On 22/02/2018 04:26, John Baldwin wrote: > Author: jhb > Date: Thu Feb 22 02:26:29 2018 > New Revision: 329796 > URL: https://svnweb.freebsd.org/changeset/base/329796 > > Log: > Avoid grabbing locks when grabbing the vt(4) console for DDB. > > Trying to grab locks during cngrab() when entering the debugger is > deadlock prone as all other CPUs are already halted (and thus unable > to release locks) when cngrab() is invoked. One could instead use > try-locks. However, the case that the try-lock fails still has to > be handled. In addition, if the try-lock works it doesn't provide > any greater ordering guarantees than is already provided by entering > and exiting DDB. It is simpler to define a simpler path for the > case that the try-lock would fail and always use that when entering > DDB. Messing with timers, etc. when entering DDB is dubious even if > the try-lock succeeds. > > This patch attempts to use the smallest possible set of operations to > grab the vt(4) console when entering DDB without using any locks. > > Reviewed by: emaste > Tested by: Matthew Macy > MFC after: 1 week There are some additional, harder problems in that path: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213334 -- Andriy Gapon