kernel-hacking-2024-linux-s.../mm
Nick Piggin 31a12666d8 mm: write_cache_pages cyclic fix
In write_cache_pages, scanned == 1 is supposed to mean that cyclic
writeback has circled through zero, thus we should not circle again.
However it gets set to 1 after the first successful pagevec lookup.  This
leads to cases where not enough data gets written.

Counterexample: file with first 10 pages dirty, writeback_index == 5,
nr_to_write == 10.  Then the 5 last pages will be found, and scanned will
be set to 1, after writing those out, we will not cycle back to get the
first 5.

Rework this logic, now we'll always cycle unless we started off from index
0.  When cycling, only write out as far as 1 page before the start page
from the first cycle (so we don't write parts of the file twice).

Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Chris Mason <chris.mason@oracle.com>
Cc: Dave Chinner <david@fromorbit.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06 15:58:59 -08:00
..
allocpercpu.c
backing-dev.c mm/backing-dev.c: remove recently-added WARN_ON() 2008-12-10 08:01:52 -08:00
bootmem.c misc: replace __FUNCTION__ with __func__ 2008-10-16 11:21:30 -07:00
bounce.c bounce: don't rely on a zeroed bio_vec list 2008-12-29 08:29:52 +01:00
dmapool.c
fadvise.c Remove Andrew Morton's old email accounts 2008-10-16 11:21:32 -07:00
failslab.c SLUB: failslab support 2008-12-29 11:27:46 +02:00
filemap.c mm: don't mark_page_accessed in fault path 2009-01-06 15:58:58 -08:00
filemap_xip.c
fremap.c mmap: handle mlocked pages during map, remap, unmap 2008-10-20 08:52:31 -07:00
highmem.c
hugetlb.c mm: report the MMU pagesize in /proc/pid/smaps 2009-01-06 15:58:58 -08:00
internal.h hugetlb: pull gigantic page initialisation out of the default path 2008-11-06 15:41:18 -08:00
Kconfig Unevictable LRU Infrastructure 2008-10-20 08:50:26 -07:00
maccess.c
madvise.c
Makefile SLUB: failslab support 2008-12-29 11:27:46 +02:00
memcontrol.c memcg: fix page_cgroup allocation 2008-10-23 08:55:02 -07:00
memory.c mm: don't mark_page_accessed in fault path 2009-01-06 15:58:58 -08:00
memory_hotplug.c meminit section warnings 2008-11-30 10:03:35 -08:00
mempolicy.c Merge branch 'master' into next 2008-11-14 11:29:12 +11:00
mempool.c
migrate.c mm: move_pages: no need to set pp->page to ZERO_PAGE(0) by default 2009-01-06 15:58:58 -08:00
mincore.c
mlock.c x86, bts: memory accounting 2008-12-20 09:15:47 +01:00
mm_init.c
mmap.c mm: update my address 2009-01-05 17:44:42 -08:00
mmu_notifier.c
mmzone.c
mprotect.c mm: update my address 2009-01-05 17:44:42 -08:00
mremap.c mm: update my address 2009-01-05 17:44:42 -08:00
msync.c add a vfs_fsync helper 2009-01-05 11:54:28 -05:00
nommu.c inode->i_op is never NULL 2009-01-05 11:54:28 -05:00
oom_kill.c oom: print triggering task's cpuset and mems allowed 2009-01-06 15:58:59 -08:00
page-writeback.c mm: write_cache_pages cyclic fix 2009-01-06 15:58:59 -08:00
page_alloc.c cpusets: update mems allowed in page allocator 2008-11-12 17:17:16 -08:00
page_cgroup.c page_cgroup should ignore empty nodes 2008-12-10 08:01:53 -08:00
page_io.c
page_isolation.c memory hotplug: fix page_zone() calculation in test_pages_isolated() 2008-11-06 15:41:19 -08:00
pagewalk.c
pdflush.c cpumask: convert mm/ 2009-01-01 10:12:29 +10:30
prio_tree.c
quicklist.c
readahead.c vmscan: split LRU lists into anon & file sets 2008-10-20 08:50:25 -07:00
rmap.c make mm/rmap.c:anon_vma_cachep static 2008-10-20 08:52:40 -07:00
shmem.c mm: don't mark_page_accessed in shmem_fault 2009-01-06 15:58:58 -08:00
shmem_acl.c
slab.c cpumask: convert mm/ 2009-01-01 10:12:29 +10:30
slob.c slob: do not pass the SLAB flags as GFP in kmem_cache_create() 2008-12-15 16:27:06 -08:00
slub.c cpumask: convert mm/ 2009-01-01 10:12:29 +10:30
sparse-vmemmap.c vmemmap: warn about page_structs with remote distance 2008-11-06 15:41:19 -08:00
sparse.c meminit section warnings 2008-11-30 10:03:35 -08:00
swap.c mm: remove UP version of lru_add_drain_all() 2008-12-10 08:01:53 -08:00
swap_state.c mm: pagecache insertion fewer atomics 2008-10-20 08:52:31 -07:00
swapfile.c x86: consolidate __swp_XXX() macros 2008-12-16 18:34:51 +01:00
thrash.c
tiny-shmem.c Export tiny shmem_file_setup for DRM-GEM 2008-10-20 16:17:42 -07:00
truncate.c mmap: handle mlocked pages during map, remap, unmap 2008-10-20 08:52:31 -07:00
util.c
vmalloc.c vmalloc.c: fix flushing in vmap_page_range() 2009-01-04 13:33:20 -08:00
vmscan.c cpumask: convert mm/ 2009-01-01 10:12:29 +10:30
vmstat.c cpumask: convert mm/ 2009-01-01 10:12:29 +10:30