Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp409653lql; Mon, 11 Mar 2024 06:33:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW8cwSlEFXSKXjBgLOzDFBA1wHk4ZKpBKM4k4KL80SkJLVOX5UD6ix01rcx91uAg35Shvq+6EvXc8cH6DR5TwuXvN1e/y6eUxFB7f9gsg== X-Google-Smtp-Source: AGHT+IG3YsxmviQvZ3AW4B/TI7FjQWaTwuo+idmEnO9aSceBTOM0WFLjFezKUa3DkK3nxhHMlJ+p X-Received: by 2002:a17:906:a417:b0:a43:f267:789f with SMTP id l23-20020a170906a41700b00a43f267789fmr4039702ejz.41.1710164032923; Mon, 11 Mar 2024 06:33:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710164032; cv=pass; d=google.com; s=arc-20160816; b=K1v6p26/QIGLUbIVFUiSVn9HoajGOlS05HEwZG0BazvldQtvA4xFO8qWAkGZdbTC13 FO9rN8gCn2slFpTswWlL3X+1/MAURJv4FhAfZunQHNIdsDtg5a4S3RiI6VUCyQIRqeeT qw8MGf4WDfnEGvhq31TdbbiZH3IbjjvMiB6NXbqXSpWcr+UpQT2Y/QZouUK2vjrznRzo S5RH1iQ+h89FQHwVM8wO+pSIq9h9piqP1oVAK8nT5Xo6zigHcoskkdXXhmYzdis4GPqi 1VHKHdlntV4sbyAzQ3r5f+2DImRHrMFyZNtznjl6L+Tox/krzsz4LPR7pcM5HxOBvYe7 K8Fw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=8JvZkJevRJSKXIYkr1oB/t0mhZxADrmuqtggpNaZ0Lw=; fh=JtnJViNdwPvER/vSeulGhbOz/ZnOnq0hJNH9coboJhU=; b=j6mNPe6oqLZ9EdIPl0Ew7VAvkiKUbNjDzTuLGMD1XV3lHItXZztn4BqDCcq/cpMGBc V9qanv4COmt2Sno8vJO+gL9WCdKEX9HROPpo8SQiHzW1Y5nirN1G9ZSpTfdrEZ5ouMTG jppnhpHSLvmsm3cSr5Gwf/C5Z68sZwUNWMPYkWnHU2/zRxKGCFEPUtC7Y01tcoupWL8I 8vqi8h7gTUPW1b1wuR+qpv/tLgX2BWbTO8NHPLZ0Vu1oy3s3DERcmInHEYhqSvv6izSx kRwPuDHoerYyxNyv83krkw9L2DNmUAGLBTFDPB0PkA44vwpGui4HnEg0om+3ZCiulcDr q/4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=alpha.franken.de); spf=pass (google.com: domain of linux-kernel+bounces-98886-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98886-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id v9-20020a1709060b4900b00a4637c3a94csi170927ejg.956.2024.03.11.06.33.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 06:33:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98886-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=alpha.franken.de); spf=pass (google.com: domain of linux-kernel+bounces-98886-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98886-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A6A6B1F2319D for ; Mon, 11 Mar 2024 13:33:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CF69E3D970; Mon, 11 Mar 2024 13:33:46 +0000 (UTC) Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C441F2E3F7; Mon, 11 Mar 2024 13:33:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.175.24.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710164026; cv=none; b=b2Y/klesH7NTJyj5xEPlsqna+3ghac88jXjyxG2FxJAOJpE+Z3DJFl9yArZ8o8A9a/hXnQ8kTb4oih1ut6mI3JeelwCEQ6BAf7e/gmCOB8nYlDSVdsZKmMsw83Q6iK8wGJ6hyC/RAAbjhDNA9Uu2V7cHLqfaDbnp+PLN+9rgHM4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710164026; c=relaxed/simple; bh=jxq8f271ujvpbwEQPSIylVtewrclzvRsFccoNPWrj2w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iLOOoTrAG1vN8rkWFcZ8szdUg8VxhKKwJBdfNzoBkAwRgWHWBCG8+clvRTxHTKhM+yqOUA4YUbvqwBRdp7Z59bc/H3VODu87h6jAVVNAzjIJcVpDMgcoGwkxBsqpuJVk60dy3BoCs0q2n0MJVjfqaTvCHEeWuTiehM9HMRQglcY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alpha.franken.de; spf=pass smtp.mailfrom=alpha.franken.de; arc=none smtp.client-ip=193.175.24.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alpha.franken.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alpha.franken.de Received: from uucp by elvis.franken.de with local-rmail (Exim 3.36 #1) id 1rjfO2-0001bk-00; Mon, 11 Mar 2024 14:08:14 +0100 Received: by alpha.franken.de (Postfix, from userid 1000) id 3D2C9C0694; Mon, 11 Mar 2024 14:07:19 +0100 (CET) Date: Mon, 11 Mar 2024 14:07:19 +0100 From: Thomas Bogendoerfer To: Serge Semin Cc: Arnd Bergmann , Jiaxun Yang , Andrew Morton , Alexey Malahov , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] mips: cm: Convert __mips_cm_l2sync_phys_base() to weak function Message-ID: References: <20240226105427.7191-1-fancer.lancer@gmail.com> <20240226105427.7191-2-fancer.lancer@gmail.com> <34af21b5-a878-418e-a70b-299cab61b37e@app.fastmail.com> <60e60313-3cc4-452f-a222-aadd7728183d@app.fastmail.com> <6n2synlvazjh2gptxtioju7dciwshwqyei4xnfzorns66b3hqx@c7blt5kwnpbl> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6n2synlvazjh2gptxtioju7dciwshwqyei4xnfzorns66b3hqx@c7blt5kwnpbl> On Mon, Feb 26, 2024 at 04:11:05PM +0300, Serge Semin wrote: > On Mon, Feb 26, 2024 at 01:29:54PM +0100, Arnd Bergmann wrote: > > On Mon, Feb 26, 2024, at 13:20, Serge Semin wrote: > > > On Mon, Feb 26, 2024 at 01:04:33PM +0100, Arnd Bergmann wrote: > > >> On Mon, Feb 26, 2024, at 12:27, Serge Semin wrote: > > > > > I see your point now. Thanks for clarification. IMO it would be less > > > readable due to the ifdef-ery and the new config, and less > > > maintainable due to the conditional compilation, but would provide a > > > more performant solution since the compiler will be able to inline the > > > singly used static method. Basically you suggest to emulate the weak > > > implementation by an additional kernel config. > > > > I mean the kernel config that you already need here, since > > the strong version of the function is already optional. > > Why would I need it if after this patch is applied the > mips_cm_l2sync_phys_base() method will be converted to a global weak > implementation? > > > > > > Not sure whether it would be better than a well-known > > > weak-attribute-based pattern. Anyway let's wait for the > > > Thomas' opinion about your suggestion. If he thinks > > > it would be better I'll update the patches. > > > > Weak functions are not used all that much outside of a > > couple of parts of the kernel. There is a lot of them > > in drivers/pci/, a little bit in acpi and efi, and > > then a bit in arch/*/, though most of that is in mips. > > + a lot of them in kernel/*, some in mm/* .) > > > > > Ifdef checks in .c files are not great, but at least they > > are much more common than __weak functions and self-documenting. > > Ok. I don't have concretely strong opinion about what is better. Let's > wait for what Thomas thinks about this. I've taken your patches as we get rid of this alias thing. As long as there is no big push against __weak I'm ok with this case. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]