2023-06-10 04:56:42

by Miaohe Lin

[permalink] [raw]
Subject: [PATCH] memory tier: remove unneeded !IS_ENABLED(CONFIG_MIGRATION) check

establish_demotion_targets() is defined while CONFIG_MIGRATION is
enabled. There's no need to check it again.

Signed-off-by: Miaohe Lin <[email protected]>
---
mm/memory-tiers.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memory-tiers.c b/mm/memory-tiers.c
index dd04f0ce5277..a516e303e304 100644
--- a/mm/memory-tiers.c
+++ b/mm/memory-tiers.c
@@ -366,7 +366,7 @@ static void establish_demotion_targets(void)

lockdep_assert_held_once(&memory_tier_lock);

- if (!node_demotion || !IS_ENABLED(CONFIG_MIGRATION))
+ if (!node_demotion)
return;

disable_all_demotion_targets();
--
2.27.0



2023-06-12 09:50:10

by David Hildenbrand

[permalink] [raw]
Subject: Re: [PATCH] memory tier: remove unneeded !IS_ENABLED(CONFIG_MIGRATION) check

On 10.06.23 05:41, Miaohe Lin wrote:
> establish_demotion_targets() is defined while CONFIG_MIGRATION is
> enabled. There's no need to check it again.
>
> Signed-off-by: Miaohe Lin <[email protected]>
> ---
> mm/memory-tiers.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/memory-tiers.c b/mm/memory-tiers.c
> index dd04f0ce5277..a516e303e304 100644
> --- a/mm/memory-tiers.c
> +++ b/mm/memory-tiers.c
> @@ -366,7 +366,7 @@ static void establish_demotion_targets(void)
>
> lockdep_assert_held_once(&memory_tier_lock);
>
> - if (!node_demotion || !IS_ENABLED(CONFIG_MIGRATION))
> + if (!node_demotion)
> return;
>
> disable_all_demotion_targets();

Reviewed-by: David Hildenbrand <[email protected]>

--
Cheers,

David / dhildenb


2023-06-12 22:29:57

by Yang Shi

[permalink] [raw]
Subject: Re: [PATCH] memory tier: remove unneeded !IS_ENABLED(CONFIG_MIGRATION) check

On Fri, Jun 9, 2023 at 8:41 PM Miaohe Lin <[email protected]> wrote:
>
> establish_demotion_targets() is defined while CONFIG_MIGRATION is
> enabled. There's no need to check it again.
>
> Signed-off-by: Miaohe Lin <[email protected]>

Reviewed-by: Yang Shi <[email protected]>

> ---
> mm/memory-tiers.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/memory-tiers.c b/mm/memory-tiers.c
> index dd04f0ce5277..a516e303e304 100644
> --- a/mm/memory-tiers.c
> +++ b/mm/memory-tiers.c
> @@ -366,7 +366,7 @@ static void establish_demotion_targets(void)
>
> lockdep_assert_held_once(&memory_tier_lock);
>
> - if (!node_demotion || !IS_ENABLED(CONFIG_MIGRATION))
> + if (!node_demotion)
> return;
>
> disable_all_demotion_targets();
> --
> 2.27.0
>
>