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 A9DD5C433F5 for ; Thu, 10 Feb 2022 10:42:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239959AbiBJKmb (ORCPT ); Thu, 10 Feb 2022 05:42:31 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:52992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237058AbiBJKm3 (ORCPT ); Thu, 10 Feb 2022 05:42:29 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 019A1C39 for ; Thu, 10 Feb 2022 02:42:30 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id AC044B824B3 for ; Thu, 10 Feb 2022 10:42:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71E8EC004E1; Thu, 10 Feb 2022 10:42:27 +0000 (UTC) Date: Thu, 10 Feb 2022 10:42:23 +0000 From: Catalin Marinas To: Anshuman Khandual Cc: linux-arm-kernel@lists.infradead.org, Will Deacon , linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64/migration: Define arm64_hugetlb_valid_size() Message-ID: References: <1644197468-26755-1-git-send-email-anshuman.khandual@arm.com> <88ebbd30-2fcf-fef3-077c-1b8163cb7409@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <88ebbd30-2fcf-fef3-077c-1b8163cb7409@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 10, 2022 at 10:17:17AM +0530, Anshuman Khandual wrote: > On 2/10/22 12:04 AM, Catalin Marinas wrote: > > On Mon, Feb 07, 2022 at 07:01:08AM +0530, Anshuman Khandual wrote: > >> +bool __init arch_hugetlb_valid_size(unsigned long size) > >> +{ > >> + return arm64_hugetlb_valid_size(size); > >> +} > > > > What's wrong with keeping the arch_hugetlb_valid_size() name and just > > removing __init? > > When arch_hugetlb_migration_supported() calls arch_hugetlb_valid_size(), > > With __init for arch_hugetlb_valid_size(), there is a build problem. > > WARNING: modpost: vmlinux.o(.text.unlikely+0xf18): Section mismatch in > reference from the function arch_hugetlb_migration_supported() to the > function .init.text:arch_hugetlb_valid_size() > The function arch_hugetlb_migration_supported() references > the function __init arch_hugetlb_valid_size(). > This is often because arch_hugetlb_migration_supported lacks a __init > annotation or the annotation of arch_hugetlb_valid_size is wrong. This is expected. > Without __init for arch_hugetlb_valid_size(), there is the same problem. > > WARNING: modpost: vmlinux.o(.text.unlikely+0xf18): Section mismatch in > reference from the function arch_hugetlb_migration_supported() to the > function .init.text:arch_hugetlb_valid_size() > The function arch_hugetlb_migration_supported() references > the function __init arch_hugetlb_valid_size(). > This is often because arch_hugetlb_migration_supported lacks a __init > annotation or the annotation of arch_hugetlb_valid_size is wrong. > > This might be because generic prototype for arch_hugetlb_valid_size() has > __init attribute, which arch_hugetlb_migration_supported() does not have. > > Hence a local static helper arm64_hugetlb_valid_size() which both these > generic functions can call into, looked appropriate. Ah, I did not realise the generic prototype is __init already. So fine by me but maybe just use __hugetlb_valid_size() as it's a local function only (static). -- Catalin 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 853F7C433EF for ; Thu, 10 Feb 2022 10:43:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9qqcJGPCRApkpX/w4Cu17gfmmbieRoye8Cjgt/vquWg=; b=dPMEjxCITGaLMy 5ExuJ1TeLRzGfFnQTWCnsOUXDow08YfPzuBDbBno1Rs7Essv+4TWCJQqeVGBsZ0OBvbJylxIKuKwE wY1Uo627oJ+clB0v26yGlV04rZo1/atWFv9fA2N7m+1SbzJkYVIfyNC1tZm/FJpDpMcXdy3VA/x4R C4t5Psx8XLJIPIsgvTQorDG5RUbsxBSsD9nqXfjZ1ENW/7MQtSUJfb0KI/yZt4jgbN12Ka/bBzZzU aLOHclUD0Ow0CfPrjICegLylhZ+qDF8iAHkzjnnP0WJitXRMOgitNNMJZe2LNVcsJpbCRMH+qWvMH m1xkzN02ATtKMyBYbA2w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nI6uG-003UAh-TH; Thu, 10 Feb 2022 10:42:32 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nI6uD-003UA1-Eb for linux-arm-kernel@lists.infradead.org; Thu, 10 Feb 2022 10:42:30 +0000 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 E7A6761B63; Thu, 10 Feb 2022 10:42:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71E8EC004E1; Thu, 10 Feb 2022 10:42:27 +0000 (UTC) Date: Thu, 10 Feb 2022 10:42:23 +0000 From: Catalin Marinas To: Anshuman Khandual Cc: linux-arm-kernel@lists.infradead.org, Will Deacon , linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64/migration: Define arm64_hugetlb_valid_size() Message-ID: References: <1644197468-26755-1-git-send-email-anshuman.khandual@arm.com> <88ebbd30-2fcf-fef3-077c-1b8163cb7409@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <88ebbd30-2fcf-fef3-077c-1b8163cb7409@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220210_024229_552446_FFC1577F X-CRM114-Status: GOOD ( 17.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Feb 10, 2022 at 10:17:17AM +0530, Anshuman Khandual wrote: > On 2/10/22 12:04 AM, Catalin Marinas wrote: > > On Mon, Feb 07, 2022 at 07:01:08AM +0530, Anshuman Khandual wrote: > >> +bool __init arch_hugetlb_valid_size(unsigned long size) > >> +{ > >> + return arm64_hugetlb_valid_size(size); > >> +} > > > > What's wrong with keeping the arch_hugetlb_valid_size() name and just > > removing __init? > > When arch_hugetlb_migration_supported() calls arch_hugetlb_valid_size(), > > With __init for arch_hugetlb_valid_size(), there is a build problem. > > WARNING: modpost: vmlinux.o(.text.unlikely+0xf18): Section mismatch in > reference from the function arch_hugetlb_migration_supported() to the > function .init.text:arch_hugetlb_valid_size() > The function arch_hugetlb_migration_supported() references > the function __init arch_hugetlb_valid_size(). > This is often because arch_hugetlb_migration_supported lacks a __init > annotation or the annotation of arch_hugetlb_valid_size is wrong. This is expected. > Without __init for arch_hugetlb_valid_size(), there is the same problem. > > WARNING: modpost: vmlinux.o(.text.unlikely+0xf18): Section mismatch in > reference from the function arch_hugetlb_migration_supported() to the > function .init.text:arch_hugetlb_valid_size() > The function arch_hugetlb_migration_supported() references > the function __init arch_hugetlb_valid_size(). > This is often because arch_hugetlb_migration_supported lacks a __init > annotation or the annotation of arch_hugetlb_valid_size is wrong. > > This might be because generic prototype for arch_hugetlb_valid_size() has > __init attribute, which arch_hugetlb_migration_supported() does not have. > > Hence a local static helper arm64_hugetlb_valid_size() which both these > generic functions can call into, looked appropriate. Ah, I did not realise the generic prototype is __init already. So fine by me but maybe just use __hugetlb_valid_size() as it's a local function only (static). -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel