diff for duplicates of <20100713102132.2835.45692.sendpatchset@danny.redhat> diff --git a/a/1.txt b/N1/1.txt index 5349d77..93e0814 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -164,9 +164,3 @@ index 109a970..0d7ea95 100644 -- 1.7.1.1 - --- -To unsubscribe, send a message with 'unsubscribe linux-mm' in -the body to majordomo@kvack.org. For more info on Linux MM, -see: http://www.linux-mm.org/ . -Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> diff --git a/a/content_digest b/N1/content_digest index a1c2f3f..2006712 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -181,12 +181,6 @@ " \t\t\tgoto out_unlock;\n" " \n" "-- \n" - "1.7.1.1\n" - "\n" - "--\n" - "To unsubscribe, send a message with 'unsubscribe linux-mm' in\n" - "the body to majordomo@kvack.org. For more info on Linux MM,\n" - "see: http://www.linux-mm.org/ .\n" - "Don't email: <a href=mailto:\"dont@kvack.org\"> email@kvack.org </a>" + 1.7.1.1 -db4d5c71b9a7103ea6ce77f9a4405eaefa8bd41ddc2c0238de78e8b95b6e3e23 +b258457388a92d2125f2e9f5ccdb4a4f3fd170e3aeacac17dfc79e9f2caea24c
diff --git a/a/1.txt b/N2/1.txt index 5349d77..8b13789 100644 --- a/a/1.txt +++ b/N2/1.txt @@ -1,172 +1 @@ ->From ee72952409a0b811d61f435682e6d161e3b5189b Mon Sep 17 00:00:00 2001 -From: Xiaotian Feng <dfeng@redhat.com> -Date: Tue, 13 Jul 2010 13:10:49 +0800 -Subject: [PATCH 25/30] nfs: disable data cache revalidation for swapfiles -Do as Trond suggested: - http://lkml.org/lkml/2006/8/25/348 - -Disable NFS data cache revalidation on swap files since it doesn't really -make sense to have other clients change the file while you are using it. - -Thereby we can stop setting PG_private on swap pages, since there ought to -be no further races with invalidate_inode_pages2() to deal with. - -And since we cannot set PG_private we cannot use page->private (which is -already used by PG_swapcache pages anyway) to store the nfs_page. Thus -augment the new nfs_page_find_request logic. - -Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> -Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> -Signed-off-by: Xiaotian Feng <dfeng@redhat.com> ---- - fs/nfs/inode.c | 6 +++++ - fs/nfs/write.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++--------- - 2 files changed, 63 insertions(+), 12 deletions(-) - -diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c -index 099b351..45293af 100644 ---- a/fs/nfs/inode.c -+++ b/fs/nfs/inode.c -@@ -798,6 +798,12 @@ int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping) - struct nfs_inode *nfsi = NFS_I(inode); - int ret = 0; - -+ /* -+ * swapfiles are not supposed to be shared. -+ */ -+ if (IS_SWAPFILE(inode)) -+ goto out; -+ - if ((nfsi->cache_validity & NFS_INO_REVAL_PAGECACHE) - || nfs_attribute_cache_expired(inode) - || NFS_STALE(inode)) { -diff --git a/fs/nfs/write.c b/fs/nfs/write.c -index 109a970..0d7ea95 100644 ---- a/fs/nfs/write.c -+++ b/fs/nfs/write.c -@@ -109,25 +109,62 @@ static void nfs_context_set_write_error(struct nfs_open_context *ctx, int error) - set_bit(NFS_CONTEXT_ERROR_WRITE, &ctx->flags); - } - --static struct nfs_page *nfs_page_find_request_locked(struct page *page) -+static struct nfs_page * -+__nfs_page_find_request_locked(struct nfs_inode *nfsi, struct page *page, int get) - { - struct nfs_page *req = NULL; - -- if (PagePrivate(page)) { -+ if (PagePrivate(page)) - req = (struct nfs_page *)page_private(page); -- if (req != NULL) -- kref_get(&req->wb_kref); -- } -+ else if (unlikely(PageSwapCache(page))) -+ req = radix_tree_lookup(&nfsi->nfs_page_tree, page_file_index(page)); -+ -+ if (get && req) -+ kref_get(&req->wb_kref); -+ - return req; - } - -+static inline struct nfs_page * -+nfs_page_find_request_locked(struct nfs_inode *nfsi, struct page *page) -+{ -+ return __nfs_page_find_request_locked(nfsi, page, 1); -+} -+ -+static int __nfs_page_has_request(struct page *page) -+{ -+ struct inode *inode = page_file_mapping(page)->host; -+ struct nfs_page *req = NULL; -+ -+ spin_lock(&inode->i_lock); -+ req = __nfs_page_find_request_locked(NFS_I(inode), page, 0); -+ spin_unlock(&inode->i_lock); -+ -+ /* -+ * hole here plugged by the caller holding onto PG_locked -+ */ -+ -+ return req != NULL; -+} -+ -+static inline int nfs_page_has_request(struct page *page) -+{ -+ if (PagePrivate(page)) -+ return 1; -+ -+ if (unlikely(PageSwapCache(page))) -+ return __nfs_page_has_request(page); -+ -+ return 0; -+} -+ - static struct nfs_page *nfs_page_find_request(struct page *page) - { - struct inode *inode = page_file_mapping(page)->host; - struct nfs_page *req = NULL; - - spin_lock(&inode->i_lock); -- req = nfs_page_find_request_locked(page); -+ req = nfs_page_find_request_locked(NFS_I(inode), page); - spin_unlock(&inode->i_lock); - return req; - } -@@ -230,7 +267,7 @@ static struct nfs_page *nfs_find_and_lock_request(struct page *page) - - spin_lock(&inode->i_lock); - for (;;) { -- req = nfs_page_find_request_locked(page); -+ req = nfs_page_find_request_locked(NFS_I(inode), page); - if (req == NULL) - break; - if (nfs_set_page_tag_locked(req)) -@@ -383,8 +420,14 @@ static int nfs_inode_add_request(struct inode *inode, struct nfs_page *req) - if (nfs_have_delegation(inode, FMODE_WRITE)) - nfsi->change_attr++; - } -- SetPagePrivate(req->wb_page); -- set_page_private(req->wb_page, (unsigned long)req); -+ /* -+ * Swap-space should not get truncated. Hence no need to plug the race -+ * with invalidate/truncate. -+ */ -+ if (likely(!PageSwapCache(req->wb_page))) { -+ SetPagePrivate(req->wb_page); -+ set_page_private(req->wb_page, (unsigned long)req); -+ } - nfsi->npages++; - kref_get(&req->wb_kref); - radix_tree_tag_set(&nfsi->nfs_page_tree, req->wb_index, -@@ -406,8 +449,10 @@ static void nfs_inode_remove_request(struct nfs_page *req) - BUG_ON (!NFS_WBACK_BUSY(req)); - - spin_lock(&inode->i_lock); -- set_page_private(req->wb_page, 0); -- ClearPagePrivate(req->wb_page); -+ if (likely(!PageSwapCache(req->wb_page))) { -+ set_page_private(req->wb_page, 0); -+ ClearPagePrivate(req->wb_page); -+ } - radix_tree_delete(&nfsi->nfs_page_tree, req->wb_index); - nfsi->npages--; - if (!nfsi->npages) { -@@ -575,7 +620,7 @@ static struct nfs_page *nfs_try_to_update_request(struct inode *inode, - spin_lock(&inode->i_lock); - - for (;;) { -- req = nfs_page_find_request_locked(page); -+ req = nfs_page_find_request_locked(NFS_I(inode), page); - if (req == NULL) - goto out_unlock; - --- -1.7.1.1 - --- -To unsubscribe, send a message with 'unsubscribe linux-mm' in -the body to majordomo@kvack.org. For more info on Linux MM, -see: http://www.linux-mm.org/ . -Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> diff --git a/a/content_digest b/N2/content_digest index a1c2f3f..8ec6061 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -16,177 +16,5 @@ " davem@davemloft.net\0" "\00:1\0" "b\0" - ">From ee72952409a0b811d61f435682e6d161e3b5189b Mon Sep 17 00:00:00 2001\n" - "From: Xiaotian Feng <dfeng@redhat.com>\n" - "Date: Tue, 13 Jul 2010 13:10:49 +0800\n" - "Subject: [PATCH 25/30] nfs: disable data cache revalidation for swapfiles\n" - "\n" - "Do as Trond suggested:\n" - " http://lkml.org/lkml/2006/8/25/348\n" - "\n" - "Disable NFS data cache revalidation on swap files since it doesn't really\n" - "make sense to have other clients change the file while you are using it.\n" - "\n" - "Thereby we can stop setting PG_private on swap pages, since there ought to\n" - "be no further races with invalidate_inode_pages2() to deal with.\n" - "\n" - "And since we cannot set PG_private we cannot use page->private (which is\n" - "already used by PG_swapcache pages anyway) to store the nfs_page. Thus\n" - "augment the new nfs_page_find_request logic.\n" - "\n" - "Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>\n" - "Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>\n" - "Signed-off-by: Xiaotian Feng <dfeng@redhat.com>\n" - "---\n" - " fs/nfs/inode.c | 6 +++++\n" - " fs/nfs/write.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++---------\n" - " 2 files changed, 63 insertions(+), 12 deletions(-)\n" - "\n" - "diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c\n" - "index 099b351..45293af 100644\n" - "--- a/fs/nfs/inode.c\n" - "+++ b/fs/nfs/inode.c\n" - "@@ -798,6 +798,12 @@ int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping)\n" - " \tstruct nfs_inode *nfsi = NFS_I(inode);\n" - " \tint ret = 0;\n" - " \n" - "+\t/*\n" - "+\t * swapfiles are not supposed to be shared.\n" - "+\t */\n" - "+\tif (IS_SWAPFILE(inode))\n" - "+\t\tgoto out;\n" - "+\n" - " \tif ((nfsi->cache_validity & NFS_INO_REVAL_PAGECACHE)\n" - " \t\t\t|| nfs_attribute_cache_expired(inode)\n" - " \t\t\t|| NFS_STALE(inode)) {\n" - "diff --git a/fs/nfs/write.c b/fs/nfs/write.c\n" - "index 109a970..0d7ea95 100644\n" - "--- a/fs/nfs/write.c\n" - "+++ b/fs/nfs/write.c\n" - "@@ -109,25 +109,62 @@ static void nfs_context_set_write_error(struct nfs_open_context *ctx, int error)\n" - " \tset_bit(NFS_CONTEXT_ERROR_WRITE, &ctx->flags);\n" - " }\n" - " \n" - "-static struct nfs_page *nfs_page_find_request_locked(struct page *page)\n" - "+static struct nfs_page *\n" - "+__nfs_page_find_request_locked(struct nfs_inode *nfsi, struct page *page, int get)\n" - " {\n" - " \tstruct nfs_page *req = NULL;\n" - " \n" - "-\tif (PagePrivate(page)) {\n" - "+\tif (PagePrivate(page))\n" - " \t\treq = (struct nfs_page *)page_private(page);\n" - "-\t\tif (req != NULL)\n" - "-\t\t\tkref_get(&req->wb_kref);\n" - "-\t}\n" - "+\telse if (unlikely(PageSwapCache(page)))\n" - "+\t\treq = radix_tree_lookup(&nfsi->nfs_page_tree, page_file_index(page));\n" - "+\n" - "+\tif (get && req)\n" - "+\t\tkref_get(&req->wb_kref);\n" - "+\n" - " \treturn req;\n" - " }\n" - " \n" - "+static inline struct nfs_page *\n" - "+nfs_page_find_request_locked(struct nfs_inode *nfsi, struct page *page)\n" - "+{\n" - "+\treturn __nfs_page_find_request_locked(nfsi, page, 1);\n" - "+}\n" - "+\n" - "+static int __nfs_page_has_request(struct page *page)\n" - "+{\n" - "+\tstruct inode *inode = page_file_mapping(page)->host;\n" - "+\tstruct nfs_page *req = NULL;\n" - "+\n" - "+\tspin_lock(&inode->i_lock);\n" - "+\treq = __nfs_page_find_request_locked(NFS_I(inode), page, 0);\n" - "+\tspin_unlock(&inode->i_lock);\n" - "+\n" - "+\t/*\n" - "+\t * hole here plugged by the caller holding onto PG_locked\n" - "+\t */\n" - "+\n" - "+\treturn req != NULL;\n" - "+}\n" - "+\n" - "+static inline int nfs_page_has_request(struct page *page)\n" - "+{\n" - "+\tif (PagePrivate(page))\n" - "+\t\treturn 1;\n" - "+\n" - "+\tif (unlikely(PageSwapCache(page)))\n" - "+\t\treturn __nfs_page_has_request(page);\n" - "+\n" - "+\treturn 0;\n" - "+}\n" - "+\n" - " static struct nfs_page *nfs_page_find_request(struct page *page)\n" - " {\n" - " \tstruct inode *inode = page_file_mapping(page)->host;\n" - " \tstruct nfs_page *req = NULL;\n" - " \n" - " \tspin_lock(&inode->i_lock);\n" - "-\treq = nfs_page_find_request_locked(page);\n" - "+\treq = nfs_page_find_request_locked(NFS_I(inode), page);\n" - " \tspin_unlock(&inode->i_lock);\n" - " \treturn req;\n" - " }\n" - "@@ -230,7 +267,7 @@ static struct nfs_page *nfs_find_and_lock_request(struct page *page)\n" - " \n" - " \tspin_lock(&inode->i_lock);\n" - " \tfor (;;) {\n" - "-\t\treq = nfs_page_find_request_locked(page);\n" - "+\t\treq = nfs_page_find_request_locked(NFS_I(inode), page);\n" - " \t\tif (req == NULL)\n" - " \t\t\tbreak;\n" - " \t\tif (nfs_set_page_tag_locked(req))\n" - "@@ -383,8 +420,14 @@ static int nfs_inode_add_request(struct inode *inode, struct nfs_page *req)\n" - " \t\tif (nfs_have_delegation(inode, FMODE_WRITE))\n" - " \t\t\tnfsi->change_attr++;\n" - " \t}\n" - "-\tSetPagePrivate(req->wb_page);\n" - "-\tset_page_private(req->wb_page, (unsigned long)req);\n" - "+\t/*\n" - "+\t * Swap-space should not get truncated. Hence no need to plug the race\n" - "+\t * with invalidate/truncate.\n" - "+\t */\n" - "+\tif (likely(!PageSwapCache(req->wb_page))) {\n" - "+\t\tSetPagePrivate(req->wb_page);\n" - "+\t\tset_page_private(req->wb_page, (unsigned long)req);\n" - "+\t}\n" - " \tnfsi->npages++;\n" - " \tkref_get(&req->wb_kref);\n" - " \tradix_tree_tag_set(&nfsi->nfs_page_tree, req->wb_index,\n" - "@@ -406,8 +449,10 @@ static void nfs_inode_remove_request(struct nfs_page *req)\n" - " \tBUG_ON (!NFS_WBACK_BUSY(req));\n" - " \n" - " \tspin_lock(&inode->i_lock);\n" - "-\tset_page_private(req->wb_page, 0);\n" - "-\tClearPagePrivate(req->wb_page);\n" - "+\tif (likely(!PageSwapCache(req->wb_page))) {\n" - "+\t\tset_page_private(req->wb_page, 0);\n" - "+\t\tClearPagePrivate(req->wb_page);\n" - "+\t}\n" - " \tradix_tree_delete(&nfsi->nfs_page_tree, req->wb_index);\n" - " \tnfsi->npages--;\n" - " \tif (!nfsi->npages) {\n" - "@@ -575,7 +620,7 @@ static struct nfs_page *nfs_try_to_update_request(struct inode *inode,\n" - " \tspin_lock(&inode->i_lock);\n" - " \n" - " \tfor (;;) {\n" - "-\t\treq = nfs_page_find_request_locked(page);\n" - "+\t\treq = nfs_page_find_request_locked(NFS_I(inode), page);\n" - " \t\tif (req == NULL)\n" - " \t\t\tgoto out_unlock;\n" - " \n" - "-- \n" - "1.7.1.1\n" - "\n" - "--\n" - "To unsubscribe, send a message with 'unsubscribe linux-mm' in\n" - "the body to majordomo@kvack.org. For more info on Linux MM,\n" - "see: http://www.linux-mm.org/ .\n" - "Don't email: <a href=mailto:\"dont@kvack.org\"> email@kvack.org </a>" -db4d5c71b9a7103ea6ce77f9a4405eaefa8bd41ddc2c0238de78e8b95b6e3e23 +1637acd62579e4cd1a937156dd0ed05c8f0edbe6957d9e06a70188284a2d5629
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.