summaryrefslogtreecommitdiff
path: root/fs/buffer.c
diff options
context:
space:
mode:
authorVenkat Gopalakrishnan <venkatg@codeaurora.org>2014-10-27 18:04:22 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:02:01 -0700
commita627c73479155f8f0328d7bb1d0b8c9e17b7aa88 (patch)
treeb6278e85f09ebc05c2bfb96a5482ab6952463129 /fs/buffer.c
parent014929f975fab25e65776cd2b162e667644ba044 (diff)
block/fs: make tracking dirty task debug only
Adding a new element "tsk_dirty" to struct page increases the size of mem_map/vmemmap, restrict this to a debug only functionality to save few MB of memory. Considering a system with 1G of RAM, there will be nearly 262144 pages and thus that many number of page structures in mem_map/vmemmap. With pointer size of 8 bytes on a 64 bit system, adding this pointer to "struct page" means an increase of "2MB" for mem_map. CRs-Fixed: 738692 Change-Id: Idf3217dcbe17cf1ab4d462d2aa8d39da1ffd8b13 Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org> [venkatg@codeaurora.org: Fixed trivial merge conflict] Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
Diffstat (limited to 'fs/buffer.c')
-rw-r--r--fs/buffer.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index 06fc75159808..6cd4553286b6 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -621,6 +621,18 @@ void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode)
}
EXPORT_SYMBOL(mark_buffer_dirty_inode);
+#ifdef CONFIG_BLK_DEV_IO_TRACE
+static inline void save_dirty_task(struct page *page)
+{
+ /* Save the task that is dirtying this page */
+ page->tsk_dirty = current;
+}
+#else
+static inline void save_dirty_task(struct page *page)
+{
+}
+#endif
+
/*
* Mark the page dirty, and set it dirty in the radix tree, and mark the inode
* dirty.
@@ -641,8 +653,7 @@ static void __set_page_dirty(struct page *page, struct address_space *mapping,
account_page_dirtied(page, mapping, memcg);
radix_tree_tag_set(&mapping->page_tree,
page_index(page), PAGECACHE_TAG_DIRTY);
- /* Save the task that is dirtying this page */
- page->tsk_dirty = current;
+ save_dirty_task(page);
}
spin_unlock_irqrestore(&mapping->tree_lock, flags);
}