From owner-svn-src-all@freebsd.org Sat Dec 8 19:38:57 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 F3D461327606; Sat, 8 Dec 2018 19:38:56 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B9968CF39; Sat, 8 Dec 2018 19:38:56 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wB8JHrRX059013; Sat, 8 Dec 2018 11:17:53 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wB8JHrJm059012; Sat, 8 Dec 2018 11:17:53 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201812081917.wB8JHrJm059012@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r341682 - head/sys/sys In-Reply-To: To: Mateusz Guzik Date: Sat, 8 Dec 2018 11:17:53 -0800 (PST) CC: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 2B9968CF39 X-Spamd-Result: default: False [2.04 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.34)[0.341,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_LONG(0.06)[0.062,0]; NEURAL_SPAM_MEDIUM(0.77)[0.768,0]; R_SPF_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-0.02)[country: US(-0.09)] 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: Sat, 08 Dec 2018 19:38:57 -0000 > On 12/7/18, Ian Lepore wrote: > > On Fri, 2018-12-07 at 12:05 +0000, Mateusz Guzik wrote: > >> Author: mjg > >> Date: Fri Dec 7 12:05:11 2018 > >> New Revision: 341682 > >> URL: https://svnweb.freebsd.org/changeset/base/341682 > >> > >> Log: > >> unr64: use locked variant if not __LP64__ > >> > >> The current ifdefs are not sufficient to distinguish 32- and 64- > >> bit > >> variants, which results e.g. in powerpc64 not using atomics. > >> > >> While some 32-bit archs provide 64-bit atomics, there is no huge > >> advantage > >> of using them on these platforms. > >> > [..] > > This seems like a wholly unsatisfying solution compared to how trivial > > it would be to do something like have each arch's atomic.h set a symbol > > to indicate whether 64-bit atomics are available. Dismissing 32-bit > > arches because you don't perceive performance to be important there > > doesn't seem like a valid argument. > > > > But performance *is* improved on 32-bit architectures as well. > > Bitmap handling would try to very hard to reduce memory usage, which > had a lot of single-threaded overhead (e.g. it allocates memory just in > case and then frees it). Since 64-bit inode numbers can simply grow > there is no need for any of it and memory use is 64 bit to store the > variable. And that's what unr64 is doing. > > The main difference here is in scalability - taking a lock, bumping a > variable and releasing the lock scales much worse than an atomic > (which still scales poorly if heavily used). 32-bit arches don't really > have enough concurrency to see a difference with this code. All your high thread Intel and Amd CPU's can still run in 32bit with all those threads active, so you can get high concurrency on 32-bit arches. > > single-threaded this is indeed a little bit slower, but this is not > running in any hot path. > > 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. -- Rod Grimes rgrimes@freebsd.org