linux/arch
Hugh Dickins fd8cfd3000 arch: fix has_transparent_hugepage()
I've just discovered that the useful-sounding has_transparent_hugepage()
is actually an architecture-dependent minefield: on some arches it only
builds if CONFIG_TRANSPARENT_HUGEPAGE=y, on others it's also there when
not, but on some of those (arm and arm64) it then gives the wrong
answer; and on mips alone it's marked __init, which would crash if
called later (but so far it has not been called later).

Straighten this out: make it available to all configs, with a sensible
default in asm-generic/pgtable.h, removing its definitions from those
arches (arc, arm, arm64, sparc, tile) which are served by the default,
adding #define has_transparent_hugepage has_transparent_hugepage to
those (mips, powerpc, s390, x86) which need to override the default at
runtime, and removing the __init from mips (but maybe that kind of code
should be avoided after init: set a static variable the first time it's
called).

Signed-off-by: Hugh Dickins <hughd@google.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Andres Lagar-Cavilla <andreslc@google.com>
Cc: Yang Shi <yang.shi@linaro.org>
Cc: Ning Qu <quning@gmail.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Vineet Gupta <vgupta@synopsys.com>		[arch/arc]
Acked-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>	[arch/s390]
Acked-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-19 19:12:14 -07:00
..
alpha This is the bulk of GPIO changes for kernel cycle v4.7: 2016-05-17 17:39:42 -07:00
arc arch: fix has_transparent_hugepage() 2016-05-19 19:12:14 -07:00
arm arch: fix has_transparent_hugepage() 2016-05-19 19:12:14 -07:00
arm64 arch: fix has_transparent_hugepage() 2016-05-19 19:12:14 -07:00
avr32 This is the bulk of GPIO changes for kernel cycle v4.7: 2016-05-17 17:39:42 -07:00
blackfin Blackfin: comment spelling s/divsor/divisor/ 2016-04-18 12:51:57 +02:00
c6x c6x: Fix misspellings in comments. 2016-04-18 12:45:53 +02:00
cris This is the bulk of GPIO changes for kernel cycle v4.7: 2016-05-17 17:39:42 -07:00
frv asm-generic changes for 4.6 2016-03-24 23:13:48 -07:00
h8300 h8300: switch EARLYCON 2016-03-25 01:45:19 +09:00
hexagon hexagon: Fix misspellings in comments. 2016-04-18 12:45:54 +02:00
ia64 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2016-05-17 17:05:30 -07:00
m32r Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-03-19 10:05:34 -07:00
m68k This is the bulk of GPIO changes for kernel cycle v4.7: 2016-05-17 17:39:42 -07:00
metag metag: mm: use hugetlb_bad_size() 2016-05-19 19:12:14 -07:00
microblaze arch, ftrace: for KASAN put hard/soft IRQ entries into separate sections 2016-03-25 16:37:42 -07:00
mips arch: fix has_transparent_hugepage() 2016-05-19 19:12:14 -07:00
mn10300 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-03-19 10:05:34 -07:00
nios2 This is the bulk of GPIO changes for kernel cycle v4.7: 2016-05-17 17:39:42 -07:00
openrisc openrisc: drop wrongly typed definition of page_to_virt() 2016-04-22 10:08:34 +01:00
parisc parisc: fix a bug when syscall number of tracee is __NR_Linux_syscalls 2016-05-06 15:09:07 +02:00
powerpc arch: fix has_transparent_hugepage() 2016-05-19 19:12:14 -07:00
s390 arch: fix has_transparent_hugepage() 2016-05-19 19:12:14 -07:00
score Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-03-19 10:05:34 -07:00
sh This is the bulk of GPIO changes for kernel cycle v4.7: 2016-05-17 17:39:42 -07:00
sparc arch: fix has_transparent_hugepage() 2016-05-19 19:12:14 -07:00
tile arch: fix has_transparent_hugepage() 2016-05-19 19:12:14 -07:00
um Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-05-17 16:26:30 -07:00
unicore32 unicore32: gpio: switch to gpiochip_add_data() 2016-03-30 10:54:15 +02:00
x86 arch: fix has_transparent_hugepage() 2016-05-19 19:12:14 -07:00
xtensa This is the bulk of GPIO changes for kernel cycle v4.7: 2016-05-17 17:39:42 -07:00
.gitignore
Kconfig