]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm: add comment on storage key dirty bit semantics
authorJan Kara <jack@suse.cz>
Thu, 15 Nov 2012 02:37:19 +0000 (13:37 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 15 Nov 2012 06:25:31 +0000 (17:25 +1100)
Add comments that dirty bit in storage key gets set whenever page content
is changed.  Hopefully if someone will use this function, he'll have a
look at one of the two places where we comment on this.

Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/s390/include/asm/page.h
mm/rmap.c

index 24afd079e5cee6cc331e6bf577e8f87e5b9e9662..a86ad4084073c85b2f6307f780d07336e470db5b 100644 (file)
@@ -160,6 +160,9 @@ static inline int page_reset_referenced(unsigned long addr)
  * race against modification of the referenced bit. This function
  * should therefore only be called if it is not mapped in any
  * address space.
+ *
+ * Note that the bit gets set whenever page content is changed. That means
+ * also when the page is modified by DMA or from inside the kernel.
  */
 #define __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY
 static inline int page_test_and_clear_dirty(unsigned long pfn, int mapped)
index 46823fb0e801b599178f8bd548437fa03d87b8ef..cf7e99a87c32865c4e6cf5b6ed4f48f7f05aa9e0 100644 (file)
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1151,9 +1151,11 @@ void page_remove_rmap(struct page *page)
         * containing the swap entry, but page not yet written to swap.
         *
         * And we can skip it on file pages, so long as the filesystem
-        * participates in dirty tracking; but need to catch shm and tmpfs
-        * and ramfs pages which have been modified since creation by read
-        * fault.
+        * participates in dirty tracking (note that this is not only an
+        * optimization but also solves problems caused by dirty flag in
+        * storage key getting set by a write from inside kernel); but need to
+        * catch shm and tmpfs and ramfs pages which have been modified since
+        * creation by read fault.
         *
         * Note that mapping must be decided above, before decrementing
         * mapcount (which luckily provides a barrier): once page is unmapped,