linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: salikhmetov@gmail.com, linux-mm@kvack.org, jakob@unthought.net,
	linux-kernel@vger.kernel.org, valdis.kletnieks@vt.edu,
	riel@redhat.com, ksm@42.dk, staubach@redhat.com,
	jesper.juhl@gmail.com, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, protasnb@gmail.com
Subject: Re: [PATCH 0/2] Updating ctime and mtime for memory-mapped files [try #4]
Date: Tue, 15 Jan 2008 21:32:47 +0100	[thread overview]
Message-ID: <1200429167.26045.45.camel@twins> (raw)
In-Reply-To: <E1JEsNJ-00026T-7B@pomaz-ex.szeredi.hu>

On Tue, 2008-01-15 at 21:27 +0100, Miklos Szeredi wrote:
> > 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;
> 
> I'm a bit sceptical, as we've also pointed out, that this is not
> possible without messing with the page tables.
> 
> Did you try my test program on the patched kernel?
> 
> I've refreshed the patch, where we left this issue last time.  It
> should basically have equivalent functionality to your patch, and is a
> lot simpler.  There might be performance issues with it, but it's a
> good starting point.

It has the same problem as Anton's in that it won't get triggered again
for an already dirty mapped page.

But yeah, its simpler than fudging set_page_dirty().

> Index: linux/mm/memory.c
> ===================================================================
> --- linux.orig/mm/memory.c	2008-01-09 21:16:30.000000000 +0100
> +++ linux/mm/memory.c	2008-01-15 21:16:14.000000000 +0100
> @@ -1680,6 +1680,8 @@ gotten:
>  unlock:
>  	pte_unmap_unlock(page_table, ptl);
>  	if (dirty_page) {
> +		if (vma->vm_file)
> +			file_update_time(vma->vm_file);
>  		/*
>  		 * Yes, Virginia, this is actually required to prevent a race
>  		 * with clear_page_dirty_for_io() from clearing the page dirty
> @@ -2313,6 +2315,8 @@ out_unlocked:
>  	if (anon)
>  		page_cache_release(vmf.page);
>  	else if (dirty_page) {
> +		if (vma->vm_file)
> +			file_update_time(vma->vm_file);
>  		set_page_dirty_balance(dirty_page, page_mkwrite);
>  		put_page(dirty_page);
>  	}
> 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2008-01-15 20:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-15 16:02 Anton Salikhmetov
2008-01-15 16:02 ` [PATCH 1/2] Massive code cleanup of sys_msync() Anton Salikhmetov
2008-01-15 17:57   ` Christoph Hellwig
2008-01-15 19:02     ` Anton Salikhmetov
2008-01-15 19:10       ` Randy Dunlap
2008-01-15 19:26         ` Anton Salikhmetov
2008-01-15 19:28           ` Peter Zijlstra
2008-01-15 19:32             ` Christoph Hellwig
2008-01-15 20:12               ` Anton Salikhmetov
2008-01-15 20:46         ` Matt Mackall
2008-01-15 21:06           ` Randy Dunlap
2008-01-15 16:02 ` [PATCH 2/2] Updating ctime and mtime at syncing Anton Salikhmetov
     [not found]   ` <1200414911.26045.32.camel@twins>
2008-01-15 17:18     ` Anton Salikhmetov
2008-01-15 19:30       ` Peter Zijlstra
2008-01-15 18:04   ` Christoph Hellwig
2008-01-15 19:04     ` Anton Salikhmetov
2008-01-15 20:27 ` [PATCH 0/2] Updating ctime and mtime for memory-mapped files [try #4] Miklos Szeredi
2008-01-15 20:32   ` Peter Zijlstra [this message]
2008-01-15 20:40     ` Miklos Szeredi
2008-01-15 22:15   ` Anton Salikhmetov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1200429167.26045.45.camel@twins \
    --to=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=jakob@unthought.net \
    --cc=jesper.juhl@gmail.com \
    --cc=ksm@42.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=miklos@szeredi.hu \
    --cc=protasnb@gmail.com \
    --cc=riel@redhat.com \
    --cc=salikhmetov@gmail.com \
    --cc=staubach@redhat.com \
    --cc=torvalds@linux-foundation.org \
    --cc=valdis.kletnieks@vt.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox