kernel-ark/include
Hugh Dickins 02098feaa4 swapin needs gfp_mask for loop on tmpfs
Building in a filesystem on a loop device on a tmpfs file can hang when
swapping, the loop thread caught in that infamous throttle_vm_writeout.

In theory this is a long standing problem, which I've either never seen in
practice, or long ago suppressed the recollection, after discounting my load
and my tmpfs size as unrealistically high.  But now, with the new aops, it has
become easy to hang on one machine.

Loop used to grab_cache_page before the old prepare_write to tmpfs, which
seems to have been enough to free up some memory for any swapin needed; but
the new write_begin lets tmpfs find or allocate the page (much nicer, since
grab_cache_page missed tmpfs pages in swapcache).

When allocating a fresh page, tmpfs respects loop's mapping_gfp_mask, which
has __GFP_IO|__GFP_FS stripped off, and throttle_vm_writeout is designed to
break out when __GFP_IO or GFP_FS is unset; but when tmfps swaps in,
read_swap_cache_async allocates with GFP_HIGHUSER_MOVABLE regardless of the
mapping_gfp_mask - hence the hang.

So, pass gfp_mask down the line from shmem_getpage to shmem_swapin to
swapin_readahead to read_swap_cache_async to add_to_swap_cache.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-05 09:44:14 -08:00
..
acpi include/acpi/: Spelling fixes 2008-02-03 17:07:16 +02:00
asm-alpha iommu sg merging: alpha: make pci_iommu respect the segment size limits 2008-02-05 09:44:10 -08:00
asm-arm gpiolib support for the PXA architecture 2008-02-05 09:44:13 -08:00
asm-avr32 gpiolib: avr32 at32ap platform support 2008-02-05 09:44:13 -08:00
asm-blackfin [NET]: Introducing socket mark socket option. 2008-01-31 19:27:19 -08:00
asm-cris [NET]: Introducing socket mark socket option. 2008-01-31 19:27:19 -08:00
asm-frv include/asm-frv/: Spelling fixes 2008-02-03 17:34:55 +02:00
asm-generic gpiolib: add gpio provider infrastructure 2008-02-05 09:44:12 -08:00
asm-h8300 [NET]: Introducing socket mark socket option. 2008-01-31 19:27:19 -08:00
asm-ia64 asm-*/compat.h: fix typo in comment 2008-02-03 16:32:51 +02:00
asm-m32r m32r: remove dead config symbols from M32R code 2008-02-05 09:44:08 -08:00
asm-m68k [NET]: Introducing socket mark socket option. 2008-01-31 19:27:19 -08:00
asm-m68knommu include/asm-m68knommu/: Spelling fixes 2008-02-03 17:38:04 +02:00
asm-mips include/asm-mips/: Spelling fixes 2008-02-03 16:57:20 +02:00
asm-parisc include/asm-parisc/: Spelling fixes 2008-02-03 17:00:11 +02:00
asm-powerpc iommu sg: powerpc: convert iommu to use the IOMMU helper 2008-02-05 09:44:11 -08:00
asm-ppc [PPC] Remove 85xx from arch/ppc 2008-01-28 08:33:10 -06:00
asm-s390 asm-*/compat.h: fix typo in comment 2008-02-03 16:32:51 +02:00
asm-sh [NET]: Introducing socket mark socket option. 2008-01-31 19:27:19 -08:00
asm-sparc [NET]: Introducing socket mark socket option. 2008-01-31 19:27:19 -08:00
asm-sparc64 asm-*/compat.h: fix typo in comment 2008-02-03 16:32:51 +02:00
asm-um git-x86: unbreak UML 2008-01-30 13:32:38 +01:00
asm-v850 [NET]: Introducing socket mark socket option. 2008-01-31 19:27:19 -08:00
asm-x86 i386: Resolve dependency of asm-i386/pgtable.h on highmem.h 2008-02-05 09:44:14 -08:00
asm-xtensa [NET]: Introducing socket mark socket option. 2008-01-31 19:27:19 -08:00
crypto [CRYPTO] api: Include sched.h for cond_resched in scatterwalk.h 2008-01-11 08:16:59 +11:00
keys
linux swapin needs gfp_mask for loop on tmpfs 2008-02-05 09:44:14 -08:00
math-emu
media include/media/: Spelling fixes 2008-02-03 17:19:47 +02:00
mtd
net [IPV6]: Reorg struct ifmcaddr6 to save some bytes 2008-02-03 04:28:54 -08:00
pcmcia pcmcia: replace kio_addr_t with unsigned int everywhere 2008-02-05 09:44:08 -08:00
rdma RDMA/cma: add support for rdma_migrate_id() 2008-01-25 14:15:32 -08:00
rxrpc
scsi include/scsi/: Spelling fixes 2008-02-03 17:47:00 +02:00
sound [ALSA] version 1.0.16rc2 2008-01-31 17:40:18 +01:00
video
xen x86: page.h: make pte_t a union to always include 2008-01-30 13:32:57 +01:00
Kbuild