Files
kernel-tenderloin-3.0/include/linux
Peter Zijlstra d08b3851da [PATCH] mm: tracking shared dirty pages
Tracking of dirty pages in shared writeable mmap()s.

The idea is simple: write protect clean shared writeable pages, catch the
write-fault, make writeable and set dirty.  On page write-back clean all the
PTE dirty bits and write protect them once again.

The implementation is a tad harder, mainly because the default
backing_dev_info capabilities were too loosely maintained.  Hence it is not
enough to test the backing_dev_info for cap_account_dirty.

The current heuristic is as follows, a VMA is eligible when:
 - its shared writeable
    (vm_flags & (VM_WRITE|VM_SHARED)) == (VM_WRITE|VM_SHARED)
 - it is not a 'special' mapping
    (vm_flags & (VM_PFNMAP|VM_INSERTPAGE)) == 0
 - the backing_dev_info is cap_account_dirty
    mapping_cap_account_dirty(vma->vm_file->f_mapping)
 - f_op->mmap() didn't change the default page protection

Page from remap_pfn_range() are explicitly excluded because their COW
semantics are already horrid enough (see vm_normal_page() in do_wp_page()) and
because they don't have a backing store anyway.

mprotect() is taught about the new behaviour as well.  However it overrides
the last condition.

Cleaning the pages on write-back is done with page_mkclean() a new rmap call.
It can be called on any page, but is currently only implemented for mapped
pages, if the page is found the be of a VMA that accounts dirty pages it will
also wrprotect the PTE.

Finally, in fs/buffers.c:try_to_free_buffers(); remove clear_page_dirty() from
under ->private_lock.  This seems to be safe, since ->private_lock is used to
serialize access to the buffers, not the page itself.  This is needed because
clear_page_dirty() will call into page_mkclean() and would thereby violate
locking order.

[dhowells@redhat.com: Provide a page_mkclean() implementation for NOMMU]
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Hugh Dickins <hugh@veritas.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-26 08:48:44 -07:00
..
2006-08-03 16:56:02 -04:00
2006-09-07 15:57:12 +01:00
2006-08-31 00:02:15 -04:00
2006-09-11 13:32:30 -04:00
2006-09-23 21:03:52 -05:00
2006-06-27 17:32:38 -07:00
2006-09-22 23:24:30 -04:00
2006-06-26 09:58:36 -07:00
2006-07-03 19:44:51 -07:00
2006-05-08 16:32:05 -07:00
2006-06-08 15:14:23 -07:00
2006-07-01 09:56:03 -07:00
2006-06-23 02:07:36 -07:00
2006-09-22 15:18:47 -07:00
2006-06-25 10:01:19 -07:00
2006-07-28 21:02:00 -07:00
2006-07-03 15:27:03 -07:00
2006-07-03 15:27:03 -07:00
2006-06-20 20:24:58 -07:00
2006-08-21 10:02:50 +02:00
2006-09-22 14:53:32 -07:00
2006-09-22 15:20:25 -07:00
2006-07-31 13:28:39 -07:00
2006-06-21 12:40:49 -07:00
2006-07-03 15:27:00 -07:00
2006-07-14 21:53:56 -07:00
2006-06-05 12:29:17 -07:00
2006-09-26 08:48:44 -07:00
2006-07-14 21:53:55 -07:00
2006-06-25 10:01:13 -07:00
2006-09-22 14:54:20 -07:00
2006-08-27 11:01:32 -07:00
2006-06-25 10:01:09 -07:00
2006-09-23 15:33:43 -05:00
2006-07-12 16:05:48 -07:00
2006-08-19 17:44:31 -04:00
2006-05-04 06:55:12 +02:00
2006-06-28 15:54:27 -07:00
2006-07-03 19:48:25 -07:00
2006-06-23 07:42:49 -07:00
2006-06-25 10:01:06 -07:00
2006-06-25 10:01:06 -07:00
2006-09-26 08:48:44 -07:00
2006-06-25 10:01:14 -07:00
2006-06-30 11:25:38 -07:00
2006-09-22 14:55:02 -07:00
2006-09-01 11:39:08 -07:00
2006-09-22 14:53:36 -07:00
2006-06-17 21:29:55 -07:00
2006-04-02 00:08:05 -05:00
2006-06-30 11:25:37 -07:00
2006-06-23 07:43:06 -07:00
2006-09-22 15:20:25 -07:00
2006-06-30 18:25:18 +02:00
2006-07-03 23:30:54 +02:00
2006-08-06 08:57:47 -07:00
2006-07-10 13:24:25 -07:00