From owner-svn-src-all@freebsd.org Mon Dec 10 22:15:23 2018 Return-Path: Delivered-To: svn-src-all@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 6672A13352DE; Mon, 10 Dec 2018 22:15:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::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 E1A0471625; Mon, 10 Dec 2018 22:15:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 1B2CC10B754; Mon, 10 Dec 2018 17:15:21 -0500 (EST) Subject: Re: svn commit: r341682 - head/sys/sys To: Warner Losh , Kevin Bowling References: <201812071205.wB7C5BvA038350@repo.freebsd.org> <1544206201.1860.288.camel@freebsd.org> Cc: Mateusz Guzik , Ian Lepore , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , scottl@freebsd.org From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= xsDiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqk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yTUPyQ1VvNy/mYrBcYlzHodsaqUDjH uW/CSQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZN wwCfafMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <45f85061-2633-852c-3cc0-41f64d51e4f0@FreeBSD.org> Date: Mon, 10 Dec 2018 14:15:20 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 10 Dec 2018 17:15:21 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-Rspamd-Queue-Id: E1A0471625 X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 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, 10 Dec 2018 22:15:23 -0000 On 12/8/18 7:43 PM, Warner Losh wrote: > > > On Sat, Dec 8, 2018, 8:36 PM Kevin Bowling wrote: > > On Sat, Dec 8, 2018 at 12:09 AM Mateusz Guzik > wrote: > > > > > Fully satisfying solution would be that all architectures get 64-bit > > ops, even if in the worst case they end up taking a lock. Then > > subsystems would not have to ifdef on anything. However, there > > was some opposition to this proposal and I don't think this is > > important enough to push. > > Mateusz, > > Who is opposing this particular polyfill solution?  Scott Long brought > up a situation in driver development where this would be useful as > well.  The polyfills lower the cognitive load and #ifdef soup which > are the right call here regardless of performance on toy ports. > > > I don't recall seeing the opposition either. It would have to be a global lock for all 64bit atomics.... but I think it would only be 2 atomics on those architectures. It would have to be a spin lock, so in the case of unrl you would be trading an operation on one of N regular mutexes for a single spin lock that was also contested by other things. This would be pretty crappy. For drivers that aren't actually used on platforms without 32-bit atomics we can simply not build them in sys/modules/Makefile or not put them in GENERIC. For something in the core kernel like unrl I think we will have to do what Mateusz has done here. -- John Baldwin