login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
January
»
18
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapped files
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Peter Zijlstra <peterz@...>
To: Miklos Szeredi <miklos@...>
Cc: <salikhmetov@...>, <linux-mm@...>, <jakob@...>, <linux-kernel@...>, <valdis.kletnieks@...>, <riel@...>, <ksm@...>, <staubach@...>, <jesper.juhl@...>, <torvalds@...>, <akpm@...>, <protasnb@...>, <r.e.wolff@...>, <hidave.darkstar@...>, <hch@...>
Subject:
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapped files
Date: Friday, January 18, 2008 - 6:25 am
On Fri, 2008-01-18 at 11:15 +0100, Peter Zijlstra wrote:
quoted text
> On Fri, 2008-01-18 at 10:51 +0100, Miklos Szeredi wrote: > > > > diff --git a/mm/msync.c b/mm/msync.c > > > index a4de868..a49af28 100644 > > > --- a/mm/msync.c > > > +++ b/mm/msync.c > > > @@ -13,11 +13,33 @@ > > > #include <linux/syscalls.h> > > > > > > /* > > > + * Scan the PTEs for pages belonging to the VMA and mark them read-only. > > > + * It will force a pagefault on the next write access. > > > + */ > > > +static void vma_wrprotect(struct vm_area_struct *vma) > > > +{ > > > + unsigned long addr; > > > + > > > + for (addr = vma->vm_start; addr < vma->vm_end; addr += PAGE_SIZE) { > > > + spinlock_t *ptl; > > > + pgd_t *pgd = pgd_offset(vma->vm_mm, addr); > > > + pud_t *pud = pud_offset(pgd, addr); > > > + pmd_t *pmd = pmd_offset(pud, addr); > > > + pte_t *pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl); > > > + > > > + if (pte_dirty(*pte) && pte_write(*pte)) > > > + *pte = pte_wrprotect(*pte); > > > + pte_unmap_unlock(pte, ptl); > > > + } > > > +} > > > > What about ram based filesystems? They don't start out with read-only > > pte's, so I think they don't want them read-protected now either. > > Unless this is essential for correct mtime/ctime accounting on these > > filesystems (I don't think it really is). But then the mapping should > > start out read-only as well, otherwise the time update will only work > > after an msync(MS_ASYNC). > > page_mkclean() has all the needed logic for this, it also walks the rmap > and cleans out all other users, which I think is needed too for > consistencies sake: > > Process A Process B > > mmap(foo.txt) mmap(foo.txt) > > dirty page > dirty page > > msync(MS_ASYNC) > > dirty page > > msync(MS_ASYNC) <--- now what?! > > > So what I would suggest is using the page table walkers from mm, and > walks the page range, obtain the page using vm_normal_page() and call > page_mkclean(). (Oh, and ensure you don't nest the pte lock :-) > > All in all, that sounds rather expensive..
Bah, and will break on s390... so we'd need a page_mkclean() variant that doesn't actually clear dirty. --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH -v6 0/2] Fixing the issue with memory-mapped file times
, Anton Salikhmetov
, (Thu Jan 17, 6:31 pm)
Re: [PATCH -v6 0/2] Fixing the issue with memory-mapped file...
, Miklos Szeredi
, (Fri Jan 18, 5:40 am)
Re: [PATCH -v6 0/2] Fixing the issue with memory-mapped file...
, Anton Salikhmetov
, (Fri Jan 18, 3:48 pm)
Re: [PATCH -v6 0/2] Fixing the issue with memory-mapped file...
, Miklos Szeredi
, (Sat Jan 19, 6:45 am)
Re: [PATCH -v6 0/2] Fixing the issue with memory-mapped file...
, Anton Salikhmetov
, (Fri Jan 18, 6:31 am)
[PATCH -v6 2/2] Updating ctime and mtime for memory-mapped f...
, Anton Salikhmetov
, (Thu Jan 17, 6:31 pm)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Miklos Szeredi
, (Fri Jan 18, 5:51 am)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Peter Zijlstra
, (Fri Jan 18, 6:15 am)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Miklos Szeredi
, (Fri Jan 18, 6:38 am)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Peter Zijlstra
, (Fri Jan 18, 7:00 am)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Miklos Szeredi
, (Fri Jan 18, 7:17 am)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Peter Zijlstra
, (Fri Jan 18, 7:23 am)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Miklos Szeredi
, (Fri Jan 18, 7:36 am)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Peter Zijlstra
, (Fri Jan 18, 6:25 am)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Linus Torvalds
, (Fri Jan 18, 1:58 pm)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Miklos Szeredi
, (Fri Jan 18, 2:11 pm)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Linus Torvalds
, (Fri Jan 18, 2:43 pm)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Miklos Szeredi
, (Fri Jan 18, 2:57 pm)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Linus Torvalds
, (Fri Jan 18, 3:08 pm)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Miklos Szeredi
, (Fri Jan 18, 3:22 pm)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Linus Torvalds
, (Fri Jan 18, 3:35 pm)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Ingo Oeser
, (Fri Jan 18, 6:32 pm)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Linus Torvalds
, (Fri Jan 18, 6:47 pm)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Peter Staubach
, (Mon Jan 21, 10:25 am)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Anton Salikhmetov
, (Mon Jan 21, 10:36 am)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Rik van Riel
, (Fri Jan 18, 6:54 pm)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Matt Mackall
, (Fri Jan 18, 8:50 pm)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Miklos Szeredi
, (Sat Jan 19, 6:22 am)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Matt Mackall
, (Sat Jan 19, 11:49 am)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Rik van Riel
, (Sat Jan 19, 12:25 am)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Anton Salikhmetov
, (Fri Jan 18, 3:58 pm)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Linus Torvalds
, (Fri Jan 18, 4:22 pm)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Anton Salikhmetov
, (Fri Jan 18, 5:03 pm)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Linus Torvalds
, (Fri Jan 18, 5:27 pm)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Anton Salikhmetov
, (Fri Jan 18, 6:04 pm)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Linus Torvalds
, (Fri Jan 18, 6:21 pm)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Anton Salikhmetov
, (Fri Jan 18, 6:35 pm)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Rik van Riel
, (Fri Jan 18, 2:28 pm)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Miklos Szeredi
, (Fri Jan 18, 2:51 pm)
Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapp...
, Anton Salikhmetov
, (Fri Jan 18, 6:39 am)
[PATCH -v6 1/2] Massive code cleanup of sys_msync()
, Anton Salikhmetov
, (Thu Jan 17, 6:31 pm)
Re: [PATCH -v6 1/2] Massive code cleanup of sys_msync()
, Miklos Szeredi
, (Fri Jan 18, 5:33 am)
Re: [PATCH -v6 1/2] Massive code cleanup of sys_msync()
, Anton Salikhmetov
, (Fri Jan 18, 6:30 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
debian developer
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Eric W. Biederman
[PATCH 02/10] sysfs: Support for preventing unmounts.
Greg KH
[GIT PATCH] driver core patches against 2.6.24
Linus Torvalds
Re: LSM conversion to static interface
git
:
openbsd-misc
:
linux-netdev
:
Antonio Almeida
HTB accuracy for high speed
David Miller
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Gerrit Renker
[PATCH 18/37] dccp: Support for Mandatory options
Timo Teräs
Re: xfrm_state locking regression...
Colocation donated by:
Who's online
There are currently
2 users
and
831 guests
online.
Online users
zeekec
sev8do
Syndicate