public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [GIT PATCH] x86,percpu: fix pageattr handling with remap allocator
@ 2009-05-14 12:49 Tejun Heo
  2009-05-14 12:49 ` [PATCH 1/4] x86: prepare setup_pcpu_remap() for pageattr fix Tejun Heo
                   ` (7 more replies)
  0 siblings, 8 replies; 38+ messages in thread
From: Tejun Heo @ 2009-05-14 12:49 UTC (permalink / raw)
  To: JBeulich, andi, mingo, linux-kernel-owner, hpa, tglx,
	linux-kernel

Hello,

Upon ack, please pull from the following git tree.

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc.git x86-percpu-pageattr

This patchset fixes subtile bug in pageattr handling when remap percpu
first chunk allocator is in use and implements percpu_alloc kernel
parameter so that allocator can be selected from boot prompt.

This problem was spotted by Jan Beulich.

The remap allocator allocates a PMD page per cpu, returns whatever is
unnecessary to the page allocator and remaps the PMD page into vmalloc
area to construct the first percpu chunk.  This is to take advantage
of large page mapping.  However this creates active aliases for the
recycled pages.  When some user allocates the recycled pages and tries
to change pageattr on it, remapped PMD alias might end up having
different attributes with the regular page mapped addresses which can
lead to subtle data corruption according to Andi.

Similar problem exists for the high mapped area of x86_64 kernel which
is handled by detecting the alias and splitting up the high map PMD
and applying the same attributes there.  This patch implements the
same workaround for remapped first chunk.

Also, it's still unclear whether the remap allocator is worth the
trouble.  Andi thinks it would be better to simply use 4k mapping on
NUMA machines as PMD TLB is much more precious resource than PTE TLB.
To ease testing, this patch implements percpu_alloc kernel parameter
which allows explicitly selecting which allocator to use.

This patchset contains the following four patches.

 0001-x86-prepare-setup_pcpu_remap-for-pageattr-fix.patch
 0002-x86-simplify-cpa_process_alias.patch
 0003-x86-fix-pageattr-handling-for-remap-percpu-allocato.patch
 0004-x86-implement-percpu_alloc-kernel-parameter.patch

0001-0002 preps for pageattr fix.  0003 fixes the pageattr bug.  0004
implements percpu_alloc kernel parameter.

This patchset is on top of the current linux-2.6#master
(210af919c949a7d6bd330916ef376cec2907d81e) and contains the following
changes.

 Documentation/kernel-parameters.txt |    6 +
 arch/x86/include/asm/percpu.h       |    9 +
 arch/x86/kernel/setup_percpu.c      |  186 ++++++++++++++++++++++++++----------
 arch/x86/mm/pageattr.c              |   59 +++++++----
 mm/percpu.c                         |   13 +-
 5 files changed, 197 insertions(+), 76 deletions(-)

Thanks.

--
tejun

^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2009-05-22  0:57 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-14 12:49 [GIT PATCH] x86,percpu: fix pageattr handling with remap allocator Tejun Heo
2009-05-14 12:49 ` [PATCH 1/4] x86: prepare setup_pcpu_remap() for pageattr fix Tejun Heo
2009-05-14 12:49 ` [PATCH 2/4] x86: simplify cpa_process_alias() Tejun Heo
2009-05-14 14:16   ` Jan Beulich
2009-05-14 15:37     ` Tejun Heo
2009-05-14 16:20       ` [PATCH UPDATED 2/4] x86: reorganize cpa_process_alias() Tejun Heo
2009-05-14 12:49 ` [PATCH 3/4] x86: fix pageattr handling for remap percpu allocator Tejun Heo
2009-05-14 16:21   ` [PATCH UPDATED " Tejun Heo
2009-05-14 12:49 ` [PATCH 4/4] x86: implement percpu_alloc kernel parameter Tejun Heo
2009-05-14 14:28 ` [GIT PATCH] x86,percpu: fix pageattr handling with remap allocator Jan Beulich
2009-05-14 15:55   ` Tejun Heo
2009-05-15  7:47     ` Jan Beulich
2009-05-15  8:11       ` Tejun Heo
2009-05-15  8:22         ` Jan Beulich
2009-05-15  8:27           ` Tejun Heo
2009-05-14 16:22 ` Tejun Heo
2009-05-15  4:00   ` Tejun Heo
2009-05-15  4:36     ` David Miller
2009-05-15  4:48       ` Tejun Heo
2009-05-16  1:17 ` Suresh Siddha
2009-05-16 15:16   ` Tejun Heo
2009-05-16 19:09     ` Suresh Siddha
2009-05-17  1:23       ` Tejun Heo
2009-05-18 19:20         ` Suresh Siddha
2009-05-18 19:41           ` H. Peter Anvin
2009-05-18 21:07             ` Suresh Siddha
2009-05-19  1:28               ` Tejun Heo
2009-05-20 23:01                 ` Suresh Siddha
2009-05-21  0:08                   ` Tejun Heo
2009-05-21  0:36                     ` Suresh Siddha
2009-05-21  1:46                       ` Tejun Heo
2009-05-21  1:48                         ` Tejun Heo
2009-05-21 19:10                         ` Suresh Siddha
2009-05-21 23:18                           ` Tejun Heo
2009-05-22  0:55                             ` Suresh Siddha
2009-05-19  9:44 ` Tejun Heo
2009-05-20  7:54   ` Ingo Molnar
2009-05-20  7:57     ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox