From owner-freebsd-arch@freebsd.org Tue Nov 26 22:23:31 2019 Return-Path: Delivered-To: freebsd-arch@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B7C301C33C8 for ; Tue, 26 Nov 2019 22:23:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Mz2B2P00z4LPN for ; Tue, 26 Nov 2019 22:23:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x733.google.com with SMTP id d124so2494457qke.6 for ; Tue, 26 Nov 2019 14:23:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rVLp8H4NkedzAvOvmbabxC56TcL2/Da1csYsD3xU9MI=; b=GQ5OsaSNPykZL3qwR0I15tYumiQQWrtE3MBJJFb2xS43qFCzHmYjNNaPqvYEoiozwN C9RypRpCJ4S4Aork9op6YOqzVCrIgJtfVwh0GB97sGSVgsYewYD2JZS44G1xi1/Dn3p7 ksoN+czH24HxjX1LFNgz2GqqSXX5ZlJXwLjU+3KfwJ4UH6XLqBr/wu3OUVAlxCsKSp+H W9GoXRIYrO16aOMqgqWmUfSD86icLhAvmk5wHoOcV62dYEvGjQZ+gbFYuQwZGd9yaBzN rfJuYm6jZbMA12dw6RQjr2+Z8DKMn4O8bzi+2594GUqM7VoDXmKxv5cM03F5zLtHrBwk 7iXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rVLp8H4NkedzAvOvmbabxC56TcL2/Da1csYsD3xU9MI=; b=CEemsSBzWbbc8Rn0aKbsFfCbhfxNQTlinelNqLf5nR9JmuDZC1zCkdkbqIA7pvaK60 2Vh/Bfexz88vWOx1wZqGJr+FIjdN54T56iANiwkvKDF0HrF+akQleXGU7WxPz5ilBtOU WSaP0fJ7Y/hbB1QndWcjZ5WY21ZSj9XFwuNtSJ5sC1CrILk9dQKH796yWBSzIhNwN6ba 6L52tiFMjQv4G3S7fcBThktbQUGpTPgDiGr9qYCs1IteZXfwkPKskS7/JpzBn1AfdDbZ ZWW8hTqxqRcrzC4BMzTk1+prdQslVDtp4Qvdx712sP6ek077Lhf/6l98aPRen9Pm+lXS pIVA== X-Gm-Message-State: APjAAAVkT8l17sOkDkl1ZyNST3l+ycYzITwOlxlFCjVtleQ1qsD1NQme /sOuIFLpnrZ/DusC5W0B1/sU03oSmhdOq21AET2RlA== X-Google-Smtp-Source: APXvYqyy1eWMmTpvupZo42M5WwjIC+iOponsvDLg8SBv4tLT6Ma9wbIpmNfS+CbY0aG2pdtVRXXNaVKykJ9J8mwg4tE= X-Received: by 2002:a05:620a:144:: with SMTP id e4mr859050qkn.240.1574807008581; Tue, 26 Nov 2019 14:23:28 -0800 (PST) MIME-Version: 1.0 References: <201911260917.xAQ9Hcf1001914@gndrsh.dnsmgr.net> <20191126193555.047a63cf@bsd64.grem.de> <20191126194750.3ff939c3@ernst.home> In-Reply-To: <20191126194750.3ff939c3@ernst.home> From: Warner Losh Date: Tue, 26 Nov 2019 15:23:17 -0700 Message-ID: Subject: Re: Killing Giant for 13 To: Gary Jennejohn Cc: Michael Gmelin , "Rodney W. Grimes" , "freebsd-arch@freebsd.org" X-Rspamd-Queue-Id: 47Mz2B2P00z4LPN X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=GQ5OsaSN; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::733) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-4.70 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arch@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[3.3.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.70)[ip: (-9.25), ipnet: 2607:f8b0::/32(-2.27), asn: 15169(-1.95), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Nov 2019 22:23:31 -0000 On Tue, Nov 26, 2019 at 11:47 AM Gary Jennejohn wrote: > On Tue, 26 Nov 2019 19:35:55 +0100 > Michael Gmelin wrote: > > > On Tue, 26 Nov 2019 11:21:20 -0700 > > Warner Losh wrote: > > > > > > > However, the hpt27xx driver turns out not to be Giant locked on > > > versions of FreeBSD >= 10. So it's off the list. > > > > Is that a real list that could be made publicly available, so users can > > check if any of the hardware they use will be affected? > > > > cd /usr/src/sys > grep -Rl D_NEEDGIANT (assuming the user has the right permissions) > > Drivers which use GIANT have this somewhere in their code. > > I found 30 C file hits in HEAD. > Yea, about 25 drivers, 5 of which look to be trivial to change over, some already have. It used to be the case that all dev_t's in the tree were marked NEEDGIANT because they did things like check permissions or other such things that required Giant and this was easier than narrowing it down to just the little bit of code that needed it... And then there's all the interrupt handlers that aren't marked MPSAFE... how to grep for that? I think I may invent a NEEDS_GIANT sort of thing in preference to MPSAFE. And then there's sysctl proc handlers not marked safe. Same notion as the interrupt handlers. And finally all the direct use of the Giant lock, most of which I'll replace by a bus_lock()/bus_unlock() API, or are for the kbd / console mess (which I'll likely replace with another wrapper), and then the odd driver that needs Giant for some reason (I think there's 2 or 3 of these). That's the audit I wanted to get done before posting next steps. Warner