* [PATCH] mm: use CPU_BITS_NONE to initialize init_mm.cpu_bitmask
@ 2019-08-13 13:43 Mike Rapoport
2019-08-21 15:55 ` David Hildenbrand
0 siblings, 1 reply; 2+ messages in thread
From: Mike Rapoport @ 2019-08-13 13:43 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-mm, Mike Rapoport
Replace open-coded bitmap array initialization of init_mm.cpu_bitmask with
neat CPU_BITS_NONE macro.
And, since init_mm.cpu_bitmask is statically set to zero, there is no way
to clear it again in start_kernel().
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
---
init/main.c | 1 -
mm/init-mm.c | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/init/main.c b/init/main.c
index 96f8d5a..e29becc 100644
--- a/init/main.c
+++ b/init/main.c
@@ -594,7 +594,6 @@ asmlinkage __visible void __init start_kernel(void)
page_address_init();
pr_notice("%s", linux_banner);
setup_arch(&command_line);
- mm_init_cpumask(&init_mm);
setup_command_line(command_line);
setup_nr_cpu_ids();
setup_per_cpu_areas();
diff --git a/mm/init-mm.c b/mm/init-mm.c
index a787a31..fb1e150 100644
--- a/mm/init-mm.c
+++ b/mm/init-mm.c
@@ -35,6 +35,6 @@ struct mm_struct init_mm = {
.arg_lock = __SPIN_LOCK_UNLOCKED(init_mm.arg_lock),
.mmlist = LIST_HEAD_INIT(init_mm.mmlist),
.user_ns = &init_user_ns,
- .cpu_bitmap = { [BITS_TO_LONGS(NR_CPUS)] = 0},
+ .cpu_bitmap = CPU_BITS_NONE,
INIT_MM_CONTEXT(init_mm)
};
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mm: use CPU_BITS_NONE to initialize init_mm.cpu_bitmask
2019-08-13 13:43 [PATCH] mm: use CPU_BITS_NONE to initialize init_mm.cpu_bitmask Mike Rapoport
@ 2019-08-21 15:55 ` David Hildenbrand
0 siblings, 0 replies; 2+ messages in thread
From: David Hildenbrand @ 2019-08-21 15:55 UTC (permalink / raw)
To: Mike Rapoport, Andrew Morton; +Cc: linux-mm
On 13.08.19 15:43, Mike Rapoport wrote:
> Replace open-coded bitmap array initialization of init_mm.cpu_bitmask with
> neat CPU_BITS_NONE macro.
>
> And, since init_mm.cpu_bitmask is statically set to zero, there is no way
> to clear it again in start_kernel().
>
> Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
> ---
> init/main.c | 1 -
> mm/init-mm.c | 2 +-
> 2 files changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/init/main.c b/init/main.c
> index 96f8d5a..e29becc 100644
> --- a/init/main.c
> +++ b/init/main.c
> @@ -594,7 +594,6 @@ asmlinkage __visible void __init start_kernel(void)
> page_address_init();
> pr_notice("%s", linux_banner);
> setup_arch(&command_line);
> - mm_init_cpumask(&init_mm);
> setup_command_line(command_line);
> setup_nr_cpu_ids();
> setup_per_cpu_areas();
> diff --git a/mm/init-mm.c b/mm/init-mm.c
> index a787a31..fb1e150 100644
> --- a/mm/init-mm.c
> +++ b/mm/init-mm.c
> @@ -35,6 +35,6 @@ struct mm_struct init_mm = {
> .arg_lock = __SPIN_LOCK_UNLOCKED(init_mm.arg_lock),
> .mmlist = LIST_HEAD_INIT(init_mm.mmlist),
> .user_ns = &init_user_ns,
> - .cpu_bitmap = { [BITS_TO_LONGS(NR_CPUS)] = 0},
> + .cpu_bitmap = CPU_BITS_NONE,
> INIT_MM_CONTEXT(init_mm)
> };
>
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David / dhildenb
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-08-21 15:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-13 13:43 [PATCH] mm: use CPU_BITS_NONE to initialize init_mm.cpu_bitmask Mike Rapoport
2019-08-21 15:55 ` David Hildenbrand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).