From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF12BC7EE2F for ; Mon, 12 Jun 2023 15:03:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239180AbjFLPDl (ORCPT ); Mon, 12 Jun 2023 11:03:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239244AbjFLPDa (ORCPT ); Mon, 12 Jun 2023 11:03:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C337C12A for ; Mon, 12 Jun 2023 08:03:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5C6A461671 for ; Mon, 12 Jun 2023 15:03:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6296C433D2; Mon, 12 Jun 2023 15:03:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686582206; bh=8d5q953vla0AfsjXttAZJ/ISVUHuzC9Shw3Q1PG8UPU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=i8cvUNbtedQ2UTp9IkMt/aFBwSQrLpEp2qWtRRdB90cgHyi8/e0PMRNHoZDUFhxka 50Naqpxnmwvc7ZSX0NkXKXL6zsSdB4go6z7o+TzQFtyoLCSahwXuC4RYlThlKlBwIb 44HDeScNkfhIB2IPFBcR7HBaa8aXHEG8Gkpdkk9kGsEgkEaxAgeWlVC39UJ5y6CZ8W Bb7kMAJOig9lZKIJbmjklPDjzS5SVAtT4tW3jf12MpzcdJy36mwXLWAmnJVtlBJ6+1 ghHq+ocNpSmCibxUvSFneGfbWifuFflvWFzqwXSeEWraQm8Okq9+ZZuujGDQqkl21Y qKOKBmN6u/ynQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1q8j4m-004ova-Ma; Mon, 12 Jun 2023 16:03:24 +0100 Date: Mon, 12 Jun 2023 16:03:24 +0100 Message-ID: <86r0qgbu4j.wl-maz@kernel.org> From: Marc Zyngier To: Peter Zijlstra Cc: Mark Rutland , linux-kernel@vger.kernel.org, Reiji Watanabe , Will Deacon Subject: Re: [PATCH] perf/core: Drop __weak attribute from arch_perf_update_userpage() prototype In-Reply-To: <20230612145423.GC83892@hirez.programming.kicks-ass.net> References: <20230603082519.1088285-1-maz@kernel.org> <20230612145423.GC83892@hirez.programming.kicks-ass.net> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: peterz@infradead.org, mark.rutland@arm.com, linux-kernel@vger.kernel.org, reijiw@google.com, will@kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 12 Jun 2023 15:54:23 +0100, Peter Zijlstra wrote: > > 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? That'd be my preference, as arm64 is currently a bit broken and I'd like 6.4 to be functional. Thanks, M. -- Without deviation from the norm, progress is not possible.