From owner-svn-src-head@freebsd.org Tue Dec 11 00:27:10 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 CED95130A262; Tue, 11 Dec 2018 00:27:10 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07A6E76171; Tue, 11 Dec 2018 00:27:10 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lj1-x232.google.com with SMTP id x85-v6so11385498ljb.2; Mon, 10 Dec 2018 16:27:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5RVQvlYek3anWZT3VhVLCbc/NTrPmPCDFQ4/2bWGbqk=; b=YkJRveHKWzX//juenbvzEJgPmCron7Z3i7GV30bV6bTibz98bxzgAC0DEHOe6f4xvD LZCvap7spjbI6VcizNz8ulqclxkkgWXscCZvMPLe7iOW3jkS/iiqsvfWvIiYdW3PcQNH BDuqRmZY3GQdqwQutbslOmKOV5DtjrNMWCSlJkO867VckFOvDe48JaQRRKHt3YRCZvxD j+jMwAsH3F9uIezD4UM73i4t6kB7bm9Yy9xsQgj2boaxUqgu8WBVUhCbEUh6z/UmOQon zQSI3HatvE/YUMjKLpjGGSTSf4tfVqqJOfoiE4XT2TRmXEzPdzchVfsPEpB4+jNxznr9 /ueg== 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=5RVQvlYek3anWZT3VhVLCbc/NTrPmPCDFQ4/2bWGbqk=; b=BtZEG2BSg/nAS9KbuaPQEF50e1fUAKul44gJVUMlf/mZwcb2KvAVratefXa3t8sKax OeH2f90HFOYnUVzD+Nw/J/faBMPacrHthXaWIS8mcB2rJawwpGRuR3lCDtuXNk2fe4Ai US007l84eZCf9QHNZUG+teCscyMtXJ4psSpZr4wliURYi6pJ6zf5exI5vAJDt62ruCN3 KUX3ltxs+Rl4dBn+qSTlcFEnx5RmRZX6uYOUlmVAb9fkIylv9HYSb6drADQg/wbbYNXz XLlQgtiQXoI+SxLb+Pny8FFeVW7uO9vJwy5yXC14ZZ3ivy5LKBum+g8zNoCY8KmcToc7 Csiw== X-Gm-Message-State: AA+aEWZzcyLfXMjDGoG33mOeBoIjvXaDh431TgJfU0VWeZ8sAi7CZhUl 4VkTfPuW/FdtAVo6wT6CqVqZmh0MBXS0nPNxjv0r5Q== X-Google-Smtp-Source: AFSGD/VGq3s1+YoPo7tqOfGtQ1MMdW/XxOsGMLlFc8xUHfSOtIGRPC8SGYwR4kpqBJhaPOlIkOMZp6ZicljZwHeJnEc= X-Received: by 2002:a2e:7d15:: with SMTP id y21-v6mr7161857ljc.77.1544488028244; Mon, 10 Dec 2018 16:27:08 -0800 (PST) MIME-Version: 1.0 References: <201812071205.wB7C5BvA038350@repo.freebsd.org> <1544206201.1860.288.camel@freebsd.org> <45f85061-2633-852c-3cc0-41f64d51e4f0@FreeBSD.org> <1544486233.1860.343.camel@freebsd.org> In-Reply-To: <1544486233.1860.343.camel@freebsd.org> From: Justin Hibbits Date: Mon, 10 Dec 2018 18:26:57 -0600 Message-ID: Subject: Re: svn commit: r341682 - head/sys/sys To: Ian Lepore Cc: John Baldwin , Warner Losh , Kevin Bowling , Mateusz Guzik , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , scottl@freebsd.org X-Rspamd-Queue-Id: 07A6E76171 X-Spamd-Result: default: False [-4.02 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.991,0]; R_DKIM_ALLOW(-0.20)[gmail.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; IP_SCORE(-0.57)[ipnet: 2a00:1450::/32(-1.47), asn: 15169(-1.27), country: US(-0.09)]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCPT_COUNT_SEVEN(0.00)[9]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[2.3.2.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]; NEURAL_HAM_SHORT(-0.46)[-0.455,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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: Tue, 11 Dec 2018 00:27:11 -0000 On Mon, Dec 10, 2018, 17:57 Ian Lepore On Mon, 2018-12-10 at 14:15 -0800, John Baldwin wrote: > > On 12/8/18 7:43 PM, Warner Losh wrote: > > > > > > > > > > > > On Sat, Dec 8, 2018, 8:36 PM Kevin Bowling > > m wrote: > > > > > > On Sat, Dec 8, 2018 at 12:09 AM Mateusz Guzik > > m > 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. > > > > On a single-core system all you need to implement 64-bit atomics in the > kernel is to disable interrupts around using normal load/store > operations on the values. Do we have any platforms that are SMP but > don't have hardware primitives for 64-bit atomics? > > -- Ian > There were some dual processor G4 machines. I have one. It doesn't have 64 bit atomics. - Justin >