2023-06-26 11:48:00

by Miaohe Lin

[permalink] [raw]
Subject: [PATCH] mm: memory-failure: remove unneeded 'inline' annotation

Remove unneeded 'inline' annotation from num_poisoned_pages_inc() and
num_poisoned_pages_sub(). No functional change intended.

Signed-off-by: Miaohe Lin <[email protected]>
---
mm/memory-failure.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 66e7b3ceaf2d..aada6ac72fe5 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -75,13 +75,13 @@ atomic_long_t num_poisoned_pages __read_mostly = ATOMIC_LONG_INIT(0);

static bool hw_memory_failure __read_mostly = false;

-inline void num_poisoned_pages_inc(unsigned long pfn)
+void num_poisoned_pages_inc(unsigned long pfn)
{
atomic_long_inc(&num_poisoned_pages);
memblk_nr_poison_inc(pfn);
}

-inline void num_poisoned_pages_sub(unsigned long pfn, long i)
+void num_poisoned_pages_sub(unsigned long pfn, long i)
{
atomic_long_sub(i, &num_poisoned_pages);
if (pfn != -1UL)
--
2.27.0



2023-06-27 23:36:46

by Naoya Horiguchi

[permalink] [raw]
Subject: Re: [PATCH] mm: memory-failure: remove unneeded 'inline' annotation

On Mon, Jun 26, 2023 at 07:43:43PM +0800, Miaohe Lin wrote:
> Remove unneeded 'inline' annotation from num_poisoned_pages_inc() and
> num_poisoned_pages_sub(). No functional change intended.
>
> Signed-off-by: Miaohe Lin <[email protected]>

Yes, num_poisoned_pages_{inc,sub} seem not to be inlined even if "inline"
keyword is given, maybe because they are not static functions.

Thank you for finding this.

Acked-by: Naoya Horiguchi <[email protected]>

> ---
> mm/memory-failure.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index 66e7b3ceaf2d..aada6ac72fe5 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -75,13 +75,13 @@ atomic_long_t num_poisoned_pages __read_mostly = ATOMIC_LONG_INIT(0);
>
> static bool hw_memory_failure __read_mostly = false;
>
> -inline void num_poisoned_pages_inc(unsigned long pfn)
> +void num_poisoned_pages_inc(unsigned long pfn)
> {
> atomic_long_inc(&num_poisoned_pages);
> memblk_nr_poison_inc(pfn);
> }
>
> -inline void num_poisoned_pages_sub(unsigned long pfn, long i)
> +void num_poisoned_pages_sub(unsigned long pfn, long i)
> {
> atomic_long_sub(i, &num_poisoned_pages);
> if (pfn != -1UL)
> --
> 2.27.0
>
>
>