android_kernel_samsung_msm8976/include/asm-x86_64
Andi Kleen a2f1b42490 [PATCH] x86_64: Add 4GB DMA32 zone
Add a new 4GB GFP_DMA32 zone between the GFP_DMA and GFP_NORMAL zones.

As a bit of historical background: when the x86-64 port
was originally designed we had some discussion if we should
use a 16MB DMA zone like i386 or a 4GB DMA zone like IA64 or
both. Both was ruled out at this point because it was in early
2.4 when VM is still quite shakey and had bad troubles even
dealing with one DMA zone.  We settled on the 16MB DMA zone mainly
because we worried about older soundcards and the floppy.

But this has always caused problems since then because
device drivers had trouble getting enough DMA able memory. These days
the VM works much better and the wide use of NUMA has proven
it can deal with many zones successfully.

So this patch adds both zones.

This helps drivers who need a lot of memory below 4GB because
their hardware is not accessing more (graphic drivers - proprietary
and free ones, video frame buffer drivers, sound drivers etc.).
Previously they could only use IOMMU+16MB GFP_DMA, which
was not enough memory.

Another common problem is that hardware who has full memory
addressing for >4GB misses it for some control structures in memory
(like transmit rings or other metadata).  They tended to allocate memory
in the 16MB GFP_DMA or the IOMMU/swiotlb then using pci_alloc_consistent,
but that can tie up a lot of precious 16MB GFPDMA/IOMMU/swiotlb memory
(even on AMD systems the IOMMU tends to be quite small) especially if you have
many devices.  With the new zone pci_alloc_consistent can just put
this stuff into memory below 4GB which works better.

One argument was still if the zone should be 4GB or 2GB. The main
motivation for 2GB would be an unnamed not so unpopular hardware
raid controller (mostly found in older machines from a particular four letter
company) who has a strange 2GB restriction in firmware. But
that one works ok with swiotlb/IOMMU anyways, so it doesn't really
need GFP_DMA32. I chose 4GB to be compatible with IA64 and because
it seems to be the most common restriction.

The new zone is so far added only for x86-64.

For other architectures who don't set up this
new zone nothing changes. Architectures can set a compatibility
define in Kconfig CONFIG_DMA_IS_DMA32 that will define GFP_DMA32
as GFP_DMA. Otherwise it's a nop because on 32bit architectures
it's normally not needed because GFP_NORMAL (=0) is DMA able
enough.

One problem is still that GFP_DMA means different things on different
architectures. e.g. some drivers used to have #ifdef ia64  use GFP_DMA
(trusting it to be 4GB) #elif __x86_64__ (use other hacks like
the swiotlb because 16MB is not enough) ... . This was quite
ugly and is now obsolete.

These should be now converted to use GFP_DMA32 unconditionally. I haven't done
this yet. Or best only use pci_alloc_consistent/dma_alloc_coherent
which will use GFP_DMA32 transparently.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-14 19:55:13 -08:00
..
8253pit.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
a.out.h [PATCH] x86_64: TASK_SIZE fixes for compatibility mode processes 2005-06-21 18:46:12 -07:00
acpi.h [ACPI] delete CONFIG_ACPI_PCI 2005-08-25 12:40:44 -04:00
agp.h [PATCH] AGP fix for Xen VMM 2005-06-07 12:35:43 -07:00
apic.h [PATCH] x86-64: i386/x86-64: Fix time going twice as fast problem on ATI Xpress chipsets 2005-09-12 10:50:58 -07:00
apicdef.h [PATCH] x86-64: Support dualcore and 8 socket systems in k8 fallback node parsing 2005-09-12 10:49:56 -07:00
atomic.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
auxvec.h [PATCH] auxiliary vector cleanups 2005-09-07 16:57:21 -07:00
bitops.h [PATCH] x86_64: Fix gcc 4 warning in sched_find_first_bit 2005-07-28 21:46:02 -07:00
boot.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
bootsetup.h [PATCH] Increase number of e820 entries hard limit from 32 to 128 2005-05-01 08:58:51 -07:00
bug.h [PATCH] x86-64: reduce x86-64 bug frame by 4 bytes 2005-09-12 10:50:58 -07:00
bugs.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
byteorder.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
cache.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
cacheflush.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
calling.h [PATCH] x86-64: Fix CFI information 2005-09-12 10:50:56 -07:00
checksum.h [NET]: Fix ipl=>ihl typo in ip_fast_csum 2005-08-29 16:02:48 -07:00
compat.h [PATCH] compat: be more consistent about [ug]id_t 2005-09-07 16:57:19 -07:00
cpu.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
cpufeature.h [PATCH] CPUID bug and inconsistency fix 2005-05-01 08:58:49 -07:00
cputime.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
current.h kbuild: alpha,x86_64 use generic asm-offsets.h support 2005-09-09 21:28:48 +02:00
debugreg.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
delay.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
desc.h [PATCH] x86_64: desc.h-needs smp.h 2005-09-17 11:50:01 -07:00
div64.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
dma-mapping.h manual update from upstream: 2005-10-31 10:51:57 -08:00
dma.h [PATCH] x86_64: Add 4GB DMA32 zone 2005-11-14 19:55:13 -08:00
dwarf2.h [PATCH] x86-64: Fix CFI information 2005-09-12 10:50:56 -07:00
e820.h [PATCH] x86_64: Tell VM about holes in nodes 2005-08-26 19:37:12 -07:00
elf.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
emergency-restart.h [PATCH] x86_64: Implemenent machine_emergency_restart 2005-07-26 14:35:42 -07:00
errno.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
fcntl.h [PATCH] Clean up struct flock definitions 2005-09-07 16:57:38 -07:00
fixmap.h [PATCH] Replace extern inline with static inline in asm-x86_64/* 2005-09-12 10:50:56 -07:00
floppy.h [PATCH] make some things static 2005-05-05 16:36:47 -07:00
fpu32.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
futex.h [PATCH] FUTEX_WAKE_OP: pthread_cond_signal() speedup 2005-09-07 16:57:17 -07:00
genapic.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
hardirq.h [PATCH] x86-64: Some cleanup and optimization to the processor data area. 2005-09-12 10:49:58 -07:00
hpet.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
hw_irq.h [PATCH] x86-64: Declare NMI_VECTOR and handle it in the IPI sending code. 2005-09-12 10:50:57 -07:00
i387.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ia32.h [PATCH] compat: introduce compat_time_t 2005-06-23 09:45:32 -07:00
ia32_unistd.h [PATCH] inotify: add x86-64 syscall entries 2005-07-26 13:37:22 -07:00
ide.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
io.h [PATCH] Replace extern inline with static inline in asm-x86_64/* 2005-09-12 10:50:56 -07:00
io_apic.h [ACPI] delete CONFIG_ACPI_BOOT 2005-08-24 12:08:54 -04:00
ioctl.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ioctls.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ipcbuf.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ipi.h [PATCH] x86-64: Declare NMI_VECTOR and handle it in the IPI sending code. 2005-09-12 10:50:57 -07:00
irq.h [PATCH] remove unnecessary handle_IRQ_event() prototypes 2005-09-09 13:57:33 -07:00
kdebug.h [PATCH] x86-64: Safe interrupts in oops_begin/end 2005-09-12 10:50:57 -07:00
kexec.h [PATCH] Kdump: Export crash notes section address through sysfs 2005-06-25 16:24:51 -07:00
kmap_types.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
kprobes.h [PATCH] x86_64 specific function return probes 2005-06-23 09:45:21 -07:00
ldt.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
linkage.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
local.h [PATCH] x86-64: clean up local_add/sub arguments 2005-09-12 10:50:59 -07:00
mach_apic.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mc146818rtc.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mce.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mman.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mmsegment.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mmu.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mmu_context.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mmx.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mmzone.h [PATCH] Increase nodemap hash. 2005-09-12 10:50:55 -07:00
module.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mpspec.h [ACPI] delete CONFIG_ACPI_BOOT 2005-08-24 12:08:54 -04:00
msgbuf.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
msi.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
msr.h [PATCH] Fix up TLB flush filter disabling 2005-09-29 15:41:42 -07:00
mtrr.h [PATCH] Clean up mtrr compat ioctl code 2005-10-30 17:37:13 -08:00
namei.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
nmi.h [PATCH] x86_64: Collected NMI watchdog fixes. 2005-05-17 07:59:16 -07:00
node.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
numa.h [PATCH] x86-64: Use ACPI PXM to parse PCI<->node assignments 2005-09-12 10:49:57 -07:00
numnodes.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
page.h [PATCH] x86-64: Remove redundant max_mapnr and replace with end_pfn 2005-09-12 10:49:57 -07:00
param.h [PATCH] i386: Selectable Frequency of the Timer Interrupt 2005-06-23 09:45:10 -07:00
parport.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
pci-direct.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
pci.h Revert "x86-64: Avoid unnecessary double bouncing for swiotlb" 2005-10-27 16:28:39 -07:00
pda.h [PATCH] x86-64: Some cleanup and optimization to the processor data area. 2005-09-12 10:49:58 -07:00
percpu.h [PATCH] adjust per_cpu definition in non-SMP case 2005-06-23 09:45:28 -07:00
pgalloc.h [PATCH] Replace extern inline with static inline in asm-x86_64/* 2005-09-12 10:50:56 -07:00
pgtable.h [PATCH] vm: remove unused/broken page_pte[_prot] macros 2005-10-30 17:37:22 -08:00
poll.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
posix_types.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
prctl.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
processor.h [PATCH] x86-64: Set the stack pointer correctly in init_thread and init_tss 2005-09-12 10:50:57 -07:00
proto.h [PATCH] x86_64: Add 4GB DMA32 zone 2005-11-14 19:55:13 -08:00
ptrace.h [PATCH] xen: x86: Rename usermode macro 2005-06-23 09:45:14 -07:00
resource.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
rtc.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
rwlock.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
rwsem.h [PATCH] add sem_is_read/write_locked() 2005-10-29 21:40:35 -07:00
scatterlist.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
seccomp.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
sections.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
segment.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
semaphore.h [PATCH] semaphore: Remove __MUTEX_INITIALIZER() 2005-10-30 17:37:27 -08:00
sembuf.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
serial.h [PATCH] Serial: Split 8250 port table (part 2) 2005-06-29 18:45:19 +01:00
setup.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
shmbuf.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
shmparam.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
sigcontext.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
sigcontext32.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
siginfo.h [PATCH] consolidate SIGEV_PAD_SIZE 2005-05-01 08:59:08 -07:00
signal.h [PATCH] Replace extern inline with static inline in asm-x86_64/* 2005-09-12 10:50:56 -07:00
smp.h [PATCH] x86_64: Allocate cpu local data for all possible CPUs 2005-10-10 16:33:25 -07:00
socket.h [NET]: Introduce SO_{SND,RCV}BUFFORCE socket options 2005-08-29 15:31:35 -07:00
sockios.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
sparsemem.h [PATCH] add x86-64 specific support for sparsemem 2005-06-23 09:45:07 -07:00
spinlock.h [PATCH] spinlock consolidation 2005-09-10 10:06:21 -07:00
spinlock_types.h [PATCH] spinlock consolidation 2005-09-10 10:06:21 -07:00
stat.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
statfs.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
string.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
suspend.h [PATCH] swsusp: clean assembly parts 2005-06-25 16:24:33 -07:00
swiotlb.h manual update from upstream: 2005-10-31 10:51:57 -08:00
system.h [PATCH] x86-64: Lose constraints on cmpxchg 2005-09-12 10:50:57 -07:00
termbits.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
termios.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
thread_info.h [PATCH] streamline preempt_count type across archs 2005-06-23 09:45:19 -07:00
timex.h [PATCH] x86-64: Don't include config.h in asm/timex.h 2005-09-12 10:49:58 -07:00
tlb.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
tlbflush.h [PATCH] x86-64: Increase TLB flush array size 2005-09-12 10:49:58 -07:00
topology.h [PATCH] x86-64: Use ACPI PXM to parse PCI<->node assignments 2005-09-12 10:49:57 -07:00
types.h [PATCH] sab: consolidate kmem_bufctl_t 2005-09-05 00:05:48 -07:00
uaccess.h [PATCH] remove verify_area(): remove verify_area() from various uaccess.h headers 2005-09-07 16:57:35 -07:00
ucontext.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
unaligned.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
unistd.h [PATCH] unify sys_ptrace prototype 2005-10-30 17:37:20 -08:00
user.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
user32.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
vga.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
vsyscall.h [PATCH] x86-64: Remove unused vxtime.hz field 2005-09-12 10:50:57 -07:00
vsyscall32.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
xor.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00