Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5660147rwd; Mon, 12 Jun 2023 08:04:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4P0eb/CFiozSPwV6FGW8W/Ar67Khp4mxuafs0yTzd37+93k7TmzRpqhXTPrrHDvfdOJtgf X-Received: by 2002:a17:902:d509:b0:1b0:663e:4b3f with SMTP id b9-20020a170902d50900b001b0663e4b3fmr7702066plg.37.1686582272077; Mon, 12 Jun 2023 08:04:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686582272; cv=none; d=google.com; s=arc-20160816; b=osMGSkLBAAFTwf9NCa7HhZ4sWTpq1ko+xCGHg1jayuybv550bvchTlXx+f19QiPFhX pgQYxBKSw9RdPcUBzE7D+5BUak4CygHQvF5FAPeAtrVUxWXHDLQ1ojll6GBwyqIAvZEC YsatN3ha3BUgfKMNP+55guHKc4AEcdI54DwV3ZGy5ni+ZcVw1K0LG6ZdsBMGn0gRX92m GVVXSdxrozmrg0P0Zqayt+bnC7yV/Blp+fhfuXyaB/NJBPbCgyUSxzE//ns0FVejAACG zwBhnNyFrAC4odQtuZ/+gJ3kLZTChLB5t45TLV4FsAtXuQqUN9XCL8qLoo6XYHeKNJvb quKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Xy+SYhrM7RlVNzZxFzAWCPsWAl2CRd9k+U+jDm6Cq4E=; b=A3x6zJtrNF4LdbyzlhuDxisUlcOdrvfcvKW8pFTPaxllCVxA7VtxXGRc6uXana/G+L QqGfnbRqGEZ1cFgnywGjsjNFMr94e+1+fQFJQ4y+zDuMYspUqlSCRNUWTENp2/HpjXGd yOD76nQdUXR2ThTQXgOIiKpYzgvSOnLcsWWRBN6HJEWRnvYXRK4UfCKr1KsfXlNOZM87 fpYLxUPA0afRpiS832RHPmCDGdfdExT7tfaH44j0LL0RWB9LrL2t+bNNonguwwl8AgAv LZvEBTQw/FQ4tc/U//cuLUpZZpE4doWx15C15otxUX5frBkTwgerx8PWId2Z5n8JRRIV UQXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=fvCz3vBo; 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 i13-20020a17090332cd00b001addf547a59si3367697plr.0.2023.06.12.08.04.19; Mon, 12 Jun 2023 08:04:32 -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=@infradead.org header.s=casper.20170209 header.b=fvCz3vBo; 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 S237622AbjFLOya (ORCPT + 99 others); Mon, 12 Jun 2023 10:54:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229555AbjFLOy2 (ORCPT ); Mon, 12 Jun 2023 10:54:28 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE9EC10A for ; Mon, 12 Jun 2023 07:54:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Xy+SYhrM7RlVNzZxFzAWCPsWAl2CRd9k+U+jDm6Cq4E=; b=fvCz3vBoL4Kcr2PHBIVKbzlSWG b7qVtnDn5yl03rPcqDmmbthkz0bGM+3IQbUyboMZRBdaZ6vNs26kgCJQkcB/wjKMku2AcqHSG1rx8 bUYE/h6uyx/NnIdOmwRovIJ+RHn2b+wWMyS5i563EH+okJaxxBWkumo/Z1Arwk2pXeU0pGV74zjT8 FsgVcUGXUTzNY0PGlRu9CbChajdcoZpNwsyylL64I0J7JCy9Nh6krBjHx9XisQ0ozKohuXd9FyZfU NTAyKhfmrtf17bFkyS3bELCZG/uP+wGY21lVHfG6aTU1IZcqIwbVHcxr4Mcv+q6Je0YOHYESPFRni x/PyecJA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1q8iw3-002k4U-Lh; Mon, 12 Jun 2023 14:54:24 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 4B99E300188; Mon, 12 Jun 2023 16:54:23 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 32A0920D7062B; Mon, 12 Jun 2023 16:54:23 +0200 (CEST) Date: Mon, 12 Jun 2023 16:54:23 +0200 From: Peter Zijlstra To: Mark Rutland Cc: Marc Zyngier , linux-kernel@vger.kernel.org, Reiji Watanabe , Will Deacon Subject: Re: [PATCH] perf/core: Drop __weak attribute from arch_perf_update_userpage() prototype Message-ID: <20230612145423.GC83892@hirez.programming.kicks-ass.net> References: <20230603082519.1088285-1-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Mon, Jun 12, 2023 at 02:16:28PM +0100, Mark Rutland wrote: > On Sat, Jun 03, 2023 at 09:25:19AM +0100, Marc Zyngier wrote: > > Reiji reports that the arm64 implementation of arch_perf_update_userpage() > > is now ignored and replaced by the dummy stub in core code. > > This seems to happen since the PMUv3 driver was moved to driver/perf. > > I guess we should have a Cc stable then? > > The below implies this has always been on dodgy ground, and so it's probably > inaccurate to give this a Fixes tag pointing to the move. > > > As it turns out, dropping the __weak attribute from the *prototype* > > of the function solves the problem. You're right, this doesn't seem > > to make much sense. And yet... It appears that both symbols get > > flagged as weak, and that the first one to appear in the link order > > wins: > > > > $ nm drivers/perf/arm_pmuv3.o|grep arch_perf_update_userpage > > 0000000000001db0 W arch_perf_update_userpage > > Ah, so having it on th *declaration* will apply to any *definition*. :/ Yikes.. > That suggests this is a bad pattern generally, and we should probably remove > the other __weak instances in headers. Lukcily it seems there aren't that many: > > [mark@lakrids:~/src/linux]% git grep __weak -- **/*.h | wc -l > 50 > > IMO we'd should aim to remove __weak entirely; it causes a number of weird > things like this and it'd be much easier to manage with a small amount of > ifdeffery. > > Peter, thoughts? Not a fan of __weak myself, after having had to deal with how the compilers actually make it work. Where do I queue this? perf/urgent?