linux-sg2042/arch/s390/mm
Martin Schwidefsky abf09bed3c s390/mm: implement software dirty bits
The s390 architecture is unique in respect to dirty page detection,
it uses the change bit in the per-page storage key to track page
modifications. All other architectures track dirty bits by means
of page table entries. This property of s390 has caused numerous
problems in the past, e.g. see git commit ef5d437f71
"mm: fix XFS oops due to dirty pages without buffers on s390".

To avoid future issues in regard to per-page dirty bits convert
s390 to a fault based software dirty bit detection mechanism. All
user page table entries which are marked as clean will be hardware
read-only, even if the pte is supposed to be writable. A write by
the user process will trigger a protection fault which will cause
the user pte to be marked as dirty and the hardware read-only bit
is removed.

With this change the dirty bit in the storage key is irrelevant
for Linux as a host, but the storage key is still required for
KVM guests. The effect is that page_test_and_clear_dirty and the
related code can be removed. The referenced bit in the storage
key is still used by the page_test_and_clear_young primitive to
provide page age information.

For page cache pages of mappings with mapping_cap_account_dirty
there will not be any change in behavior as the dirty bit tracking
already uses read-only ptes to control the amount of dirty pages.
Only for swap cache pages and pages of mappings without
mapping_cap_account_dirty there can be additional protection faults.
To avoid an excessive number of additional faults the mk_pte
primitive checks for PageDirty if the pgprot value allows for writes
and pre-dirties the pte. That avoids all additional faults for
tmpfs and shmem pages until these pages are added to the swap cache.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2013-02-14 15:55:23 +01:00
..
Makefile s390/memory hotplug: use pfmf instruction to initialize storage keys 2012-11-23 11:14:30 +01:00
cmm.c s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
dump_pagetables.c s390/mm,vmem: use 2GB frames for identity mapping 2012-11-23 11:14:24 +01:00
extable.c s390/exceptions: switch to relative exception table entries 2012-09-26 15:45:10 +02:00
extmem.c s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
fault.c s390/irq: remove split irq fields from /proc/stat 2013-01-08 10:57:07 +01:00
gup.c s390/gup: fix access_ok() usage in __get_user_pages_fast() 2012-11-13 11:02:28 +01:00
hugetlbpage.c s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
init.c s390/mm: move kernel_page_present/kernel_map_pages to page_attr.c 2012-11-23 11:14:31 +01:00
maccess.c s390/kernel: Introduce memcpy_absolute() function 2012-05-30 09:04:49 +02:00
mmap.c s390/mm: Fix crst upgrade of mmap with MAP_FIXED 2013-02-14 15:55:22 +01:00
page-states.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
pageattr.c s390/mm: implement software dirty bits 2013-02-14 15:55:23 +01:00
pgtable.c s390/mm: move kernel_page_present/kernel_map_pages to page_attr.c 2012-11-23 11:14:31 +01:00
vmem.c s390/mm: implement software dirty bits 2013-02-14 15:55:23 +01:00