Re: [PATCH -v8 4/4] The design document for memory-mapped file times update

2008-01-25 Thread Anton Salikhmetov
2008/1/25, Randy Dunlap <[EMAIL PROTECTED]>: > On Wed, 23 Jan 2008 02:21:20 +0300 Anton Salikhmetov wrote: > > > Add a document, which describes how the POSIX requirements on updating > > memory-mapped file times are addressed in Linux. > > Hi Anton, >

Re: [PATCH -v8 4/4] The design document for memory-mapped file times update

2008-01-25 Thread Anton Salikhmetov
2008/1/25, Randy Dunlap [EMAIL PROTECTED]: On Wed, 23 Jan 2008 02:21:20 +0300 Anton Salikhmetov wrote: Add a document, which describes how the POSIX requirements on updating memory-mapped file times are addressed in Linux. Hi Anton, Just a few small comments below... Signed-off

Re: [PATCH -v8 2/4] Update ctime and mtime for memory-mapped files

2008-01-23 Thread Anton Salikhmetov
2008/1/23, Linus Torvalds <[EMAIL PROTECTED]>: > > > On Wed, 23 Jan 2008, Anton Salikhmetov wrote: > > > > Update ctime and mtime for memory-mapped files at a write access on > > a present, read-only PTE, as well as at a write on a non-present PTE. >

Re: [PATCH -v8 3/4] Enable the MS_ASYNC functionality in sys_msync()

2008-01-23 Thread Anton Salikhmetov
2008/1/23, Linus Torvalds <[EMAIL PROTECTED]>: > > > On Wed, 23 Jan 2008, Anton Salikhmetov wrote: > > + > > + if (pte_dirty(*pte) && pte_write(*pte)) { > > Not correct. > > You still need to check "pte_present()" before y

Re: [PATCH -v8 3/4] Enable the MS_ASYNC functionality in sys_msync()

2008-01-23 Thread Anton Salikhmetov
2008/1/23, Miklos Szeredi <[EMAIL PROTECTED]>: > > > Also, it still doesn't make sense to me why we'd not need to walk the > > > rmap, it is all the same file after all. > > > > It's the same file, but not the same memory map. It basically depends > > on how you define msync: > > > > a) sync

Re: [PATCH -v8 3/4] Enable the MS_ASYNC functionality in sys_msync()

2008-01-23 Thread Anton Salikhmetov
2008/1/23, Peter Zijlstra <[EMAIL PROTECTED]>: > > On Wed, 2008-01-23 at 02:21 +0300, Anton Salikhmetov wrote: > > > +static void vma_wrprotect_pmd_range(struct vm_area_struct *vma, pmd_t *pmd, > > + unsigned long start, unsigned long end) > >

Re: [PATCH -v8 4/4] The design document for memory-mapped file times update

2008-01-23 Thread Anton Salikhmetov
2008/1/23, Miklos Szeredi <[EMAIL PROTECTED]>: > > Ah, OK, this is becuase mmap doesn't actually set up the page tables > > by default. Try adding MAP_POPULATE to the flags. > > Here's an updated version of the program, with an added a '-r' option, > that performs a read access on the mapping

Re: [PATCH -v8 4/4] The design document for memory-mapped file times update

2008-01-23 Thread Anton Salikhmetov
ed file times are addressed in Linux. > > > > Signed-off-by: Anton Salikhmetov <[EMAIL PROTECTED]> > > --- > > Documentation/vm/00-INDEX |2 + > > Documentation/vm/msync.txt | 117 > > > > 2 files ch

Re: [PATCH -v8 4/4] The design document for memory-mapped file times update

2008-01-23 Thread Anton Salikhmetov
. Signed-off-by: Anton Salikhmetov [EMAIL PROTECTED] --- Documentation/vm/00-INDEX |2 + Documentation/vm/msync.txt | 117 2 files changed, 119 insertions(+), 0 deletions(-) diff --git a/Documentation/vm/00-INDEX b/Documentation

Re: [PATCH -v8 4/4] The design document for memory-mapped file times update

2008-01-23 Thread Anton Salikhmetov
2008/1/23, Miklos Szeredi [EMAIL PROTECTED]: Ah, OK, this is becuase mmap doesn't actually set up the page tables by default. Try adding MAP_POPULATE to the flags. Here's an updated version of the program, with an added a '-r' option, that performs a read access on the mapping before

Re: [PATCH -v8 3/4] Enable the MS_ASYNC functionality in sys_msync()

2008-01-23 Thread Anton Salikhmetov
2008/1/23, Peter Zijlstra [EMAIL PROTECTED]: On Wed, 2008-01-23 at 02:21 +0300, Anton Salikhmetov wrote: +static void vma_wrprotect_pmd_range(struct vm_area_struct *vma, pmd_t *pmd, + unsigned long start, unsigned long end) +{ + while (start end

Re: [PATCH -v8 3/4] Enable the MS_ASYNC functionality in sys_msync()

2008-01-23 Thread Anton Salikhmetov
2008/1/23, Miklos Szeredi [EMAIL PROTECTED]: Also, it still doesn't make sense to me why we'd not need to walk the rmap, it is all the same file after all. It's the same file, but not the same memory map. It basically depends on how you define msync: a) sync _file_ on region

Re: [PATCH -v8 3/4] Enable the MS_ASYNC functionality in sys_msync()

2008-01-23 Thread Anton Salikhmetov
2008/1/23, Linus Torvalds [EMAIL PROTECTED]: On Wed, 23 Jan 2008, Anton Salikhmetov wrote: + + if (pte_dirty(*pte) pte_write(*pte)) { Not correct. You still need to check pte_present() before you can test any other bits. For a non-present pte, none of the other bits

Re: [PATCH -v8 2/4] Update ctime and mtime for memory-mapped files

2008-01-23 Thread Anton Salikhmetov
2008/1/23, Linus Torvalds [EMAIL PROTECTED]: On Wed, 23 Jan 2008, Anton Salikhmetov wrote: Update ctime and mtime for memory-mapped files at a write access on a present, read-only PTE, as well as at a write on a non-present PTE. Ok, this one I'm applying. I agree that it leaves MS_ASYNC

[PATCH -v8 1/4] Massive code cleanup of sys_msync()

2008-01-22 Thread Anton Salikhmetov
Use the PAGE_ALIGN() macro instead of "manual" alignment. Improve readability of the loop, which traverses the process memory regions. Make code more symmetric and possibly boost performance on some RISC CPUs by moving variable assignments. Signed-off-by: Anton Salikhmetov <[EM

[PATCH -v8 4/4] The design document for memory-mapped file times update

2008-01-22 Thread Anton Salikhmetov
Add a document, which describes how the POSIX requirements on updating memory-mapped file times are addressed in Linux. Signed-off-by: Anton Salikhmetov <[EMAIL PROTECTED]> --- Documentation/vm/00-INDEX |2 + Documentation/vm/msync.txt | 117 +

[PATCH -v8 2/4] Update ctime and mtime for memory-mapped files

2008-01-22 Thread Anton Salikhmetov
Update ctime and mtime for memory-mapped files at a write access on a present, read-only PTE, as well as at a write on a non-present PTE. Signed-off-by: Anton Salikhmetov <[EMAIL PROTECTED]> --- mm/memory.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/mm/me

[PATCH -v8 0/4] Fixing the issue with memory-mapped file times

2008-01-22 Thread Anton Salikhmetov
This is the eighth version of my solution for the bug #2645: http://bugzilla.kernel.org/show_bug.cgi?id=2645 Since the previous version, the following has changed: 1) based on Linus' comment, a more efficient PTE walker implemented; 2) the design document added to the kernel documentation.

[PATCH -v8 3/4] Enable the MS_ASYNC functionality in sys_msync()

2008-01-22 Thread Anton Salikhmetov
Force file times update at the next write reference after calling the msync() system call with the MS_ASYNC flag. Signed-off-by: Anton Salikhmetov <[EMAIL PROTECTED]> --- mm/msync.c | 92 +-- 1 files changed, 82 insertions(

[PATCH -v8 2/4] Update ctime and mtime for memory-mapped files

2008-01-22 Thread Anton Salikhmetov
Update ctime and mtime for memory-mapped files at a write access on a present, read-only PTE, as well as at a write on a non-present PTE. Signed-off-by: Anton Salikhmetov [EMAIL PROTECTED] --- mm/memory.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/mm/memory.c b

[PATCH -v8 0/4] Fixing the issue with memory-mapped file times

2008-01-22 Thread Anton Salikhmetov
This is the eighth version of my solution for the bug #2645: http://bugzilla.kernel.org/show_bug.cgi?id=2645 Since the previous version, the following has changed: 1) based on Linus' comment, a more efficient PTE walker implemented; 2) the design document added to the kernel documentation.

[PATCH -v8 3/4] Enable the MS_ASYNC functionality in sys_msync()

2008-01-22 Thread Anton Salikhmetov
Force file times update at the next write reference after calling the msync() system call with the MS_ASYNC flag. Signed-off-by: Anton Salikhmetov [EMAIL PROTECTED] --- mm/msync.c | 92 +-- 1 files changed, 82 insertions(+), 10 deletions

[PATCH -v8 1/4] Massive code cleanup of sys_msync()

2008-01-22 Thread Anton Salikhmetov
Use the PAGE_ALIGN() macro instead of manual alignment. Improve readability of the loop, which traverses the process memory regions. Make code more symmetric and possibly boost performance on some RISC CPUs by moving variable assignments. Signed-off-by: Anton Salikhmetov [EMAIL PROTECTED] --- mm

[PATCH -v8 4/4] The design document for memory-mapped file times update

2008-01-22 Thread Anton Salikhmetov
Add a document, which describes how the POSIX requirements on updating memory-mapped file times are addressed in Linux. Signed-off-by: Anton Salikhmetov [EMAIL PROTECTED] --- Documentation/vm/00-INDEX |2 + Documentation/vm/msync.txt | 117 2

Re: [PATCH -v7 2/2] Update ctime and mtime for memory-mapped files

2008-01-21 Thread Anton Salikhmetov
2008/1/22, Linus Torvalds <[EMAIL PROTECTED]>: > > > On Tue, 22 Jan 2008, Anton Salikhmetov wrote: > > > > /* > > + * Scan the PTEs for pages belonging to the VMA and mark them read-only. > > + * It will force a pagefault on the next write access. > &g

Re: [PATCH -v7 2/2] Update ctime and mtime for memory-mapped files

2008-01-21 Thread Anton Salikhmetov
2008/1/22, Anton Salikhmetov <[EMAIL PROTECTED]>: > 2008/1/22, Jesper Juhl <[EMAIL PROTECTED]>: > > Some very pedantic nitpicking below; > > > > On 22/01/2008, Anton Salikhmetov <[EMAIL PROTECTED]> wrote: > > > http://bugzilla.kernel.org/show_b

Re: [PATCH -v7 2/2] Update ctime and mtime for memory-mapped files

2008-01-21 Thread Anton Salikhmetov
2008/1/22, Jesper Juhl <[EMAIL PROTECTED]>: > On 22/01/2008, Anton Salikhmetov <[EMAIL PROTECTED]> wrote: > > 2008/1/22, Jesper Juhl <[EMAIL PROTECTED]>: > > > Some very pedantic nitpicking below; > > > > > > On 2

Re: [PATCH -v7 2/2] Update ctime and mtime for memory-mapped files

2008-01-21 Thread Anton Salikhmetov
2008/1/22, Jesper Juhl <[EMAIL PROTECTED]>: > Some very pedantic nitpicking below; > > On 22/01/2008, Anton Salikhmetov <[EMAIL PROTECTED]> wrote: > > http://bugzilla.kernel.org/show_bug.cgi?id=2645#c40 > > > > Update file times at write references to me

Re: [PATCH -v7 0/2] Fixing the issue with memory-mapped file times

2008-01-21 Thread Anton Salikhmetov
2008/1/22, Jesper Juhl <[EMAIL PROTECTED]>: > On 22/01/2008, Anton Salikhmetov <[EMAIL PROTECTED]> wrote: > > This is the seventh version of my solution for the bug #2645: > > > > http://bugzilla.kernel.org/show_bug.cgi?id=2645 > > > > Since the previ

[PATCH -v7 0/2] Fixing the issue with memory-mapped file times

2008-01-21 Thread Anton Salikhmetov
This is the seventh version of my solution for the bug #2645: http://bugzilla.kernel.org/show_bug.cgi?id=2645 Since the previous version, the following has changed: based on Linus' comment, SMP-safe PTE update implemented. Discussions, which followed my past submissions, showed that it was

[PATCH -v7 1/2] Massive code cleanup of sys_msync()

2008-01-21 Thread Anton Salikhmetov
Use the PAGE_ALIGN() macro instead of "manual" alignment. Improve readability of the loop, which traverses the process memory regions. Make code more symmetric and possibly boost performance on some RISC CPUs by moving variable assignments. Signed-off-by: Anton Salikhmetov <[EM

[PATCH -v7 2/2] Update ctime and mtime for memory-mapped files

2008-01-21 Thread Anton Salikhmetov
http://bugzilla.kernel.org/show_bug.cgi?id=2645#c40 Update file times at write references to memory-mapped files. Force file times update at the next write reference after calling the msync() system call with the MS_ASYNC flag. Signed-off-by: Anton Salikhmetov <[EMAIL PROTECTED]> -

Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapped files

2008-01-21 Thread Anton Salikhmetov
2008/1/21, Peter Staubach <[EMAIL PROTECTED]>: > Linus Torvalds wrote: > > On Fri, 18 Jan 2008, Ingo Oeser wrote: > > > >> Can we get "if the write to the page hits the disk, the mtime has hit the > >> disk > >> already no less than SOME_GRANULARITY before"? > >> > >> That is very important for

Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapped files

2008-01-21 Thread Anton Salikhmetov
2008/1/21, Peter Staubach [EMAIL PROTECTED]: Linus Torvalds wrote: On Fri, 18 Jan 2008, Ingo Oeser wrote: Can we get if the write to the page hits the disk, the mtime has hit the disk already no less than SOME_GRANULARITY before? That is very important for computer forensics. Esp.

[PATCH -v7 0/2] Fixing the issue with memory-mapped file times

2008-01-21 Thread Anton Salikhmetov
This is the seventh version of my solution for the bug #2645: http://bugzilla.kernel.org/show_bug.cgi?id=2645 Since the previous version, the following has changed: based on Linus' comment, SMP-safe PTE update implemented. Discussions, which followed my past submissions, showed that it was

[PATCH -v7 1/2] Massive code cleanup of sys_msync()

2008-01-21 Thread Anton Salikhmetov
Use the PAGE_ALIGN() macro instead of manual alignment. Improve readability of the loop, which traverses the process memory regions. Make code more symmetric and possibly boost performance on some RISC CPUs by moving variable assignments. Signed-off-by: Anton Salikhmetov [EMAIL PROTECTED] --- mm

[PATCH -v7 2/2] Update ctime and mtime for memory-mapped files

2008-01-21 Thread Anton Salikhmetov
http://bugzilla.kernel.org/show_bug.cgi?id=2645#c40 Update file times at write references to memory-mapped files. Force file times update at the next write reference after calling the msync() system call with the MS_ASYNC flag. Signed-off-by: Anton Salikhmetov [EMAIL PROTECTED] --- mm/memory.c

Re: [PATCH -v7 0/2] Fixing the issue with memory-mapped file times

2008-01-21 Thread Anton Salikhmetov
2008/1/22, Jesper Juhl [EMAIL PROTECTED]: On 22/01/2008, Anton Salikhmetov [EMAIL PROTECTED] wrote: This is the seventh version of my solution for the bug #2645: http://bugzilla.kernel.org/show_bug.cgi?id=2645 Since the previous version, the following has changed: based on Linus

Re: [PATCH -v7 2/2] Update ctime and mtime for memory-mapped files

2008-01-21 Thread Anton Salikhmetov
2008/1/22, Jesper Juhl [EMAIL PROTECTED]: Some very pedantic nitpicking below; On 22/01/2008, Anton Salikhmetov [EMAIL PROTECTED] wrote: http://bugzilla.kernel.org/show_bug.cgi?id=2645#c40 Update file times at write references to memory-mapped files. Force file times update at the next

Re: [PATCH -v7 2/2] Update ctime and mtime for memory-mapped files

2008-01-21 Thread Anton Salikhmetov
2008/1/22, Jesper Juhl [EMAIL PROTECTED]: On 22/01/2008, Anton Salikhmetov [EMAIL PROTECTED] wrote: 2008/1/22, Jesper Juhl [EMAIL PROTECTED]: Some very pedantic nitpicking below; On 22/01/2008, Anton Salikhmetov [EMAIL PROTECTED] wrote: ... + if (file (vma-vm_flags

Re: [PATCH -v7 2/2] Update ctime and mtime for memory-mapped files

2008-01-21 Thread Anton Salikhmetov
2008/1/22, Anton Salikhmetov [EMAIL PROTECTED]: 2008/1/22, Jesper Juhl [EMAIL PROTECTED]: Some very pedantic nitpicking below; On 22/01/2008, Anton Salikhmetov [EMAIL PROTECTED] wrote: http://bugzilla.kernel.org/show_bug.cgi?id=2645#c40 Update file times at write references

Re: [PATCH -v7 2/2] Update ctime and mtime for memory-mapped files

2008-01-21 Thread Anton Salikhmetov
2008/1/22, Linus Torvalds [EMAIL PROTECTED]: On Tue, 22 Jan 2008, Anton Salikhmetov wrote: /* + * 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

Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapped files

2008-01-18 Thread Anton Salikhmetov
2008/1/19, Linus Torvalds <[EMAIL PROTECTED]>: > > > On Sat, 19 Jan 2008, Anton Salikhmetov wrote: > > > > The page_check_address() function is called from the > > page_mkclean_one() routine as follows: > > .. and the page_mkclean_one() functio

Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapped files

2008-01-18 Thread Anton Salikhmetov
2008/1/19, Linus Torvalds <[EMAIL PROTECTED]>: > > > On Sat, 19 Jan 2008, Anton Salikhmetov wrote: > > > > Before using pte_wrprotect() the vma_wrprotect() routine uses the > > pte_offset_map_lock() macro to get the PTE and to acquire the ptl > > s

Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapped files

2008-01-18 Thread Anton Salikhmetov
2008/1/18, Linus Torvalds <[EMAIL PROTECTED]>: > > > On Fri, 18 Jan 2008, Anton Salikhmetov wrote: > > > > The current solution doesn't hit the performance at all when compared to > > the competitor POSIX-compliant systems. It is faster and does even more >

Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapped files

2008-01-18 Thread Anton Salikhmetov
2008/1/18, Linus Torvalds <[EMAIL PROTECTED]>: > > > On Fri, 18 Jan 2008, Miklos Szeredi wrote: > > > > What I'm saying is that the times could be left un-updated for a long > > time if program doesn't do munmap() or msync(MS_SYNC) for a long time. > > Sure. > > But in those circumstances, the

Re: [PATCH -v6 0/2] Fixing the issue with memory-mapped file times

2008-01-18 Thread Anton Salikhmetov
2008/1/18, Miklos Szeredi <[EMAIL PROTECTED]>: > > 4. Performance test was done using the program available from the > > following link: > > > > http://bugzilla.kernel.org/attachment.cgi?id=14493 > > > > Result: the impact of the changes was negligible for files of a few > > hundred megabytes. > >

Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapped files

2008-01-18 Thread Anton Salikhmetov
2008/1/18, Peter Zijlstra <[EMAIL PROTECTED]>: > > On Fri, 2008-01-18 at 11:15 +0100, Peter Zijlstra wrote: > > 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 > > > > +++

Re: [PATCH -v6 0/2] Fixing the issue with memory-mapped file times

2008-01-18 Thread Anton Salikhmetov
2008/1/18, Miklos Szeredi <[EMAIL PROTECTED]>: > > 4. Performance test was done using the program available from the > > following link: > > > > http://bugzilla.kernel.org/attachment.cgi?id=14493 > > > > Result: the impact of the changes was negligible for files of a few > > hundred megabytes. > >

Re: [PATCH -v6 1/2] Massive code cleanup of sys_msync()

2008-01-18 Thread Anton Salikhmetov
2008/1/18, Miklos Szeredi <[EMAIL PROTECTED]>: > > unsigned long end; > > - struct mm_struct *mm = current->mm; > > + int error, unmapped_error; > > struct vm_area_struct *vma; > > - int unmapped_error = 0; > > - int error = -EINVAL; > > + struct mm_struct *mm; > >

Re: [PATCH -v6 0/2] Fixing the issue with memory-mapped file times

2008-01-18 Thread Anton Salikhmetov
2008/1/18, Miklos Szeredi [EMAIL PROTECTED]: 4. Performance test was done using the program available from the following link: http://bugzilla.kernel.org/attachment.cgi?id=14493 Result: the impact of the changes was negligible for files of a few hundred megabytes. Could you also

Re: [PATCH -v6 1/2] Massive code cleanup of sys_msync()

2008-01-18 Thread Anton Salikhmetov
2008/1/18, Miklos Szeredi [EMAIL PROTECTED]: unsigned long end; - struct mm_struct *mm = current-mm; + int error, unmapped_error; struct vm_area_struct *vma; - int unmapped_error = 0; - int error = -EINVAL; + struct mm_struct *mm; + error =

Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapped files

2008-01-18 Thread Anton Salikhmetov
2008/1/18, Peter Zijlstra [EMAIL PROTECTED]: On Fri, 2008-01-18 at 11:15 +0100, Peter Zijlstra wrote: 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

Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapped files

2008-01-18 Thread Anton Salikhmetov
2008/1/19, Linus Torvalds [EMAIL PROTECTED]: On Sat, 19 Jan 2008, Anton Salikhmetov wrote: The page_check_address() function is called from the page_mkclean_one() routine as follows: .. and the page_mkclean_one() function is totally different. Lookie here, this is the correct

Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapped files

2008-01-18 Thread Anton Salikhmetov
2008/1/19, Linus Torvalds [EMAIL PROTECTED]: On Sat, 19 Jan 2008, Anton Salikhmetov wrote: Before using pte_wrprotect() the vma_wrprotect() routine uses the pte_offset_map_lock() macro to get the PTE and to acquire the ptl spinlock. Why did you say that this code was not SMP-safe

Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapped files

2008-01-18 Thread Anton Salikhmetov
2008/1/18, Linus Torvalds [EMAIL PROTECTED]: On Fri, 18 Jan 2008, Anton Salikhmetov wrote: The current solution doesn't hit the performance at all when compared to the competitor POSIX-compliant systems. It is faster and does even more than the POSIX standard requires. Your current

Re: [PATCH -v6 0/2] Fixing the issue with memory-mapped file times

2008-01-18 Thread Anton Salikhmetov
2008/1/18, Miklos Szeredi [EMAIL PROTECTED]: 4. Performance test was done using the program available from the following link: http://bugzilla.kernel.org/attachment.cgi?id=14493 Result: the impact of the changes was negligible for files of a few hundred megabytes. Could you also

Re: [PATCH -v6 2/2] Updating ctime and mtime for memory-mapped files

2008-01-18 Thread Anton Salikhmetov
2008/1/18, Linus Torvalds [EMAIL PROTECTED]: On Fri, 18 Jan 2008, Miklos Szeredi wrote: What I'm saying is that the times could be left un-updated for a long time if program doesn't do munmap() or msync(MS_SYNC) for a long time. Sure. But in those circumstances, the programmer cannot

[PATCH -v6 2/2] Updating ctime and mtime for memory-mapped files

2008-01-17 Thread Anton Salikhmetov
Updating file times at write references to memory-mapped files and forcing file times update at the next write reference after calling the msync() system call with the MS_ASYNC flag. Signed-off-by: Anton Salikhmetov <[EMAIL PROTECTED]> --- mm/memory.c |6 ++ mm/msync.c

[PATCH -v6 0/2] Fixing the issue with memory-mapped file times

2008-01-17 Thread Anton Salikhmetov
This is the sixth version of my solution for the bug #2645: http://bugzilla.kernel.org/show_bug.cgi?id=2645 New since the previous version: 1) a few cosmetic changes according to the latest feedback for the cleanup patch; 2) implementation of the following suggestion by Miklos Szeredi:

[PATCH -v6 1/2] Massive code cleanup of sys_msync()

2008-01-17 Thread Anton Salikhmetov
Using the PAGE_ALIGN() macro instead of "manual" alignment and improved readability of the loop traversing the process memory regions. Signed-off-by: Anton Salikhmetov <[EMAIL PROTECTED]> --- mm/msync.c | 77 1 f

Re: [PATCH -v5 2/2] Updating ctime and mtime at syncing

2008-01-17 Thread Anton Salikhmetov
2008/1/17, Miklos Szeredi <[EMAIL PROTECTED]>: > > The do_wp_page() function is called in mm/memory.c after locking PTE. > > And the file_update_time() routine calls the filesystem operation that can > > sleep. It's not accepted, I guess. > > do_wp_page() is called with the pte lock but drops it,

Re: [PATCH -v5 2/2] Updating ctime and mtime at syncing

2008-01-17 Thread Anton Salikhmetov
2008/1/17, Miklos Szeredi <[EMAIL PROTECTED]>: > > > I'm not sure this auto-updating is really needed (POSIX doesn't > > > mandate it). > > > > Peter Shtaubach, author of the first solution for this bug, > > and Jacob Ostergaard, the reporter of this bug, insist the "auto-update" > > feature to be

Re: [PATCH -v5 2/2] Updating ctime and mtime at syncing

2008-01-17 Thread Anton Salikhmetov
2008/1/17, Miklos Szeredi <[EMAIL PROTECTED]>: > > 2008/1/17, Miklos Szeredi <[EMAIL PROTECTED]>: > > > > > 4. Recording the time was the file data changed > > > > > > > > > > Finally, I noticed yet another issue with the previous version of my > > > > > patch. > > > > > Specifically, the time

Re: [PATCH -v5 2/2] Updating ctime and mtime at syncing

2008-01-17 Thread Anton Salikhmetov
2008/1/17, Rogier Wolff <[EMAIL PROTECTED]>: > On Thu, Jan 17, 2008 at 04:16:47PM +0300, Anton Salikhmetov wrote: > > 2008/1/17, Miklos Szeredi <[EMAIL PROTECTED]>: > > > > > 4. Recording the time was the file data changed > > > > > > > >

Re: [PATCH -v5 2/2] Updating ctime and mtime at syncing

2008-01-17 Thread Anton Salikhmetov
2008/1/17, Miklos Szeredi <[EMAIL PROTECTED]>: > > > 4. Recording the time was the file data changed > > > > > > Finally, I noticed yet another issue with the previous version of my > > > patch. > > > Specifically, the time stamps were set to the current time of the moment > > > when syncing but

Re: [PATCH -v5 2/2] Updating ctime and mtime at syncing

2008-01-17 Thread Anton Salikhmetov
ality seems to be there now. As a next step, I think > you should try to simplify the patch, removing everything, that is not > strictly necessary. > > > > > Signed-off-by: Anton Salikhmetov <[EMAIL PROTECTED]> > > --- > > fs

Re: [PATCH -v5 1/2] Massive code cleanup of sys_msync()

2008-01-17 Thread Anton Salikhmetov
2008/1/17, Miklos Szeredi <[EMAIL PROTECTED]>: > > Substantial code cleanup of the sys_msync() function: > > > > 1) using the PAGE_ALIGN() macro instead of "manual" alignment; > > 2) improved readability of the loop traversing the process memory regions.

Re: [PATCH -v5 1/2] Massive code cleanup of sys_msync()

2008-01-17 Thread Anton Salikhmetov
2008/1/17, Miklos Szeredi [EMAIL PROTECTED]: Substantial code cleanup of the sys_msync() function: 1) using the PAGE_ALIGN() macro instead of manual alignment; 2) improved readability of the loop traversing the process memory regions. Signed-off-by: Anton Salikhmetov [EMAIL PROTECTED

Re: [PATCH -v5 2/2] Updating ctime and mtime at syncing

2008-01-17 Thread Anton Salikhmetov
the patch, removing everything, that is not strictly necessary. Signed-off-by: Anton Salikhmetov [EMAIL PROTECTED] --- fs/buffer.c |3 ++ fs/fs-writeback.c |2 + fs/inode.c | 43 +++-- fs/sync.c |2

Re: [PATCH -v5 2/2] Updating ctime and mtime at syncing

2008-01-17 Thread Anton Salikhmetov
2008/1/17, Miklos Szeredi [EMAIL PROTECTED]: 2008/1/17, Miklos Szeredi [EMAIL PROTECTED]: 4. Recording the time was the file data changed Finally, I noticed yet another issue with the previous version of my patch. Specifically, the time stamps were set to the current

Re: [PATCH -v5 2/2] Updating ctime and mtime at syncing

2008-01-17 Thread Anton Salikhmetov
2008/1/17, Miklos Szeredi [EMAIL PROTECTED]: 4. Recording the time was the file data changed Finally, I noticed yet another issue with the previous version of my patch. Specifically, the time stamps were set to the current time of the moment when syncing but not the write

Re: [PATCH -v5 2/2] Updating ctime and mtime at syncing

2008-01-17 Thread Anton Salikhmetov
2008/1/17, Miklos Szeredi [EMAIL PROTECTED]: I'm not sure this auto-updating is really needed (POSIX doesn't mandate it). Peter Shtaubach, author of the first solution for this bug, and Jacob Ostergaard, the reporter of this bug, insist the auto-update feature to be implemented.

Re: [PATCH -v5 2/2] Updating ctime and mtime at syncing

2008-01-17 Thread Anton Salikhmetov
2008/1/17, Rogier Wolff [EMAIL PROTECTED]: On Thu, Jan 17, 2008 at 04:16:47PM +0300, Anton Salikhmetov wrote: 2008/1/17, Miklos Szeredi [EMAIL PROTECTED]: 4. Recording the time was the file data changed Finally, I noticed yet another issue with the previous version of my

Re: [PATCH -v5 2/2] Updating ctime and mtime at syncing

2008-01-17 Thread Anton Salikhmetov
2008/1/17, Miklos Szeredi [EMAIL PROTECTED]: The do_wp_page() function is called in mm/memory.c after locking PTE. And the file_update_time() routine calls the filesystem operation that can sleep. It's not accepted, I guess. do_wp_page() is called with the pte lock but drops it, so that's

[PATCH -v6 0/2] Fixing the issue with memory-mapped file times

2008-01-17 Thread Anton Salikhmetov
This is the sixth version of my solution for the bug #2645: http://bugzilla.kernel.org/show_bug.cgi?id=2645 New since the previous version: 1) a few cosmetic changes according to the latest feedback for the cleanup patch; 2) implementation of the following suggestion by Miklos Szeredi:

[PATCH -v6 1/2] Massive code cleanup of sys_msync()

2008-01-17 Thread Anton Salikhmetov
Using the PAGE_ALIGN() macro instead of manual alignment and improved readability of the loop traversing the process memory regions. Signed-off-by: Anton Salikhmetov [EMAIL PROTECTED] --- mm/msync.c | 77 1 files changed, 36

[PATCH -v6 2/2] Updating ctime and mtime for memory-mapped files

2008-01-17 Thread Anton Salikhmetov
Updating file times at write references to memory-mapped files and forcing file times update at the next write reference after calling the msync() system call with the MS_ASYNC flag. Signed-off-by: Anton Salikhmetov [EMAIL PROTECTED] --- mm/memory.c |6 ++ mm/msync.c | 52

[PATCH -v5 2/2] Updating ctime and mtime at syncing

2008-01-16 Thread Anton Salikhmetov
and mtime when needed; 4) updating time stamps for mapped files in sys_msync() and do_fsync(); 5) implementing lazy ctime and mtime update. Signed-off-by: Anton Salikhmetov <[EMAIL PROTECTED]> --- fs/buffer.c |3 ++ fs/fs-writeback.c |2 + fs/inode.c

[PATCH -v5 1/2] Massive code cleanup of sys_msync()

2008-01-16 Thread Anton Salikhmetov
Substantial code cleanup of the sys_msync() function: 1) using the PAGE_ALIGN() macro instead of "manual" alignment; 2) improved readability of the loop traversing the process memory regions. Signed-off-by: Anton Salikhmetov <[EMAIL PROTECTED]> --- m

[PATCH -v5 0/2] Updating ctime and mtime for memory-mapped files

2008-01-16 Thread Anton Salikhmetov
This is the fifth version of my solution for the bug #2645: http://bugzilla.kernel.org/show_bug.cgi?id=2645 New since the previous version: 1) the case of retouching an already-dirty page pointed out by Miklos Szeredi has been correctly addressed; 2) a few cosmetic changes according to the

Re: mtime updates for mmapped files.

2008-01-16 Thread Anton Salikhmetov
2008/1/16, Rogier Wolff <[EMAIL PROTECTED]>: > > Hi, > > I wrote a small app yesterday that updates a file by mmapping the > file (RW), changing the thing around, and then exiting. > > This did not trigger a change in the mtime of the file. Thus rsync > didn't pick up that the file had changed. >

Re: mtime updates for mmapped files.

2008-01-16 Thread Anton Salikhmetov
2008/1/16, Rogier Wolff [EMAIL PROTECTED]: Hi, I wrote a small app yesterday that updates a file by mmapping the file (RW), changing the thing around, and then exiting. This did not trigger a change in the mtime of the file. Thus rsync didn't pick up that the file had changed. I

Re: [PATCH 0/2] Updating ctime and mtime for memory-mapped files [try #4]

2008-01-15 Thread Anton Salikhmetov
2008/1/15, Miklos Szeredi <[EMAIL PROTECTED]>: > > 1. Introduction > > > > This is the fourth version of my solution for the bug #2645: > > > > http://bugzilla.kernel.org/show_bug.cgi?id=2645 > > > > Changes since the previous version: > > > > 1) the case of retouching an already-dirty page

Re: [PATCH 1/2] Massive code cleanup of sys_msync()

2008-01-15 Thread Anton Salikhmetov
2008/1/15, Christoph Hellwig <[EMAIL PROTECTED]>: > On Tue, Jan 15, 2008 at 08:28:48PM +0100, Peter Zijlstra wrote: > > Notice that error is already -EINVAL, so a simple goto should suffice. > > Yes, for the start of the function you can basically leave it as-is. > OK, I will do as you suggest.

Re: [PATCH 1/2] Massive code cleanup of sys_msync()

2008-01-15 Thread Anton Salikhmetov
2008/1/15, Randy Dunlap <[EMAIL PROTECTED]>: > On Tue, 15 Jan 2008 22:02:54 +0300 Anton Salikhmetov wrote: > > > 2008/1/15, Christoph Hellwig <[EMAIL PROTECTED]>: > > > On Tue, Jan 15, 2008 at 07:02:44PM +0300, Anton Salikhmetov wrote: > > > > &g

Re: [PATCH 1/2] Massive code cleanup of sys_msync()

2008-01-15 Thread Anton Salikhmetov
2008/1/15, Christoph Hellwig <[EMAIL PROTECTED]>: > On Tue, Jan 15, 2008 at 07:02:44PM +0300, Anton Salikhmetov wrote: > > +++ b/mm/msync.c > > @@ -1,24 +1,25 @@ > > /* > > * linux/mm/msync.c > > * > > + * The msync() system call. &g

Re: [PATCH 2/2] Updating ctime and mtime at syncing

2008-01-15 Thread Anton Salikhmetov
2008/1/15, Christoph Hellwig <[EMAIL PROTECTED]>: > On Tue, Jan 15, 2008 at 07:02:45PM +0300, Anton Salikhmetov wrote: > > +/* > > + * Update the ctime and mtime stamps for memory-mapped block device files. > > + */ > > +static void bd_inode_update_time(struct

Re: [PATCH 2/2] Updating ctime and mtime at syncing

2008-01-15 Thread Anton Salikhmetov
2008/1/15, Peter Zijlstra <[EMAIL PROTECTED]>: > > On Tue, 2008-01-15 at 19:02 +0300, Anton Salikhmetov wrote: > > > diff --git a/mm/page-writeback.c b/mm/page-writeback.c > > index 3d3848f..53d0e34 100644 > > --- a/mm/page-writeback.c > > +++ b/mm/page-wr

[PATCH 0/2] Updating ctime and mtime for memory-mapped files [try #4]

2008-01-15 Thread Anton Salikhmetov
1. Introduction This is the fourth version of my solution for the bug #2645: http://bugzilla.kernel.org/show_bug.cgi?id=2645 Changes since the previous version: 1) the case of retouching an already-dirty page pointed out by Miklos Szeredi has been addressed; 2) the file metadata are updated

[PATCH 1/2] Massive code cleanup of sys_msync()

2008-01-15 Thread Anton Salikhmetov
Substantial code cleanup of the sys_msync() function: 1) using the PAGE_ALIGN() macro instead of "manual" alignment; 2) improved readability of the loop traversing the process memory regions. Signed-off-by: Anton Salikhmetov <[EMAIL PROTECTED]> --- m

[PATCH 2/2] Updating ctime and mtime at syncing

2008-01-15 Thread Anton Salikhmetov
9 Linus Torvalds * * Massive code cleanup. + * Updating the ctime and mtime stamps for memory-mapped files. * Copyright (C) 2008 Anton Salikhmetov <[EMAIL PROTECTED]> */ @@ -22,6 +23,10 @@ * Nor does it mark the relevant pages dirty (it used to up to 2.6.17). * Now it doesn't d

Re: [PATCH 2/2] updating ctime and mtime at syncing

2008-01-15 Thread Anton Salikhmetov
2008/1/15, Miklos Szeredi <[EMAIL PROTECTED]>: > > Thanks for your review, Peter and Miklos! > > > > I overlooked this case when AS_MCTIME flag has been turned off and the > > page is still dirty. > > > > On the other hand, the words "shall be marked for update" may be > > considered as just

Re: [PATCH 2/2] updating ctime and mtime at syncing

2008-01-15 Thread Anton Salikhmetov
2008/1/15, Miklos Szeredi [EMAIL PROTECTED]: Thanks for your review, Peter and Miklos! I overlooked this case when AS_MCTIME flag has been turned off and the page is still dirty. On the other hand, the words shall be marked for update may be considered as just setting the AS_MCTIME

[PATCH 2/2] Updating ctime and mtime at syncing

2008-01-15 Thread Anton Salikhmetov
cleanup. + * Updating the ctime and mtime stamps for memory-mapped files. * Copyright (C) 2008 Anton Salikhmetov [EMAIL PROTECTED] */ @@ -22,6 +23,10 @@ * Nor does it mark the relevant pages dirty (it used to up to 2.6.17). * Now it doesn't do anything, since dirty pages are properly tracked

[PATCH 0/2] Updating ctime and mtime for memory-mapped files [try #4]

2008-01-15 Thread Anton Salikhmetov
1. Introduction This is the fourth version of my solution for the bug #2645: http://bugzilla.kernel.org/show_bug.cgi?id=2645 Changes since the previous version: 1) the case of retouching an already-dirty page pointed out by Miklos Szeredi has been addressed; 2) the file metadata are updated

[PATCH 1/2] Massive code cleanup of sys_msync()

2008-01-15 Thread Anton Salikhmetov
Substantial code cleanup of the sys_msync() function: 1) using the PAGE_ALIGN() macro instead of manual alignment; 2) improved readability of the loop traversing the process memory regions. Signed-off-by: Anton Salikhmetov [EMAIL PROTECTED] --- mm/msync.c | 79

Re: [PATCH 2/2] Updating ctime and mtime at syncing

2008-01-15 Thread Anton Salikhmetov
2008/1/15, Peter Zijlstra [EMAIL PROTECTED]: On Tue, 2008-01-15 at 19:02 +0300, Anton Salikhmetov wrote: diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 3d3848f..53d0e34 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -997,35 +997,39 @@ int

Re: [PATCH 1/2] Massive code cleanup of sys_msync()

2008-01-15 Thread Anton Salikhmetov
2008/1/15, Christoph Hellwig [EMAIL PROTECTED]: On Tue, Jan 15, 2008 at 07:02:44PM +0300, Anton Salikhmetov wrote: +++ b/mm/msync.c @@ -1,24 +1,25 @@ /* * linux/mm/msync.c * + * The msync() system call. * Copyright (C) 1994-1999 Linus Torvalds + * + * Massive code

Re: [PATCH 2/2] Updating ctime and mtime at syncing

2008-01-15 Thread Anton Salikhmetov
2008/1/15, Christoph Hellwig [EMAIL PROTECTED]: On Tue, Jan 15, 2008 at 07:02:45PM +0300, Anton Salikhmetov wrote: +/* + * Update the ctime and mtime stamps for memory-mapped block device files. + */ +static void bd_inode_update_time(struct inode *inode, struct timespec *ts

  1   2   >