From: Tejun Heo <tj@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>,
lkml <linux-kernel@vger.kernel.org>,
CAI Qian <caiqian@redhat.com>
Subject: [GIT PULL] percpu: fixes for v2.6.36-rc5
Date: Thu, 23 Sep 2010 10:57:46 +0200 [thread overview]
Message-ID: <4C9B168A.9000702@kernel.org> (raw)
Hello, Linus.
Please pull from the following branch to receive a percpu fix for
v2.6.36-rc5.
git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu.git for-linus
It contains only one patch to fix incorrect pcpu_last_unit_cpu
initialization. When the number of possible CPUs isn't power of two,
there can be unused holes at the end of each percpu chunk. Percpu
init code uses NR_CPUS to mark these holes. pcpu_last_unit_cpu should
contain the CPU which maps to the last unit in the chunk but when the
above condition occurs, it contained NR_CPUS instead, which makes
percpu code miscalculate the address range covered by a chunk for
per_cpu_ptr_to_phys() and tlb and v[un]map flushses and has potential
to cause weird issues especially on virtual cache architectures.
This problem was discovered by CAI Qian during kvm kdump testing.
Kudos to him for finding this subtle problem.
Thanks.
Tejun Heo (1):
percpu: fix pcpu_last_unit_cpu
mm/percpu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/percpu.c b/mm/percpu.c
index 58c572b..c76ef38 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -1401,9 +1401,9 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
if (pcpu_first_unit_cpu == NR_CPUS)
pcpu_first_unit_cpu = cpu;
+ pcpu_last_unit_cpu = cpu;
}
}
- pcpu_last_unit_cpu = cpu;
pcpu_nr_units = unit;
for_each_possible_cpu(cpu)
reply other threads:[~2010-09-23 8:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4C9B168A.9000702@kernel.org \
--to=tj@kernel.org \
--cc=caiqian@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.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