dect
/
linux-2.6
Archived
13
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/include
Andrea Arcangeli e4eed03fd0 thp: avoid atomic64_read in pmd_read_atomic for 32bit PAE
In the x86 32bit PAE CONFIG_TRANSPARENT_HUGEPAGE=y case while holding the
mmap_sem for reading, cmpxchg8b cannot be used to read pmd contents under
Xen.

So instead of dealing only with "consistent" pmdvals in
pmd_none_or_trans_huge_or_clear_bad() (which would be conceptually
simpler) we let pmd_none_or_trans_huge_or_clear_bad() deal with pmdvals
where the low 32bit and high 32bit could be inconsistent (to avoid having
to use cmpxchg8b).

The only guarantee we get from pmd_read_atomic is that if the low part of
the pmd was found null, the high part will be null too (so the pmd will be
considered unstable).  And if the low part of the pmd is found "stable"
later, then it means the whole pmd was read atomically (because after a
pmd is stable, neither MADV_DONTNEED nor page faults can alter it anymore,
and we read the high part after the low part).

In the 32bit PAE x86 case, it is enough to read the low part of the pmdval
atomically to declare the pmd as "stable" and that's true for THP and no
THP, furthermore in the THP case we also have a barrier() that will
prevent any inconsistent pmdvals to be cached by a later re-read of the
*pmd.

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Cc: Jonathan Nieder <jrnieder@gmail.com>
Cc: Ulrich Obergfell <uobergfe@redhat.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Hugh Dickins <hughd@google.com>
Cc: Larry Woodman <lwoodman@redhat.com>
Cc: Petr Matousek <pmatouse@redhat.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Tested-by: Andrew Jones <drjones@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-06-20 14:39:35 -07:00
..
acpi ACPI: fix acpi_bus.h build warnings when ACPI is not enabled 2012-06-04 00:29:11 -04:00
asm-generic thp: avoid atomic64_read in pmd_read_atomic for 32bit PAE 2012-06-20 14:39:35 -07:00
crypto
drm drm: increase DRM_OBJECT_MAX_PROPERTY to 24 2012-06-12 15:36:31 +01:00
keys
linux mm: fix slab->page _count corruption when using slub 2012-06-20 14:39:35 -07:00
math-emu
media [media] patch for Asus My Cinema PS3-100 (1043:48cd) 2012-05-20 16:05:02 -03:00
memory
misc
mtd UBI: amend commentaries WRT dtype 2012-05-20 20:25:59 +03:00
net bonding: Fix corrupted queue_mapping 2012-06-12 15:29:21 -07:00
pcmcia
rdma Merge branches 'core', 'cxgb4', 'ipath', 'iser', 'lockdep', 'mlx4', 'nes', 'ocrdma', 'qib' and 'raw-qp' into for-linus 2012-05-21 09:00:47 -07:00
rxrpc
scsi [SCSI] fcoe, bnx2fc, libfcoe: SW FCoE and bnx2fc use FCoE Syfs 2012-05-23 09:43:13 +01:00
sound ASoC: Last minute updates 2012-05-22 02:58:55 +02:00
target target: Add TFO->put_session() caller for HW fabric session shutdown 2012-06-12 19:33:05 -07:00
trace rcu: Update RCU_FAST_NO_HZ tracing for lazy callbacks 2012-06-06 20:43:27 -07:00
video fbdev updates for 3.5 2012-06-01 16:57:51 -07:00
xen xen: do not map the same GSI twice in PVHVM guests. 2012-05-21 14:11:36 -04:00
Kbuild