diff mbox series

[08/16] mm/migration: avoid unneeded nodemask_t initialization

Message ID 20220304093409.25829-9-linmiaohe@huawei.com (mailing list archive)
State New
Headers show
Series A few cleanup and fixup patches for migration | expand

Commit Message

Miaohe Lin March 4, 2022, 9:34 a.m. UTC
Avoid unneeded next_pass and this_pass initialization as they're always
set before using to save possible cpu cycles when there are plenty of
nodes in the system.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/migrate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Muchun Song March 4, 2022, 1:57 p.m. UTC | #1
On Fri, Mar 4, 2022 at 5:35 PM Miaohe Lin <linmiaohe@huawei.com> wrote:
>
> Avoid unneeded next_pass and this_pass initialization as they're always
> set before using to save possible cpu cycles when there are plenty of
> nodes in the system.
>
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

Thanks.
Baolin Wang March 7, 2022, 2:31 a.m. UTC | #2
On 3/4/2022 5:34 PM, Miaohe Lin wrote:
> Avoid unneeded next_pass and this_pass initialization as they're always
> set before using to save possible cpu cycles when there are plenty of
> nodes in the system.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>   mm/migrate.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/migrate.c b/mm/migrate.c
> index c84eec19072a..abb0c6715e1f 100644
> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -2378,8 +2378,8 @@ static int establish_migrate_target(int node, nodemask_t *used,
>    */
>   static void __set_migration_target_nodes(void)
>   {
> -	nodemask_t next_pass	= NODE_MASK_NONE;
> -	nodemask_t this_pass	= NODE_MASK_NONE;
> +	nodemask_t next_pass;
> +	nodemask_t this_pass;
>   	nodemask_t used_targets = NODE_MASK_NONE;
>   	int node, best_distance;

LGTM.
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
diff mbox series

Patch

diff --git a/mm/migrate.c b/mm/migrate.c
index c84eec19072a..abb0c6715e1f 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -2378,8 +2378,8 @@  static int establish_migrate_target(int node, nodemask_t *used,
  */
 static void __set_migration_target_nodes(void)
 {
-	nodemask_t next_pass	= NODE_MASK_NONE;
-	nodemask_t this_pass	= NODE_MASK_NONE;
+	nodemask_t next_pass;
+	nodemask_t this_pass;
 	nodemask_t used_targets = NODE_MASK_NONE;
 	int node, best_distance;