All of lore.kernel.org
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
	Will Deacon <will@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64/migration: Define arm64_hugetlb_valid_size()
Date: Thu, 10 Feb 2022 10:42:23 +0000	[thread overview]
Message-ID: <YgTsD4+8lAUjwAK1@arm.com> (raw)
In-Reply-To: <88ebbd30-2fcf-fef3-077c-1b8163cb7409@arm.com>

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

WARNING: multiple messages have this Message-ID (diff)
From: Catalin Marinas <catalin.marinas@arm.com>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
	Will Deacon <will@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64/migration: Define arm64_hugetlb_valid_size()
Date: Thu, 10 Feb 2022 10:42:23 +0000	[thread overview]
Message-ID: <YgTsD4+8lAUjwAK1@arm.com> (raw)
In-Reply-To: <88ebbd30-2fcf-fef3-077c-1b8163cb7409@arm.com>

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

  reply	other threads:[~2022-02-10 10:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-07  1:31 [PATCH] arm64/migration: Define arm64_hugetlb_valid_size() Anshuman Khandual
2022-02-07  1:31 ` Anshuman Khandual
2022-02-09 18:34 ` Catalin Marinas
2022-02-09 18:34   ` Catalin Marinas
2022-02-10  4:47   ` Anshuman Khandual
2022-02-10  4:47     ` Anshuman Khandual
2022-02-10 10:42     ` Catalin Marinas [this message]
2022-02-10 10:42       ` Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YgTsD4+8lAUjwAK1@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=anshuman.khandual@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.