From owner-freebsd-arch@freebsd.org Wed Nov 27 07:26:20 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 953E81CC766 for ; Wed, 27 Nov 2019 07:26:20 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (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 47NC4W2JZ0z3H9C for ; Wed, 27 Nov 2019 07:26:19 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wr1-x443.google.com with SMTP id w9so25437418wrr.0 for ; Tue, 26 Nov 2019 23:26:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=Ktx7ziqwZN7ekB3EKln+uuCTTZOPXJ+TPgweq0HxQ3Y=; b=GlODc1u7HyGN6e1Gf6poaXGqK3Ltg8ieONHcWqcwbqKRzo1BzWp8l/YUd6UCeZY5bC VyACJjBjtkJcIczlptm3GCQvT6EDMILorgz4Xpj2nF/wSfW30JI427sgsk13E73xTA6R PKCENCMgBT/huPHUR97Xki1vDEu7ag8kD+oSREXd+DDqw3pKNlhLpYMyimHnUX7vH/H1 ErOuzmFZi3Ed5WftHy+nz1rewGWLtDhlR0LESo9xzSBSr2YvbFgeI5SN5DUNXDp27wyF z56yPSBDEX4DTgNZbB+SY4PGU+fwYAwcrZPZo12Z60Oj/ixitOP38vrCVueu0qUj/k7A GZ6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=Ktx7ziqwZN7ekB3EKln+uuCTTZOPXJ+TPgweq0HxQ3Y=; b=mciig+/LqwInXDj7D2eEcIzkLTvrPSiNCzsmJd2z68P2ehDwbL41oqnVMSpbtXq2TH 9fIoVU2zdwzcoVbQFUjir2613rHF8nwXsd2H4dJQeDDIBIx3CuNLAJFWz1sNcskG6Zmf nJMjH8MJrIDLVbBMxIWuO7C11zyAxXGQ/NWc8A7Wegux/OuENQbtwvuri2bVuXaVJ+19 jYqJHdsO5oTul6zAFXMNEi7fv7UwJtK4VGcKlVkU2nEd1XifGdEnZkOnWmbdV2OPW+4b uG7vm9LPzEkcWP4j0fC78rQ0/rf1JyDWa1fWVFq9a0H2C6km/41X1RZuP5vplD3Vhcbm PRzw== X-Gm-Message-State: APjAAAWFx4/FiYxO+CoKKsFbB44KhtMx0Z4IFI4ag8dzaMfAazZHoRS3 xIozYo4mkFseT6qUG1Gbvoo= X-Google-Smtp-Source: APXvYqzArRsJPu2b3GxWvmIN0Lgq3Ur7s1QChYUHht3LrGEywJqn0uZZ8yZjfTPgSq8Ayliy29T50A== X-Received: by 2002:adf:f88c:: with SMTP id u12mr22434666wrp.323.1574839577760; Tue, 26 Nov 2019 23:26:17 -0800 (PST) Received: from ernst.home (pD9E23646.dip0.t-ipconnect.de. [217.226.54.70]) by smtp.gmail.com with ESMTPSA id e16sm17995465wrj.80.2019.11.26.23.26.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2019 23:26:16 -0800 (PST) From: Gary Jennejohn To: Warner Losh Cc: Michael Gmelin , "Rodney W. Grimes" , "freebsd-arch@freebsd.org" Subject: Re: Killing Giant for 13 Message-ID: <20191127082615.7c59857c@ernst.home> In-Reply-To: References: <201911260917.xAQ9Hcf1001914@gndrsh.dnsmgr.net> <20191126193555.047a63cf@bsd64.grem.de> <20191126194750.3ff939c3@ernst.home> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47NC4W2JZ0z3H9C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=GlODc1u7; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of gljennjohn@gmail.com designates 2a00:1450:4864:20::443 as permitted sender) smtp.mailfrom=gljennjohn@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[gljennjohn@gmail.com]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; IP_SCORE(0.00)[ip: (2.50), ipnet: 2a00:1450::/32(-2.69), asn: 15169(-1.95), country: US(-0.05)]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RECEIVED_SPAMHAUS_PBL(0.00)[70.54.226.217.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arch@freebsd.org]; FREEMAIL_REPLYTO(0.00)[gmail.com]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[3.4.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] X-Mailman-Approved-At: Wed, 29 Jan 2020 20:44:38 +0000 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: , Date: Wed, 27 Nov 2019 07:26:20 -0000 X-Original-Date: Wed, 27 Nov 2019 08:26:15 +0100 X-List-Received-Date: Wed, 27 Nov 2019 07:26:20 -0000 On Tue, 26 Nov 2019 15:23:17 -0700 Warner Losh wrote: > 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). > I could maybe use something like bus_lock()/bus_unlock() in the rtsx driver because the OpenBSD code stil uses splxxx()s and I'm not sure how to replace them. > That's the audit I wanted to get done before posting next steps. > -- Gary Jennejohn