* [PATCH 1/7] fb_defio: Push file_update_time() into fb_deferred_io_mkwrite()
2012-03-05 14:54 [PATCH 0/7 v3] Push file_update_time() into .page_mkwrite Jan Kara
@ 2012-03-05 14:54 ` Jan Kara
2012-03-05 14:54 ` [PATCH 2/7] fs: Push file_update_time() into __block_page_mkwrite() Jan Kara
` (6 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Jan Kara @ 2012-03-05 14:54 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-fsdevel, linux-mm, LKML, Al Viro, Christoph Hellwig,
Jan Kara, Jaya Kumar
CC: Jaya Kumar <jayalk@intworks.biz>
Signed-off-by: Jan Kara <jack@suse.cz>
---
drivers/video/fb_defio.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/video/fb_defio.c b/drivers/video/fb_defio.c
index c27e153..7a09c06 100644
--- a/drivers/video/fb_defio.c
+++ b/drivers/video/fb_defio.c
@@ -104,6 +104,8 @@ static int fb_deferred_io_mkwrite(struct vm_area_struct *vma,
deferred framebuffer IO. then if userspace touches a page
again, we repeat the same scheme */
+ file_update_time(vma->vm_file);
+
/* protect against the workqueue changing the page list */
mutex_lock(&fbdefio->lock);
--
1.7.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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/7] fs: Push file_update_time() into __block_page_mkwrite()
2012-03-05 14:54 [PATCH 0/7 v3] Push file_update_time() into .page_mkwrite Jan Kara
2012-03-05 14:54 ` [PATCH 1/7] fb_defio: Push file_update_time() into fb_deferred_io_mkwrite() Jan Kara
@ 2012-03-05 14:54 ` Jan Kara
2012-03-05 14:54 ` [PATCH 3/7] ceph: Push file_update_time() into ceph_page_mkwrite() Jan Kara
` (5 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Jan Kara @ 2012-03-05 14:54 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-fsdevel, linux-mm, LKML, Al Viro, Christoph Hellwig,
Jan Kara
Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/buffer.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/fs/buffer.c b/fs/buffer.c
index 1a30db7..5294a33 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2300,6 +2300,12 @@ int __block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
loff_t size;
int ret;
+ /*
+ * Update file times before taking page lock. We may end up failing the
+ * fault so this update may be superfluous but who really cares...
+ */
+ file_update_time(vma->vm_file);
+
lock_page(page);
size = i_size_read(inode);
if ((page->mapping != inode->i_mapping) ||
--
1.7.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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/7] ceph: Push file_update_time() into ceph_page_mkwrite()
2012-03-05 14:54 [PATCH 0/7 v3] Push file_update_time() into .page_mkwrite Jan Kara
2012-03-05 14:54 ` [PATCH 1/7] fb_defio: Push file_update_time() into fb_deferred_io_mkwrite() Jan Kara
2012-03-05 14:54 ` [PATCH 2/7] fs: Push file_update_time() into __block_page_mkwrite() Jan Kara
@ 2012-03-05 14:54 ` Jan Kara
2012-03-05 14:54 ` [PATCH 4/7] 9p: Push file_update_time() into v9fs_vm_page_mkwrite() Jan Kara
` (4 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Jan Kara @ 2012-03-05 14:54 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-fsdevel, linux-mm, LKML, Al Viro, Christoph Hellwig,
Jan Kara, Sage Weil, ceph-devel
CC: Sage Weil <sage@newdream.net>
CC: ceph-devel@vger.kernel.org
Acked-by: Sage Weil <sage@newdream.net>
Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/ceph/addr.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 173b1d2..12b139f 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -1181,6 +1181,9 @@ static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
loff_t size, len;
int ret;
+ /* Update time before taking page lock */
+ file_update_time(vma->vm_file);
+
size = i_size_read(inode);
if (off + PAGE_CACHE_SIZE <= size)
len = PAGE_CACHE_SIZE;
--
1.7.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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/7] 9p: Push file_update_time() into v9fs_vm_page_mkwrite()
2012-03-05 14:54 [PATCH 0/7 v3] Push file_update_time() into .page_mkwrite Jan Kara
` (2 preceding siblings ...)
2012-03-05 14:54 ` [PATCH 3/7] ceph: Push file_update_time() into ceph_page_mkwrite() Jan Kara
@ 2012-03-05 14:54 ` Jan Kara
2012-03-05 14:54 ` [PATCH 5/7] gfs2: Push file_update_time() into gfs2_page_mkwrite() Jan Kara
` (3 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Jan Kara @ 2012-03-05 14:54 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-fsdevel, linux-mm, LKML, Al Viro, Christoph Hellwig,
Jan Kara, Eric Van Hensbergen, Ron Minnich, Latchesar Ionkov,
v9fs-developer
CC: Eric Van Hensbergen <ericvh@gmail.com>
CC: Ron Minnich <rminnich@sandia.gov>
CC: Latchesar Ionkov <lucho@ionkov.net>
CC: v9fs-developer@lists.sourceforge.net
Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/9p/vfs_file.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index fc06fd2..dd6f7ee 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -610,6 +610,9 @@ v9fs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
p9_debug(P9_DEBUG_VFS, "page %p fid %lx\n",
page, (unsigned long)filp->private_data);
+ /* Update file times before taking page lock */
+ file_update_time(filp);
+
v9inode = V9FS_I(inode);
/* make sure the cache has finished storing the page */
v9fs_fscache_wait_on_page_write(inode, page);
--
1.7.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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 5/7] gfs2: Push file_update_time() into gfs2_page_mkwrite()
2012-03-05 14:54 [PATCH 0/7 v3] Push file_update_time() into .page_mkwrite Jan Kara
` (3 preceding siblings ...)
2012-03-05 14:54 ` [PATCH 4/7] 9p: Push file_update_time() into v9fs_vm_page_mkwrite() Jan Kara
@ 2012-03-05 14:54 ` Jan Kara
2012-03-05 14:54 ` [PATCH 6/7] sysfs: Push file_update_time() into bin_page_mkwrite() Jan Kara
` (2 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: Jan Kara @ 2012-03-05 14:54 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-fsdevel, linux-mm, LKML, Al Viro, Christoph Hellwig,
Jan Kara, Steven Whitehouse, cluster-devel
CC: Steven Whitehouse <swhiteho@redhat.com>
CC: cluster-devel@redhat.com
Acked-by: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/gfs2/file.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index c5fb359..1f03531 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -375,6 +375,9 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
*/
vfs_check_frozen(inode->i_sb, SB_FREEZE_WRITE);
+ /* Update file times before taking page lock */
+ file_update_time(vma->vm_file);
+
gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
ret = gfs2_glock_nq(&gh);
if (ret)
--
1.7.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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 6/7] sysfs: Push file_update_time() into bin_page_mkwrite()
2012-03-05 14:54 [PATCH 0/7 v3] Push file_update_time() into .page_mkwrite Jan Kara
` (4 preceding siblings ...)
2012-03-05 14:54 ` [PATCH 5/7] gfs2: Push file_update_time() into gfs2_page_mkwrite() Jan Kara
@ 2012-03-05 14:54 ` Jan Kara
2012-03-05 14:54 ` [PATCH 7/7] mm: Update file times from fault path only if .page_mkwrite is not set Jan Kara
2012-03-11 20:23 ` [PATCH 0/7 v3] Push file_update_time() into .page_mkwrite Kamal Mostafa
7 siblings, 0 replies; 10+ messages in thread
From: Jan Kara @ 2012-03-05 14:54 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-fsdevel, linux-mm, LKML, Al Viro, Christoph Hellwig,
Jan Kara, Greg Kroah-Hartman
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/sysfs/bin.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c
index a475983..614b2b5 100644
--- a/fs/sysfs/bin.c
+++ b/fs/sysfs/bin.c
@@ -228,6 +228,8 @@ static int bin_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
ret = 0;
if (bb->vm_ops->page_mkwrite)
ret = bb->vm_ops->page_mkwrite(vma, vmf);
+ else
+ file_update_time(file);
sysfs_put_active(attr_sd);
return ret;
--
1.7.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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 7/7] mm: Update file times from fault path only if .page_mkwrite is not set
2012-03-05 14:54 [PATCH 0/7 v3] Push file_update_time() into .page_mkwrite Jan Kara
` (5 preceding siblings ...)
2012-03-05 14:54 ` [PATCH 6/7] sysfs: Push file_update_time() into bin_page_mkwrite() Jan Kara
@ 2012-03-05 14:54 ` Jan Kara
2012-03-11 20:23 ` [PATCH 0/7 v3] Push file_update_time() into .page_mkwrite Kamal Mostafa
7 siblings, 0 replies; 10+ messages in thread
From: Jan Kara @ 2012-03-05 14:54 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-fsdevel, linux-mm, LKML, Al Viro, Christoph Hellwig,
Jan Kara
Filesystems wanting to properly support freezing need to have control
when file_update_time() is called. After pushing file_update_time()
to all relevant .page_mkwrite implementations we can just stop calling
file_update_time() when filesystem implements .page_mkwrite.
Signed-off-by: Jan Kara <jack@suse.cz>
---
mm/memory.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/mm/memory.c b/mm/memory.c
index fa2f04e..1dfe9a1 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2621,6 +2621,9 @@ reuse:
if (!page_mkwrite) {
wait_on_page_locked(dirty_page);
set_page_dirty_balance(dirty_page, page_mkwrite);
+ /* file_update_time outside page_lock */
+ if (vma->vm_file)
+ file_update_time(vma->vm_file);
}
put_page(dirty_page);
if (page_mkwrite) {
@@ -2638,10 +2641,6 @@ reuse:
}
}
- /* file_update_time outside page_lock */
- if (vma->vm_file)
- file_update_time(vma->vm_file);
-
return ret;
}
@@ -3310,12 +3309,13 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
if (dirty_page) {
struct address_space *mapping = page->mapping;
+ int dirtied = 0;
if (set_page_dirty(dirty_page))
- page_mkwrite = 1;
+ dirtied = 1;
unlock_page(dirty_page);
put_page(dirty_page);
- if (page_mkwrite && mapping) {
+ if ((dirtied || page_mkwrite) && mapping) {
/*
* Some device drivers do not set page.mapping but still
* dirty their pages
@@ -3324,7 +3324,7 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
}
/* file_update_time outside page_lock */
- if (vma->vm_file)
+ if (vma->vm_file && !page_mkwrite)
file_update_time(vma->vm_file);
} else {
unlock_page(vmf.page);
--
1.7.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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 0/7 v3] Push file_update_time() into .page_mkwrite
2012-03-05 14:54 [PATCH 0/7 v3] Push file_update_time() into .page_mkwrite Jan Kara
` (6 preceding siblings ...)
2012-03-05 14:54 ` [PATCH 7/7] mm: Update file times from fault path only if .page_mkwrite is not set Jan Kara
@ 2012-03-11 20:23 ` Kamal Mostafa
2012-03-12 8:22 ` Jan Kara
7 siblings, 1 reply; 10+ messages in thread
From: Kamal Mostafa @ 2012-03-11 20:23 UTC (permalink / raw)
To: Jan Kara
Cc: Andrew Morton, linux-fsdevel, linux-mm, LKML, Al Viro,
Christoph Hellwig, Jaya Kumar, Sage Weil, ceph-devel,
Eric Van Hensbergen, Ron Minnich, Latchesar Ionkov,
v9fs-developer, Steven Whitehouse, cluster-devel,
Greg Kroah-Hartman
[-- Attachment #1: Type: text/plain, Size: 694 bytes --]
On Mon, 2012-03-05 at 15:54 +0100, Jan Kara wrote:
> Hello,
>
> to provide reliable support for filesystem freezing, filesystems need to have
> complete control over when metadata is changed. [...]
This patch set has been tested at Canonical along with the testing for
"[PATCH 00/19] Fix filesystem freezing deadlocks".
Please add the following endorsements for these patches (those actually
exercised by our test case): 1, 2, 6, 7
Tested-by: Kamal Mostafa <kamal@canonical.com>
Tested-by: Peter M. Petrakis <peter.petrakis@canonical.com>
Tested-by: Dann Frazier <dann.frazier@canonical.com>
Tested-by: Massimo Morana <massimo.morana@canonical.com>
-Kamal
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/7 v3] Push file_update_time() into .page_mkwrite
2012-03-11 20:23 ` [PATCH 0/7 v3] Push file_update_time() into .page_mkwrite Kamal Mostafa
@ 2012-03-12 8:22 ` Jan Kara
0 siblings, 0 replies; 10+ messages in thread
From: Jan Kara @ 2012-03-12 8:22 UTC (permalink / raw)
To: Kamal Mostafa
Cc: Jan Kara, Andrew Morton, linux-fsdevel, linux-mm, LKML, Al Viro,
Christoph Hellwig, Jaya Kumar, Sage Weil, ceph-devel,
Eric Van Hensbergen, Ron Minnich, Latchesar Ionkov,
v9fs-developer, Steven Whitehouse, cluster-devel,
Greg Kroah-Hartman
On Sun 11-03-12 13:23:17, Kamal Mostafa wrote:
> On Mon, 2012-03-05 at 15:54 +0100, Jan Kara wrote:
> > Hello,
> >
> > to provide reliable support for filesystem freezing, filesystems need to have
> > complete control over when metadata is changed. [...]
>
> This patch set has been tested at Canonical along with the testing for
> "[PATCH 00/19] Fix filesystem freezing deadlocks".
>
> Please add the following endorsements for these patches (those actually
> exercised by our test case): 1, 2, 6, 7
>
> Tested-by: Kamal Mostafa <kamal@canonical.com>
> Tested-by: Peter M. Petrakis <peter.petrakis@canonical.com>
> Tested-by: Dann Frazier <dann.frazier@canonical.com>
> Tested-by: Massimo Morana <massimo.morana@canonical.com>
Thanks for testing guys!
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 10+ messages in thread