linux/Documentation/filesystems
Pavel Emelyanov 0f8975ec4d mm: soft-dirty bits for user memory changes tracking
The soft-dirty is a bit on a PTE which helps to track which pages a task
writes to.  In order to do this tracking one should

  1. Clear soft-dirty bits from PTEs ("echo 4 > /proc/PID/clear_refs)
  2. Wait some time.
  3. Read soft-dirty bits (55'th in /proc/PID/pagemap2 entries)

To do this tracking, the writable bit is cleared from PTEs when the
soft-dirty bit is.  Thus, after this, when the task tries to modify a
page at some virtual address the #PF occurs and the kernel sets the
soft-dirty bit on the respective PTE.

Note, that although all the task's address space is marked as r/o after
the soft-dirty bits clear, the #PF-s that occur after that are processed
fast.  This is so, since the pages are still mapped to physical memory,
and thus all the kernel does is finds this fact out and puts back
writable, dirty and soft-dirty bits on the PTE.

Another thing to note, is that when mremap moves PTEs they are marked
with soft-dirty as well, since from the user perspective mremap modifies
the virtual memory at mremap's new address.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Cc: Glauber Costa <glommer@parallels.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-07-03 16:07:26 -07:00
..
caching FS-Cache: Provide proper invalidation 2012-12-20 22:04:07 +00:00
configfs configfs: convert to umode_t 2012-01-03 22:54:57 -05:00
nfs SUNRPC: Use gssproxy upcall for server RPCGSS authentication. 2013-04-26 11:41:28 -04:00
pohmelfs Documentation: Fix multiple typo in Documentation 2012-03-07 16:08:24 +01:00
00-INDEX Introduce a new file system, Flash-Friendly File System (F2FS), to Linux 3.8. 2012-12-20 13:54:52 -08:00
9p.txt 9p: fix 9p.txt to advertise msize instead of maxdata 2011-10-24 11:13:12 -05:00
Locking Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-07-03 09:10:19 -07:00
Makefile Documentation/fs/: split txt and source files 2010-03-12 15:52:35 -08:00
adfs.txt adfs: add hexadecimal filetype suffix option 2011-03-22 17:44:17 -07:00
affs.txt Documentation: update broken web addresses. 2010-08-04 15:21:40 +02:00
afs.txt
autofs4-mount-control.txt Fix common misspellings 2011-03-31 11:26:23 -03:00
automount-support.txt
befs.txt Documentation: befs.txt: no maintainer, orphaned 2011-08-13 18:34:03 -07:00
bfs.txt
btrfs.txt btrfs: document mount options in Documentation/fs/btrfs.txt 2013-05-06 15:54:26 -04:00
ceph.txt ceph: enable/disable dentry complete flags via mount option 2012-01-12 11:00:40 -08:00
cifs.txt
coda.txt
cramfs.txt
debugfs.txt debugfs: more tightly restrict default mount mode 2012-08-27 13:42:02 -07:00
devpts.txt
directory-locking
dlmfs.txt Documentation/: it's -> its where appropriate 2010-04-23 02:09:52 +02:00
dnotify.txt Documentation/fs/: split txt and source files 2010-03-12 15:52:35 -08:00
dnotify_test.c Documentation/fs/: split txt and source files 2010-03-12 15:52:35 -08:00
ecryptfs.txt
efivarfs.txt efivarfs: Add documentation for the EFI variable filesystem 2012-10-30 10:39:18 +00:00
exofs.txt exofs: Add option to mount by osdname 2011-03-15 15:02:51 +02:00
ext2.txt
ext3.txt ext3: update documentation with barrier=1 default 2012-04-11 11:12:45 +02:00
ext4.txt ext4: introduce reserved space 2013-04-09 22:11:22 -04:00
f2fs.txt f2fs: add remount_fs callback support 2013-06-17 21:17:55 +09:00
fiemap.txt Documentation/: it's -> its where appropriate 2010-04-23 02:09:52 +02:00
files.txt Wrap accesses to the fd_sets in struct fdtable 2012-02-19 10:30:52 -08:00
fuse.txt Documentation/: it's -> its where appropriate 2010-04-23 02:09:52 +02:00
gfs2-glocks.txt GFS2: Update glock doc to add new stats info 2012-05-10 12:41:40 +01:00
gfs2-uevents.txt Documentation: Fix multiple typo in Documentation 2012-03-07 16:08:24 +01:00
gfs2.txt GFS2: Update main gfs2 doc 2012-05-10 11:45:31 +01:00
hfs.txt Documentation: HFS is orphaned 2011-11-04 12:01:48 -07:00
hfsplus.txt
hpfs.txt Documentation/: it's -> its where appropriate 2010-04-23 02:09:52 +02:00
inotify.txt Documentation: fix inotify source file paths 2011-11-04 12:01:47 -07:00
isofs.txt Documentation: update broken web addresses. 2010-08-04 15:21:40 +02:00
jfs.txt jfs: Remove obsolete email address 2012-09-17 12:00:01 -05:00
locks.txt doc: fix broken references 2011-09-27 18:08:04 +02:00
logfs.txt fix "seperate" typos in comments 2010-05-10 11:56:30 +02:00
mandatory-locking.txt
ncpfs.txt
nilfs2.txt nilfs2: remove resize from unsupported features list 2011-07-13 16:08:59 +09:00
ntfs.txt Fix common misspellings 2011-03-31 11:26:23 -03:00
ocfs2.txt ocfs2: clean up mount option about atime in ocfs2.txt 2011-05-23 23:37:12 -07:00
omfs.txt
path-lookup.txt Fix common misspellings 2011-03-31 11:26:23 -03:00
porting [readdir] ->readdir() is gone 2013-06-29 12:57:04 +04:00
proc.txt mm: soft-dirty bits for user memory changes tracking 2013-07-03 16:07:26 -07:00
qnx6.txt Documentation: Fix typo in multiple files in Documentation 2012-04-16 14:37:13 +02:00
quota.txt
ramfs-rootfs-initramfs.txt Documentation: Fix Broken URL "freshmeat" 2012-02-21 11:43:45 +01:00
relay.txt
romfs.txt Documentation/filesystems/romfs.txt: fixing link to genromfs 2011-02-17 22:04:46 +01:00
seq_file.txt seq_file: use proc_create() in documentation 2009-12-16 07:20:07 -08:00
sharedsubtree.txt Documentation: Fix trivial typo in filesystems/sharedsubtree.txt 2010-10-25 21:18:21 -04:00
spufs.txt
squashfs.txt Squashfs: Update documentation to include xattrs 2011-12-30 01:20:24 +00:00
sysfs-pci.txt PCI: Allow read/write access to sysfs I/O port resources 2010-07-30 09:32:08 -07:00
sysfs-tagging.txt sysfs-namespaces: add a high-level Documentation file 2010-05-21 09:37:31 -07:00
sysfs.txt sysfs: propagate umode_t 2012-01-03 22:55:03 -05:00
sysv-fs.txt
tmpfs.txt mempolicy: document cpuset interaction with tmpfs mpol mount option 2010-05-25 08:06:57 -07:00
ubifs.txt UBIFS: switch self-check knobs to debugfs 2011-07-04 10:54:28 +03:00
udf.txt
ufs.txt
vfat.txt Documentation: update nfs option in filesystem/vfat.txt 2013-04-29 18:28:41 -07:00
vfs.txt Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-07-03 09:10:19 -07:00
xfs-delayed-logging-design.txt Fix common misspellings 2011-03-31 11:26:23 -03:00
xfs-self-describing-metadata.txt xfs: add metadata CRC documentation 2013-04-27 13:27:43 -05:00
xfs.txt xfs: disable noattr2/attr2 mount options for CRC enabled filesystems 2013-06-06 10:51:34 -05:00
xip.txt