Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp737261rwe; Fri, 26 Aug 2022 13:27:36 -0700 (PDT) X-Google-Smtp-Source: AA6agR6LK612BiuDW6m/NYZnlXv1LqeZlWPxv6wvBY6jbd8uiPXHUqv6wHr2GpNI25PRhK4obscE X-Received: by 2002:a17:906:8a62:b0:73d:5dfd:b20c with SMTP id hy2-20020a1709068a6200b0073d5dfdb20cmr6401821ejc.84.1661545656640; Fri, 26 Aug 2022 13:27:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661545656; cv=none; d=google.com; s=arc-20160816; b=Ny5ii1QvgyMFnLXb9FsjQ1z+fhmlSWK741B92JTZiOL1Fkq14cgZJ79ywLYX8vUA15 hUcSNXipNTWs/HR4RYzAlKDQsywxs7hewZQUJVJI9vh648bVSPRjEm1fKvG8Umm/wt4E cmCPJEvGwI3USBSKVg+XqH6R4qCakYCB05OFcHCToTgpe75pt45e9xMe3XArLDUeOprh Fj1uUBqiu+be7CV7bKQbRLHr3VeaW4975mL9+8stWHeqN8eZIPszE6Nbg/lGJfK1lN1O Ww7VSqJKqjyciM2iYFWypRGUJptWv2mX8tOzUr59dhoofGwe00D4hw2fRUZ8DJ/2lBst eLWQ== 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:dkim-signature; bh=Ed72M6gjKE1csszbQngdfXNo2kUyihpXGg0Y+QCiXXY=; b=Zs8fZS/U6mUrHP8RSyP/Nt4qFpu3ddQzbLgCmOE2OYFFsGHBzYtPOglW6mGzBsZltE kCuNShXH5423sYVVDVW8qEBo+4XpsGr2vc2xIMxA0cR5iq4dqKNn3hG41Hz9w82+O0Og a22JWbZJ6azu4C7h6GxZn0FdX1DD7pL3n/dExQO5itAiU5WuK32eCHzMPGfLsUDbY0ng 3P6siJfzpVgO3cRCt96kbGrZTYMeLRtf2yBsT7BgLetPZ1cozmGbtQ/5MgpnJgJEw7Sy H6z4uTnssJxqN5jzjxXNmwOgmvaVLKnXYpJwCmb3e0iIOXwKREHiGTS025s1NhwEmXCv tovQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=H54MhldH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g3-20020a1709067c4300b00730a1f063fasi1613775ejp.132.2022.08.26.13.27.10; Fri, 26 Aug 2022 13:27:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=H54MhldH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344852AbiHZUKH (ORCPT + 99 others); Fri, 26 Aug 2022 16:10:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229561AbiHZUKG (ORCPT ); Fri, 26 Aug 2022 16:10:06 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE4566553 for ; Fri, 26 Aug 2022 13:10:04 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id y3so5139800ejc.1 for ; Fri, 26 Aug 2022 13:10:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=Ed72M6gjKE1csszbQngdfXNo2kUyihpXGg0Y+QCiXXY=; b=H54MhldHSwtdnVky1AK6bpcbibCENOFdm+UhkM4ltpNCKAt6u/QAx3LEqyHiSzh1XU 9vYu4kmVcZNk/QUlsaspK/GCHVCedHWEEnZ1gd9kc7wTTJGkQkw9G4rCIQl+tl9rC0/c XWJAzpA7GZ4JCzxTG0Hr5X9Rm0a+4i126WPj8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=Ed72M6gjKE1csszbQngdfXNo2kUyihpXGg0Y+QCiXXY=; b=ul1jt/1n5KOuSf0WU2qK71a1jeNiSc6R3NY2u92utYlGA8sS/EheG7AiQw0gvoM57q CtLTljZhwXGePl63HMy5rnqPVVq+bOgnYJxgenofctbGYqGcQxwIEZdG4hELyqVyVm0R dYOXLLBgY9alJSHUlfyoDwf8L4eGWhimlssA8SiM1yzGGuxALQOg+0nzOmVoYf0E7m7m M0/GXdIMl9FYNvfYa07TRfx5y4gSSAxXAS6+jV3Cg4PZPU7hY98DFVmJ/gDSlaiVnkgc LjpxNBkc2r+UJgRp4g33rCaW1FAaLz88ItrkhC4s7BOZBnw6hODqx61hUG8uUCu4Dtss nrDg== X-Gm-Message-State: ACgBeo3qdBY4847JW32U/mdTTOR9SrNFGe4vFH0k4OHwb3e1RoHHgKIM DXRWBz+BaEN4TaqluuUbssf4SpizGGdLIRPTNDA= X-Received: by 2002:a17:907:9814:b0:73d:8afe:6039 with SMTP id ji20-20020a170907981400b0073d8afe6039mr6216199ejc.566.1661544602810; Fri, 26 Aug 2022 13:10:02 -0700 (PDT) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com. [209.85.128.49]) by smtp.gmail.com with ESMTPSA id h3-20020a0564020e0300b00446a5fdaf0fsm1742768edh.45.2022.08.26.13.10.02 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Aug 2022 13:10:02 -0700 (PDT) Received: by mail-wm1-f49.google.com with SMTP id c187-20020a1c35c4000000b003a30d88fe8eso4950707wma.2 for ; Fri, 26 Aug 2022 13:10:02 -0700 (PDT) X-Received: by 2002:a05:600c:2195:b0:3a6:b3c:c100 with SMTP id e21-20020a05600c219500b003a60b3cc100mr624015wme.8.1661544233102; Fri, 26 Aug 2022 13:03:53 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Fri, 26 Aug 2022 13:03:36 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] wait_on_bit: add an acquire memory barrier To: Geert Uytterhoeven Cc: Mikulas Patocka , Alan Stern , Andrea Parri , Will Deacon , Peter Zijlstra , Boqun Feng , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , "Paul E. McKenney" , Akira Yokosawa , Daniel Lustig , Joel Fernandes , Linux Kernel Mailing List , Linux-Arch Content-Type: multipart/mixed; boundary="000000000000cb216505e72a6970" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 --000000000000cb216505e72a6970 Content-Type: text/plain; charset="UTF-8" On Fri, Aug 26, 2022 at 12:23 PM Geert Uytterhoeven wrote: > > include/asm-generic/bitops/non-instrumented-non-atomic.h:15:33: > error: implicit declaration of function 'arch_test_bit_acquire'; did > you mean '_test_bit_acquire'? [-Werror=implicit-function-declaration] > Ahh. m68k isn't using any of the generic bitops headers. *Most* architectures have that #include and get it that way, but while it's common, it's most definitely not universal: [torvalds@ryzen linux]$ git grep -L bitops/non-atomic.h arch/*/include/asm/bitops.h arch/alpha/include/asm/bitops.h arch/hexagon/include/asm/bitops.h arch/ia64/include/asm/bitops.h arch/m68k/include/asm/bitops.h arch/s390/include/asm/bitops.h arch/sparc/include/asm/bitops.h arch/x86/include/asm/bitops.h and of that list only x86 has the new arch_test_bit_acquire(). So I assume it's not just m68k, but also alpha, hexagon, ia64, s390 and sparc that have this issue (unless they maybe have some other path that includes the gerneric ones, I didn't check). This was actually why my original suggested patch used the 'generic-non-atomic.h' header for it, because that is actually included regardless of any architecture headers directly from . And it never triggered for me that Mikulas' updated patch then had this arch_test_bit_acquire() issue. Something like the attached patch *MAY* fix it, but I really haven't thought about it a lot, and it's pretty ugly. Maybe it would be better to just add the #define arch_test_bit_acquire generic_test_bit_acquire to the affected files instead, and then let those architectures decide on their own that maybe they want to use their own test_bit() function because it is _already_ an acquire one. Mikulas? Geert - any opinions on that "maybe the arch should just do that #define itself"? I don't think it actually matters for m68k, you end up with pretty much the same thing anyway, because "smp_load_acquire()" is just a load anyway.. Linus --000000000000cb216505e72a6970 Content-Type: text/x-patch; charset="US-ASCII"; name="patch.diff" Content-Disposition: attachment; filename="patch.diff" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_l7awiwdo0 IGFyY2gveDg2L2luY2x1ZGUvYXNtL2JpdG9wcy5oIHwgMSArCiBpbmNsdWRlL2xpbnV4L2JpdG9w cy5oICAgICAgICB8IDQgKysrKwogMiBmaWxlcyBjaGFuZ2VkLCA1IGluc2VydGlvbnMoKykKCmRp ZmYgLS1naXQgYS9hcmNoL3g4Ni9pbmNsdWRlL2FzbS9iaXRvcHMuaCBiL2FyY2gveDg2L2luY2x1 ZGUvYXNtL2JpdG9wcy5oCmluZGV4IDBmZTlkZTU4YWYzMS4uYjgyMDA2MTM4YzYwIDEwMDY0NAot LS0gYS9hcmNoL3g4Ni9pbmNsdWRlL2FzbS9iaX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