Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2306393pxp; Mon, 21 Mar 2022 16:28:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxh4DrN+BT4oB1wIvl9EwOiAzZqUiwZ5BGgFzBqd4pDP89TD3WTpwsCaTRN0BAXQ7PJ0reD X-Received: by 2002:a17:90b:224b:b0:1c6:f027:90b1 with SMTP id hk11-20020a17090b224b00b001c6f02790b1mr1600618pjb.173.1647905285119; Mon, 21 Mar 2022 16:28:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647905285; cv=none; d=google.com; s=arc-20160816; b=UCxDEHH4ZWCgFKcuPsit6C12ZnYgS1JxDHX+42Oi/DwQOs1DoWdaTUvcxlxVPnwc8V GOYSIMUTYluk3b/T1WDq4yXeUzJlv6wZ8vRN7tVqWYwHJoqumVnbU4biSBT2DZleFb4/ 85CwjHRDuaIIHU35x1WmXnJL9yIWjygaslYMKf79KzwwiP9PdVEG/ldmRL+i9wQA08p+ I9+EucI6lc49hntge36C0RnQI7pzyDXV+dtd9iozKWXWl+qpqHJNzoNBqiz5K95LeDso jHUNImBt3Z17Tq6brPOQdJc9M6sMVPnl5JLgRB7D5NVwILLYi7y/eBJjESJC563ckrzu 7Wrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=hETrw7jVLJbFtEpHbTLqiRe5deCS+Y/SuER7JPiVvG8=; b=0JHA/DLdJ/ym2Y+LRqDz8K6ObAZl2Ilguv4oTT5keEYLvsNH3KHck48bor3jD7JVKA b9PSg0JBIsWshHSaz8jqT58AAkCuj8bn8BuWjsUgPTLAv8btPfBllWzQoHVLsy1WimWN fbHjFHvqE5JlPY1Hyd8QtNi1+iWuoU62eAnqQXKRMWeJ1YA3SxO0kQ1CK+6rlA47H5Ml gb9gY0lcn1gwJArvKS5lRNcOJHXDFfqAUT6cVCmy/5uXFmO5sHhV2V47WekcqTqMqH2n 013MHxXPIbr8GCYuHcKuVNMSYQQEwuH56u2o9m5nT6b3QOcM/Pqi0rNoHLNnF/M4QXTj GGVg== ARC-Authentication-Results: i=1; mx.google.com; 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 x1-20020a170902fe8100b00153b2d164e4si11237589plm.236.2022.03.21.16.28.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 16:28:05 -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; 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 42CF845F0B7; Mon, 21 Mar 2022 15:18:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237787AbiCSLxw (ORCPT + 99 others); Sat, 19 Mar 2022 07:53:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231180AbiCSLxs (ORCPT ); Sat, 19 Mar 2022 07:53:48 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B70F112D089; Sat, 19 Mar 2022 04:52:27 -0700 (PDT) Received: from mail-wr1-f44.google.com ([209.85.221.44]) by mrelayeu.kundenserver.de (mreue108 [213.165.67.113]) with ESMTPSA (Nemesis) id 1M2w8Y-1nWecn2kYe-003K7R; Sat, 19 Mar 2022 12:52:25 +0100 Received: by mail-wr1-f44.google.com with SMTP id u16so13882106wru.4; Sat, 19 Mar 2022 04:52:25 -0700 (PDT) X-Gm-Message-State: AOAM531ByU0sI/2bn02vqTKHhWKY2/aN2hS1cbGMHLi8jqiaus+87QMj 8uqM99uifWEG/WZdmneUqK9bYUC5Jfz5c/aLTiM= X-Received: by 2002:a5d:66ca:0:b0:203:fb72:a223 with SMTP id k10-20020a5d66ca000000b00203fb72a223mr4299612wrw.12.1647690745320; Sat, 19 Mar 2022 04:52:25 -0700 (PDT) MIME-Version: 1.0 References: <20220319035457.2214979-1-guoren@kernel.org> <20220319035457.2214979-2-guoren@kernel.org> In-Reply-To: <20220319035457.2214979-2-guoren@kernel.org> From: Arnd Bergmann Date: Sat, 19 Mar 2022 12:52:09 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V2 1/5] asm-generic: ticket-lock: New generic ticket-based spinlock To: Guo Ren Cc: Palmer Dabbelt , Arnd Bergmann , Boqun Feng , Waiman Long , Peter Zijlstra , linux-arch , Linux Kernel Mailing List , linux-riscv , linux-csky@vger.kernel.org, Openrisc , Palmer Dabbelt Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:APP0UyWRzlhnr75oWsg0uoVpzBK/G2ciPVAgJcz8CFm2q4U4blu oycPpDGtzuOjc/IjPSKzsZGFh+CFjeZo5qAvi+yGMXfXvy1aN5vMI349A51yK5Lan6giQEy UREnUpyEN+869DJBLv9oJh10bjeNr3HG50cv4seBCAyUyT6DD8h/4s71e2y8aGMhqzZKfD5 eyJ2fcDHZCkQBYJBDWjGA== X-UI-Out-Filterresults: notjunk:1;V03:K0:j/j6WPhVZew=:bygOB6UYLCSHtvhqmC7FjX /5/QFLivE/I0SvGGxvYSnUNa7jP3Aob8JcfouP01ylqCUjW4sg3o1pledeuKjMhaGXuQDfRgB 4y1x3kFaEmZ9x7xNt+mHG/056V8WsdoG3of8yn6mEh8GKx5i4Y+hyShyIENAm9/Ml7ht8O5Sh GPWOVzloOj0uWFpkYDYoeJfDpBFms0a8PwjO5fn3Dgc+IkWTtO5zdh9j/z2cD9NtyKQcmQk9r ADtNnoaWy5V9luG5k38Fxk2R8aETf1N+UhyFMtdby16yXr3DhnvMy6dFMGmMugaV1T9nPWYrh zlMT2939rarZPKIUac3kx7lPaF+Oc8KbaVsXpW55piCR8nZmwCJa1+0rC9P0Dx2i0BCaqWlxv cs+d1WjPcCOULRG+MfzYN95Q6Dv2fngHKZYpFniw0EnY83OZb6Lz5ePscvA+4+HEymn5XXdOm 0oTXv23o9VYrg7+YvHzwjqzmfgE8Aqteca12lyBOaUExFiQIYuNEbcsVOYFlbtiTRQXlZgfvy MGp9Nxe2+uy0FyJNIMGv83ebFqhIdfRLEc4oGHhxNpRGoamsW7Qmqe/Z00UACO7M4x72TrOAv Y7BpzS0mPgUUDpqvWxBneCGk20DnOsTcwwrmNEequnXvvGFK0rmrwsZtVLRV4YFUbt729DGTu xjZaNx7A29vldO+n9PzscFBNEOV69YMEAi/nhnpWNYnHvHv8Y5fqU3N5WXKPoyqMMn0U= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, 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 On Sat, Mar 19, 2022 at 4:54 AM wrote: > /* > - * You need to implement asm/spinlock.h for SMP support. The generic > - * version does not handle SMP. > + * Using ticket-spinlock.h as generic for SMP support. > */ > #ifdef CONFIG_SMP > -#error need an architecture specific asm/spinlock.h > +#include > +#ifdef CONFIG_QUEUED_RWLOCKS > +#include > +#else > +#error Please select ARCH_USE_QUEUED_RWLOCKS in architecture Kconfig > +#endif > #endif There is no need for the !CONFIG_SMP case, as asm/spinlock.h only ever gets included for SMP builds in the first place. This was already a mistake in the existing code, but your change would be the time to fix it. I would also drop the !CONFIG_QUEUED_RWLOCKS case, just include it unconditionally. If any architecture wants the ticket spinlock in combination with a custom rwlock, they can simply include the asm-generic/ticket-lock.h from their asm/spinlock.h, but more likely any architecture that can use the ticket spinlock will also want the qrwlock anyway. Arnd