From: Mike Rapoport <rppt@linux.ibm.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/init-mm.c: use CPU_BITS_NONE to initialize .cpu_bitmap
Date: Thu, 22 Aug 2019 16:26:03 +0300 [thread overview]
Message-ID: <20190822132602.GF18872@rapoport-lnx> (raw)
In-Reply-To: <20190822075207.26400-1-linux@rasmusvillemoes.dk>
Hi,
On Thu, Aug 22, 2019 at 09:52:07AM +0200, Rasmus Villemoes wrote:
> init_mm is sizeof(long) larger than it needs to be. Use the
> CPU_BITS_NONE macro meant for this, which will initialize just the
> indices 0...(BITS_TO_LONGS(NR_CPUS)-1) and hence make the array size
> actually BITS_TO_LONGS(NR_CPUS).
I've sent a similar patch [1] a week or so ago, it's in -mm tree.
[1] https://lore.kernel.org/linux-mm/1565703815-8584-1-git-send-email-rppt@linux.ibm.com/
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> ---
> mm/init-mm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/init-mm.c b/mm/init-mm.c
> index a787a319211e..fb1e15028ef0 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.20.1
>
>
--
Sincerely yours,
Mike.
prev parent reply other threads:[~2019-08-22 13:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-22 7:52 [PATCH] mm/init-mm.c: use CPU_BITS_NONE to initialize .cpu_bitmap Rasmus Villemoes
2019-08-22 13:26 ` Mike Rapoport [this message]
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=20190822132602.GF18872@rapoport-lnx \
--to=rppt@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux@rasmusvillemoes.dk \
/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 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).