From: Ingo Molnar <mingo@elte.hu>
To: Tejun Heo <tj@kernel.org>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
David Miller <davem@davemloft.net>,
sparclinux@vger.kernel.org
Subject: Re: [PATCH 2/2 2.6.31-rc5 REPOST] percpu, sparc64: fix sparse possible cpu map handling
Date: Thu, 6 Aug 2009 13:57:05 +0200 [thread overview]
Message-ID: <20090806115705.GB10734@elte.hu> (raw)
In-Reply-To: <4A7AA416.9070901@kernel.org>
* Tejun Heo <tj@kernel.org> wrote:
> percpu code has been assuming num_possible_cpus() == nr_cpu_ids which
> is incorrect if cpu_possible_map contains holes. This causes percpu
> code to access beyond allocated memories and vmalloc areas. On a
> sparc64 machine with cpus 0 and 2 (u60), this triggers the following
> warning or fails boot.
>
> WARNING: at /devel/tj/os/work/mm/vmalloc.c:106 vmap_page_range_noflush+0x1f0/0x240()
> Modules linked in:
> Call Trace:
> [00000000004b17d0] vmap_page_range_noflush+0x1f0/0x240
> [00000000004b1840] map_vm_area+0x20/0x60
> [00000000004b1950] __vmalloc_area_node+0xd0/0x160
> [0000000000593434] deflate_init+0x14/0xe0
> [0000000000583b94] __crypto_alloc_tfm+0xd4/0x1e0
> [00000000005844f0] crypto_alloc_base+0x50/0xa0
> [000000000058b898] alg_test_comp+0x18/0x80
> [000000000058dad4] alg_test+0x54/0x180
> [000000000058af00] cryptomgr_test+0x40/0x60
> [0000000000473098] kthread+0x58/0x80
> [000000000042b590] kernel_thread+0x30/0x60
> [0000000000472fd0] kthreadd+0xf0/0x160
> ---[ end trace 429b268a213317ba ]---
>
> This patch fixes generic percpu functions and sparc64
> setup_per_cpu_areas() so that they handle sparse cpu_possible_map
> properly.
>
> Please note that on x86, cpu_possible_map() doesn't contain holes and
> thus num_possible_cpus() == nr_cpu_ids and this patch doesn't cause
> any behavior difference.
>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Ingo Molnar <mingo@elte.hu>
> ---
> As written in the previous mail, this fixes rather critical boot
> problem on sparc64. Upon ack, I can get it through the percpu tree.
> Not really sure who could ack this one other than David tho. Anyone?
>
> Thanks.
>
> arch/sparc/kernel/smp_64.c | 4 ++--
> arch/x86/kernel/setup_percpu.c | 14 +++++++-------
> mm/percpu.c | 31 +++++++++++++++++++------------
> 3 files changed, 28 insertions(+), 21 deletions(-)
for the x86 bits:
Acked-by: Ingo Molnar <mingo@elte.hu>
Once Dave acks it i suspect you can send it to Linus directly?
Ingo
next prev parent reply other threads:[~2009-08-06 11:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-06 9:33 [PATCH 1/2 2.6.31-rc5 REPOST] init: set nr_cpu_ids before setup_per_cpu_areas() Tejun Heo
2009-08-06 9:36 ` [PATCH 2/2 2.6.31-rc5 REPOST] percpu, sparc64: fix sparse possible cpu map handling Tejun Heo
2009-08-06 11:57 ` Ingo Molnar [this message]
2009-08-06 16:15 ` Tejun Heo
2009-08-12 6:10 ` Tejun Heo
2009-08-12 23:25 ` David Miller
2009-08-14 4:26 ` Tejun Heo
2009-08-14 4:27 ` [PATCH 2/2 2.6.31-rc5 UPDATED] " Tejun Heo
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=20090806115705.GB10734@elte.hu \
--to=mingo@elte.hu \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=sparclinux@vger.kernel.org \
--cc=tj@kernel.org \
/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
all inboxes | Powered by JetHome®