[PATCH] updating the ctime and mtime time stamps in msync()

2008-01-04 Thread Anton Salikhmetov
From: Anton Salikhmetov <[EMAIL PROTECTED]> I would like to propose my solution for the bug #2645 from the kernel bug tracker: http://bugzilla.kernel.org/show_bug.cgi?id=2645 The Open Group defines the behavior of the mmap() function as follows. The st_ctime and st_mtime fields of a fil

[PATCH][RFC][BUG] updating the ctime and mtime time stamps in msync()

2008-01-07 Thread Anton Salikhmetov
From: Anton Salikhmetov <[EMAIL PROTECTED]> Due to the lack of reaction in LKML I presume the message was lost in the high traffic of that list. Resending it now with the addressee changed to the memory management mailing list. I would like to propose my solution for the bug #2645 fr

Re: [PATCH][RFC][BUG] updating the ctime and mtime time stamps in msync()

2008-01-09 Thread Anton Salikhmetov
. Silent exclusion from backups is very very nasty. <<< Please comment on my solution or commit it if it's acceptable in its present form. 2008/1/7, Anton Salikhmetov <[EMAIL PROTECTED]>: > From: Anton Salikhmetov <[EMAIL PROTECTED]> > > Due to the lack of reactio

Re: [PATCH][RFC][BUG] updating the ctime and mtime time stamps in msync()

2008-01-09 Thread Anton Salikhmetov
2008/1/9, Jesper Juhl <[EMAIL PROTECTED]>: > I've only looked briefly at your patch but it seems resonable. I'll > try to do some testing with it later. Jesper, thank you very much for your answer! In fact, I tested my change quite extensively using test cases for the mmap() and msync() system ca

Re: [PATCH][RFC][BUG] updating the ctime and mtime time stamps in msync()

2008-01-09 Thread Anton Salikhmetov
2008/1/10, Rik van Riel <[EMAIL PROTECTED]>: > On Wed, 9 Jan 2008 23:33:40 +0100 > Jakob Oestergaard <[EMAIL PROTECTED]> wrote: > > On Wed, Jan 09, 2008 at 05:06:33PM -0500, Rik van Riel wrote: > > > > Can we get by with simply updating the ctime and mtime every time msync() > > > is called, regard

Re: [PATCH] updating the ctime and mtime time stamps in msync()

2008-01-09 Thread Anton Salikhmetov
2008/1/9, Peter Staubach <[EMAIL PROTECTED]>: > Anton Salikhmetov wrote: > > From: Anton Salikhmetov <[EMAIL PROTECTED]> > > > > I would like to propose my solution for the bug #2645 from the kernel bug > > tracker: > > > > http://bugzilla.ker

Re: [PATCH][RFC][BUG] updating the ctime and mtime time stamps in msync()

2008-01-09 Thread Anton Salikhmetov
2008/1/9, Rik van Riel <[EMAIL PROTECTED]>: > On Mon, 07 Jan 2008 20:54:19 +0300 > Anton Salikhmetov <[EMAIL PROTECTED]> wrote: > > > This program showed that the msync() function had a bug: > > it did not update the st_mtime and st_ctime fields. > > > &

Re: [PATCH][RFC][BUG] updating the ctime and mtime time stamps in msync()

2008-01-09 Thread Anton Salikhmetov
2008/1/10, Rik van Riel <[EMAIL PROTECTED]>: > On Wed, 09 Jan 2008 16:06:17 -0500 > [EMAIL PROTECTED] wrote: > > On Wed, 09 Jan 2008 15:50:15 EST, Rik van Riel said: > > > > > Could you explain (using short words and simple sentences) what the > > > exact problem is? > > > > It's like this: > > > >

Re: [PATCH][RFC][BUG] updating the ctime and mtime time stamps in msync()

2008-01-10 Thread Anton Salikhmetov
2008/1/10, Jakob Oestergaard <[EMAIL PROTECTED]>: > On Thu, Jan 10, 2008 at 03:03:03AM +0300, Anton Salikhmetov wrote: > ... > > > I guess a third possible time (if we want to minimize the number of > > > updates) would be when natural syncing of the file data to disk

Re: [PATCH][RFC][BUG] updating the ctime and mtime time stamps in msync()

2008-01-10 Thread Anton Salikhmetov
2008/1/10, Rik van Riel <[EMAIL PROTECTED]>: > On Thu, 10 Jan 2008 13:53:59 +0300 > "Anton Salikhmetov" <[EMAIL PROTECTED]> wrote: > > > Indeed, if msync() is called with MS_SYNC an explicit sync is > > triggered, and Rik's suggestion would work. Ho

Re: [PATCH][RFC][BUG] updating the ctime and mtime time stamps in msync()

2008-01-10 Thread Anton Salikhmetov
2008/1/10, Rik van Riel <[EMAIL PROTECTED]>: > On Thu, 10 Jan 2008 18:56:07 +0300 > "Anton Salikhmetov" <[EMAIL PROTECTED]> wrote: > > > However, I don't see how they will work if there has been > > something like a sync(2) done after the mmap'd

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 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/m

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

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.

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 mor

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, 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 prog

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 co

[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 tempt

[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 -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

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 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, 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.

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

[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. Fun

[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 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 +

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
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 bef

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 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 _fil

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

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,

[PATCH 0/2][RFC][BUG] msync: another attempt to fix the ctime/mtime issue

2008-01-10 Thread Anton Salikhmetov
From: Anton Salikhmetov <[EMAIL PROTECTED]> I would like to propose my second solution for the bug #2645 from the kernel bug tracker: http://bugzilla.kernel.org/show_bug.cgi?id=2645 You may find the relevant background information as well as an extensive discussion of my previous solution

[PATCH 1/2][RFC][BUG] msync: massive code cleanup of sys_msync()

2008-01-10 Thread Anton Salikhmetov
From: Anton Salikhmetov <[EMAIL PROTECTED]> The patch contains substantial code cleanup of the sys_msync() function: 1) consolidated error check for function parameters; 2) using the PAGE_ALIGN() macro instead of "manual" alignment; 3) improved readability of the loop traver

[PATCH 2/2][RFC][BUG] msync: updating ctime and mtime at syncing

2008-01-10 Thread Anton Salikhmetov
From: Anton Salikhmetov <[EMAIL PROTECTED]> The patch contains changes for updating the ctime and mtime fields for memory mapped files: 1) adding a new flag triggering update of the inode data; 2) implementing a helper function for checking that flag and updating ctime and mtime; 3) up

[PATCH 2/2][RFC][BUG] msync: updating ctime and mtime at syncing

2008-01-10 Thread Anton Salikhmetov
From: Anton Salikhmetov <[EMAIL PROTECTED]> The patch contains changes for updating the ctime and mtime fields for memory mapped files: 1) adding a new flag triggering update of the inode data; 2) implementing a helper function for checking that flag and updating ctime and mtime; 3) up

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

2008-01-11 Thread Anton Salikhmetov
2008/1/11, Peter Staubach <[EMAIL PROTECTED]>: > Anton Salikhmetov wrote: > > From: Anton Salikhmetov <[EMAIL PROTECTED]> > > > > The patch contains changes for updating the ctime and mtime fields for > > memory mapped files: > > > > 1) adding a

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

2008-01-11 Thread Anton Salikhmetov
2008/1/11, Peter Staubach <[EMAIL PROTECTED]>: > Anton Salikhmetov wrote: > > From: Anton Salikhmetov <[EMAIL PROTECTED]> > > > > The patch contains changes for updating the ctime and mtime fields for > > memory mapped files: > > > > 1) adding a

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

2008-01-11 Thread Anton Salikhmetov
2008/1/12, Peter Staubach <[EMAIL PROTECTED]>: > Anton Salikhmetov wrote: > > 2008/1/11, Peter Staubach <[EMAIL PROTECTED]>: > > > >> Anton Salikhmetov wrote: > >> > >>> From: Anton Salikhmetov <[EMAIL PROTECTED]> > >>> &

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

2008-01-11 Thread Anton Salikhmetov
2008/1/11, Peter Staubach <[EMAIL PROTECTED]>: > Anton Salikhmetov wrote: > > From: Anton Salikhmetov <[EMAIL PROTECTED]> > > > > The patch contains changes for updating the ctime and mtime fields for > > memory mapped files: > > > > 1) adding a

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

2008-01-12 Thread Anton Salikhmetov
2008/1/12, Peter Zijlstra <[EMAIL PROTECTED]>: > > On Fri, 2008-01-11 at 03:44 +0300, Anton Salikhmetov wrote: > > > +/* > > + * Update the ctime and mtime stamps after checking if they are to be > > updated. > > + */ > > +void mapped_file_updat

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

2008-01-12 Thread Anton Salikhmetov
2008/1/12, Peter Zijlstra <[EMAIL PROTECTED]>: > > On Sat, 2008-01-12 at 10:36 +0100, Peter Zijlstra wrote: > > On Fri, 2008-01-11 at 03:44 +0300, Anton Salikhmetov wrote: > > > > > +/* > > > + * Update the ctime and mtime stamps after

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

2008-01-12 Thread Anton Salikhmetov
2008/1/12, Peter Zijlstra <[EMAIL PROTECTED]>: > > On Sat, 2008-01-12 at 15:38 +0300, Anton Salikhmetov wrote: > > 2008/1/12, Peter Zijlstra <[EMAIL PROTECTED]>: > > > > > > On Sat, 2008-01-12 at 10:36 +0100, Peter Zijlstra wrote: > > > > On F

[PATCH 0/2] yet another attempt to fix the ctime and mtime issue

2008-01-12 Thread Anton Salikhmetov
The POSIX standard requires that the ctime and mtime fields for memory-mapped files should be updated after a write reference to the memory region where the file data is mapped. At least FreeBSD 6.2 and HP-UX 11i implement this properly. Linux does not, which leads to data loss problems in database

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

2008-01-12 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-12 Thread Anton Salikhmetov
; 4) updating time stamps for mapped files in sys_msync() and do_fsync(); 5) implementing the feature of auto-updating ctime and mtime. Signed-off-by: Anton Salikhmetov <[EMAIL PROTECTED]> --- fs/buffer.c |1 + fs/fs-writeback.c |2 ++ fs/inode.c

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

2008-01-14 Thread Anton Salikhmetov
> > Thanks for doing this. See comments below. > > > Signed-off-by: Anton Salikhmetov <[EMAIL PROTECTED]> > > --- > > mm/msync.c | 78 > > +++- > > 1 files changed, 35 insertions(+), 43 deleti

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

2008-01-14 Thread Anton Salikhmetov
2008/1/14, Miklos Szeredi <[EMAIL PROTECTED]>: > > > http://bugzilla.kernel.org/show_bug.cgi?id=2645 > > > > > > Changes for updating the ctime and mtime fields for memory-mapped files: > > > > > > 1) new flag triggering update of the inode data; > > > 2) new function to update ctime and mtime for

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

2008-01-14 Thread Anton Salikhmetov
ut this one at all? The POSIX standard requires updating the file times every time when msync() is called with MS_ASYNC. I.e. the time stamps should be updated even when no physical synchronization is being done immediately. At least, this is how I undestand the standard. Please tell me

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

2008-01-14 Thread Anton Salikhmetov
2008/1/14, Peter Zijlstra <[EMAIL PROTECTED]>: > > On Mon, 2008-01-14 at 14:14 +0100, Miklos Szeredi wrote: > > > 2008/1/14, Miklos Szeredi <[EMAIL PROTECTED]>: > > > > > http://bugzilla.kernel.org/show_bug.cgi?id=2645 > > > > > > > > > > Changes for updating the ctime and mtime fields for memory-m

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

2008-01-14 Thread Anton Salikhmetov
2008/1/14, Miklos Szeredi <[EMAIL PROTECTED]>: > > 2008/1/14, Miklos Szeredi <[EMAIL PROTECTED]>: > > > > http://bugzilla.kernel.org/show_bug.cgi?id=2645 > > > > > > > > Changes for updating the ctime and mtime fields for memory-mapped files: > > > > > > > > 1) new flag triggering update of the ino

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 settin

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

2008-01-15 Thread Anton Salikhmetov
mapping_update_time(mapping); } } diff --git a/mm/msync.c b/mm/msync.c index 3270caa..80ca1cc 100644 --- a/mm/msync.c +++ b/mm/msync.c @@ -5,6 +5,7 @@ * Copyright (C) 1994-1999 Linus Torvalds * * Massive code cleanup. + * Updating the ctime and mtime stamps for memory-mapped

[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

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

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 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 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. Th

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 pointed

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. >

[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 l

[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 2/2] Updating ctime and mtime at syncing

2008-01-16 Thread Anton Salikhmetov
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

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 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 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 sta

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 n

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, 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]>: > > 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, 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: http

[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

[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

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 -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, >

[PATCH] signals: real-time signals delivery order

2007-07-10 Thread Anton Salikhmetov
From: Anton Salikhmetov <[EMAIL PROTECTED]> According to the POSIX standard, multiple real-time signals pending to a process should be delivered in a strict order. Specifically, the lowest-numbered signal should be delivered first and multiple occurrences of signals with the same number sho

Re: [PATCH] signals: real-time signals delivery order

2007-07-11 Thread Anton Salikhmetov
В Срд, 11/07/2007 в 07:34 +, Matthieu CASTET пишет: > Anton Salikhmetov gmail.com> writes: > > > > > From: Anton Salikhmetov gmail.com> > > > > According to the POSIX standard, multiple real-time signals > > pending to a process should be delivere