Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp917538pxp; Wed, 16 Mar 2022 21:14:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxffAHCLlTHgfJCXgK6d+eAlopgkJLdS3WyBFujkxK9YpJFSrsqQoue4Kqu8TS22ObEwet1 X-Received: by 2002:a17:90a:6441:b0:1c6:8de6:9fc0 with SMTP id y1-20020a17090a644100b001c68de69fc0mr99094pjm.163.1647490482971; Wed, 16 Mar 2022 21:14:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647490482; cv=none; d=google.com; s=arc-20160816; b=COiaOHFlv2o9tz9s9gsbfKPoN/lw+xJVRIN7csPYovVjO0NvS8i8HlXcoDT8TrzZS0 IlUDAPg5D1Jso5nsU+w/7yC9mx+yblFRv5hoMIwPhbCgrx2gHJsSIioNyxLRGkmNIFKl jKV4WP9U/MgHXaErF8XNvRYCOOhJhN38A8pReAqqRkgNLASheTj+GHeJWK778X6CFtkl aUypswUNAz7R1JmckfcJufKzvFQ3f3ariZAnrY57Apq3j6K1a/Wgcd5vjtvuSfBhCOCr pbncayG2CWK00kk7guPYwcJEpfbWEBPHbTUKQuog6iW0GScHw654QuNGB9gPj2YngTNw 74BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:cc:content-transfer-encoding :mime-version:message-id:date:subject:dkim-signature; bh=G2OlpynL+svPG/qBCVApCbgh8fee1f/XrsL4DL/Bf0Q=; b=AcyZOgAs3OTgtadZ2mRdS9gDka4Njjzemy76arWbPF6CxcFG1RCHGGTggDuZARvz13 PMAWFwVhmmdQwBvml8vNod6lGAHLi2xc1r/5Ee4LADKmF8ETxZww/Szjb/vCZuM/x2ks dNSti1hCViH89aBIzxHr4mQae5sQnBYBf5hIZAavQQ7eHX22/rIakGDeLN55/rsSQwkK wyiCsHe0Ka+S1/1/KS2ipVh2LwXs/5rFAOFWuhRnqMRJNo7OsCa9lbrnEj0HWdMQ17S5 yIfmvJTcgAi+p+vg3o8M2aP8/2imo/8xz3N5ZxZMBqJxGJCyX8TgKmnjt1P9WNN0kxt+ wCjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=OtaZ9yqh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i17-20020a17090a7e1100b001bed912d3c4si1099346pjl.174.2022.03.16.21.14.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 21:14:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=OtaZ9yqh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 47695BD889; Wed, 16 Mar 2022 20:52:23 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345420AbiCPX3l (ORCPT + 99 others); Wed, 16 Mar 2022 19:29:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238816AbiCPX3k (ORCPT ); Wed, 16 Mar 2022 19:29:40 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2A09167C0 for ; Wed, 16 Mar 2022 16:28:24 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id mz9-20020a17090b378900b001c657559290so3691975pjb.2 for ; Wed, 16 Mar 2022 16:28:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=subject:date:message-id:mime-version:content-transfer-encoding:cc :from:to; bh=G2OlpynL+svPG/qBCVApCbgh8fee1f/XrsL4DL/Bf0Q=; b=OtaZ9yqhWB4tye3HNb/4HSG53Ngt9PyiVKbt4tKiDRePwVvwEya9svqm2s5w3VOs8/ yc5YXBiYJ5lI37j7IwRDhHc86YnavSlVsh0QAtvZb4djSLS4+IhqRPG1UroOa6lAYHr2 MmdFeBcb5MqiiXN9c0cZAnTi3wMI/B1Z3iSzCUEZVZYrwPOrXxRi/ycPnKNM2hdrjT1d ie9NE6P8P/kdLZ/hzrBMaChScpMTxQMof4mqs0RbevtIK7WFu960AcDmPUpRF2qSwADe J1d0UjMM8OCE0iWgumuCsMKONO032+3frQbABHiQ0inzP7hO/d2ZcCst7FmOhhFQK3zm GXRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:date:message-id:mime-version :content-transfer-encoding:cc:from:to; bh=G2OlpynL+svPG/qBCVApCbgh8fee1f/XrsL4DL/Bf0Q=; b=k/xubJKzMUG0wgKSFbkgf6HY6H0XZCYjkjw7sdq29ekhinSk6vjPLc0ql4uOXy2mbq TiNdzsuEjgcZwdVFrUFngOBUZWdZGwfkoVg9x8zt2PjLF3o+YVwIrCt0jrJFajXcpDpE S0NOD8q3JHvitHpkkwQXL1U+53w4SaVjSmasdfBLqqvVZFBziDsedCr5PPu1qIJ6ZZTt Lkh4KfqHLujf1XREgna+jqaxdb9x/l05R8/D0qC+/0WtuQrWydhZgjtj59NEuc4Mf2Ll 67H38YdwctQ0Gc+t0AdTtTERsnKU5pUTnsbg0r8XL0m63/LCsddkeRoI19/AArDkhrjR bsew== X-Gm-Message-State: AOAM5304hU6kRLoYWbBwlj1CCqfElZx2RXR5GCuAe5U6ZlsVMjrNzeIY qy3buwNGt769aRukpFnvw88oZw== X-Received: by 2002:a17:90a:4306:b0:1b9:80b3:7a3d with SMTP id q6-20020a17090a430600b001b980b37a3dmr12666080pjg.66.1647473304308; Wed, 16 Mar 2022 16:28:24 -0700 (PDT) Received: from localhost ([12.3.194.138]) by smtp.gmail.com with ESMTPSA id i187-20020a626dc4000000b004f6e0f346e7sm4189585pfc.39.2022.03.16.16.28.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 16:28:23 -0700 (PDT) Subject: [PATCH 0/5] Generic Ticket Spinlocks Date: Wed, 16 Mar 2022 16:25:55 -0700 Message-Id: <20220316232600.20419-1-palmer@rivosinc.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: jonas@southpole.se, stefan.kristiansson@saunalahti.fi, shorne@gmail.com, mingo@redhat.com, Will Deacon , longman@redhat.com, boqun.feng@gmail.com, Paul Walmsley , Palmer Dabbelt , aou@eecs.berkeley.edu, Arnd Bergmann , jszhang@kernel.org, wangkefeng.wang@huawei.com, openrisc@lists.librecores.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arch@vger.kernel.org From: Palmer Dabbelt To: linux-riscv@lists.infradead.org, peterz@infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Peter sent an RFC out about a year ago , but after a spirited discussion it looks like we lost track of things. IIRC there was broad consensus on this being the way to go, but there was a lot of discussion so I wasn't sure. Given that it's been a year, I figured it'd be best to just send this out again formatted a bit more explicitly as a patch. This has had almost no testing (just a build test on RISC-V defconfig), but I wanted to send it out largely as-is because I didn't have a SOB from Peter on the code. I had sent around something sort of similar in spirit, but this looks completely re-written. Just to play it safe I wanted to send out almost exactly as it was posted. I'd probably rename this tspinlock and tspinlock_types, as the mis-match kind of makes my eyes go funny, but I don't really care that much. I'll also go through the other ports and see if there's any more candidates, I seem to remember there having been more than just OpenRISC but it's been a while. I'm in no big rush for this and given the complex HW dependencies I think it's best to target it for 5.19, that'd give us a full merge window for folks to test/benchmark it on their systems to make sure it's OK. RISC-V has a forward progress guarantee so we should be safe, but these can always trip things up.